Semtech, in its commitment to enhance user experience and streamline content, has successfully integrated the LoRa Developer Portal content into Semtech.com. As a result of this consolidation effort, the LoRa® Developer Portal will be discontinued on May 1st. After this date, you will be automatically redirected to Semtech.com.
For any technical support related to LoRa, please feel free to reach out to our experts here. If you have sales inquiries, please contact us here.
build
HOME » BUILD » TOOLS » Conformance Test Bench » Use a Different Gateway

Using a Different Gateway

If you plan to use a gateway platform other than the Pico gateway, follow these steps:

  1. Make sure that the gateway supports the Semtech packet forwarder.
  2. If there are multiple packet forwarder options, configure the gateway to use the standard Semtech UDP packet forwarder.
  3. To use an external gateway, make sure that the packet forwarder address is configured to be the same as the Test Bench host IP address. Also, make sure the up and down ports follow the corresponding fields (serv_port_upserv_port_down) in the config.json file. The default port is 1690.
  4. In the config.json file , change the “use_internal_gateway” value to zero (0). For more information, see Configure the Local Files.

Use the following commands to install the Test Bench components:

cd /home/pi

sudo git clone https://github.com/Lora-net/CTB

 

To install the ADS driver components, use these commands:

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar zxvf bcm2835-1.60.tar.gz
cd bcm2835-1.60
./configure
touch *
make
sudo make check
sudo make install

 

cd /home/pi/lorawan-conformance-testbench/ads1256/
chmod +x ads1256_driver
touch ads1256_driver.c
sudo make

 

You may configure the Test bench as a system service. To do so, use the following commands:

echo '[Unit]

Description=Conformance testbench startup service

After=network.target

[Service]

ExecStart=/usr/bin/python3 /home/pi/lorawan-conformance-testbench/start.py

WorkingDirectory=/home/pi/lorawan-conformance-testbench/

StandardOutput=null

StandardError=journal

Restart=always

User=root

[Install]

WantedBy=multi-user.target

' | sudo tee --append /etc/systemd/system/testbench.service

sudo su - pi -c 'mkdir /home/pi/lorawan-conformance-testbench/tmp'

echo 'tmpfs /home/pi/lorawan-conformance-testbench/tmp tmpfs nodev,nosuid,size=200M 0 0' | sudo tee --append /etc/fstab

sudo systemctl enable testbench

echo done

 

Configure the Software

Configure the Local Files

To configure the local files:

  1. Edit the following configuration file:

/home/pi/lorawan-conformance-testbench/config.json

You can change several parameters, including the backup interval, network server address/port, and gateway ID.

Example of CTB config.json For the US915 band and using The Things Network (router.us.thethings.network) as the network server.

Note: The “ip” field below the “packet_forwarder” line should remain empty.

{

  "backup_interval": 3600,

  "use_internal_gateway": 1,

  "network_address": {

    "test_controller": {

      "ip": "localhost",

      "port": 1000 //The default value is 1700. If using The Things Network, as in this example, use 1000

    },

    "packet_forwarder": {

      "ip": "",

      "port": 1690

    },

    "network_server": {

        "ip": "router.us.thethings.network",  //Enter the address of the LNS router you plan to use here, as well as the corresponding communication port.

        "port": 1700

    },

        "error_report": {

        "ip": "3.16.33.6",

        "port": 1692

    }

  },

  "gateway_id": "0000000000000000", //Enter the gateway ID to use. (This should be the same as in the Pktfwd global_config.json file.)

  "folder": {

      "cache": "cache",

      "backup": "db",

      "power": "tmp\/power"

  },

  "file": {

      "database_proxy": "tmp\/db_proxy.db",

      "database_controller": "tmp\/db_tc.db",

      "database_backup": "db\/db_backup.db",

      "database_power": "db\/db_pm.db"

  },

  "deduplication_threshold": 0.1

}

 

2. During the first power cycle, the digital-to-analog converter (DAC) runs a system calibration, which takes about one minute. Make sure that the host has been on for at least one minute (or make sure that the file calibration.txt is in the /home/pi/lorawan-conformance-testbench/ads1256/ folder) before you turn the host off or restart it. 

3. Restart the host by power cycling, or use the following command in the SSH console: 

sudo reboot now