Skip to main content

Configuring Basics Station to connect to ThingPark

info

To specifically connect a RAK WisGate Edge Gateway V2, see RAK WisGate Edge Gateway V2.

If your base station does not support the LRR software (see Supported brands of base stations), you may still connect it to ThingPark's core network if it supports Semtech's Basics Station packet forwarder.

The first step of this process consists of configuring the Basics Station software with the right ThingPark endpoints. Basics Station configuration is composed of 3 files:

  • cups.uri
  • cups.trust
  • station.conf
caution

You must take care that during the first boot, only these 3 files are present at the same location as the running "station" binary.

Other files will be created on the running folder during the execution of the Basics Station software.

Configuring cups.uri

cups.uri is a text file containing the address of the CUPS server.

The path /update-info is added to the content of that file to construct the single CUPS HTTP POST request.

Configuring cups.trust

cups.trust is a binary file containing the certificate of the CA for the CUPS server in PEM format.

The Basics Station code will verify the CUPS server authenticity by checking the content of that file during the HTTPS exchange.

  • For ThingPark Community as well as all the regional SaaS Production platforms (Europe, Australia, USA): this file must be the Amazon Root CA 1.

    • Direct link: https://www.amazontrust.com/repository/AmazonRootCA1.pem.

      Warning

      Save directly the file to cups.trust and do not copy-paste the content in a file since default text editors might alter the format.

    • Using CLI:

      • CURL
        # curl https://www.amazontrust.com/repository/AmazonRootCA1.pem > cups.trust
      • wget:
        # wget https://www.amazontrust.com/repository/AmazonRootCA1.pem
        # mv ./AmazonRootCA1.pem cups.trust
  • For self-hosted ThingPark Enterprise platforms: copy-paste the Root certificate in PEM format. This certificate is available in Cockpit under TPE Configuration > Platform Configuration:

Configuring station.conf

station.conf is a text file in JSON format. It contains settings for the configuration of the Basics Station.

The configuration fields are described in the following sections of the Basics Station documentation:

Most of the file content should be provided by the gateway manufacturer (a sample file is shown below), but few parameters may need update.

mtcdt:/var/config/lora# cat station.conf
{
"SX1301_conf": {
"lorawan_public": true,
"clksrc": 0,
"pps": true,
"device": "/dev/spidev0.0",
"radio_0": {"enable": true, "freq": 867500000, "rssi_offset": -166, "tx_enable": true, "type": "SX1257", "antenna_gain": 0},
"radio_1": {"enable": true, "freq": 868300000, "rssi_offset": -166, "tx_enable": false, "type": "SX1257", "antenna_gain": 0},
"tx_gain_lut": [
{"dig_gain": 0, "mix_gain": 11, "pa_gain": 0, "dac_gain": 3, "rf_power": -6},
{"dig_gain": 0, "mix_gain": 13, "pa_gain": 0, "dac_gain": 3, "rf_power": -3},
{"dig_gain": 0, "mix_gain": 9, "pa_gain": 1, "dac_gain": 3, "rf_power": 0},
{"dig_gain": 0, "mix_gain": 10, "pa_gain": 1, "dac_gain": 3, "rf_power": 3},
{"dig_gain": 0, "mix_gain": 12, "pa_gain": 1, "dac_gain": 3, "rf_power": 6},
{"dig_gain": 0, "mix_gain": 10, "pa_gain": 2, "dac_gain": 3, "rf_power": 10},
{"dig_gain": 0, "mix_gain": 11, "pa_gain": 2, "dac_gain": 3, "rf_power": 11},
{"dig_gain": 0, "mix_gain": 11, "pa_gain": 2, "dac_gain": 3, "rf_power": 12},
{"dig_gain": 2, "mix_gain": 12, "pa_gain": 2, "dac_gain": 3, "rf_power": 13},
{"dig_gain": 0, "mix_gain": 13, "pa_gain": 2, "dac_gain": 3, "rf_power": 14},
{"dig_gain": 0, "mix_gain": 15, "dac_gain": 3, "pa_gain": 2, "rf_power": 16},
{"dig_gain": 0, "mix_gain": 10, "pa_gain": 3, "dac_gain": 3, "rf_power": 20},
{"dig_gain": 0, "mix_gain": 12, "dac_gain": 3, "pa_gain": 3, "rf_power": 23},
{"dig_gain": 0, "dac_gain": 3, "mix_gain": 13, "pa_gain": 3, "rf_power": 25},
{"dig_gain": 0, "dac_gain": 3, "mix_gain": 15, "pa_gain": 3, "rf_power": 26},
{"dig_gain": 0, "mix_gain": 15, "dac_gain": 3, "pa_gain": 3, "rf_power": 27}
]
},
"station_conf": {
"nocca": false,
"nodc": false,
"nodwell": false,
"log_file": "~temp/station.log",
"log_level": "XDEBUG",
"log_size": 10000000,
"log_rotate": 3,
"TC_TIMEOUT": "2s"
}
}

Special attention is required for the following parameters:

  • antenna_gain: on the radio_0 for board0, and radio_1 for board1, you should set the proper antenna_gain (see Concentrator Design (v1.5) section on the Basics Station documentation).
  • log_level: should be set to CRITICAL if your logs are stored in SSD (not needed for tmpfs).
note

For some gateways, especially MultiTech, the following line must be added to the station_conf object, if not already present:

"routerid": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>"

Once you have successfully configured your Basics Station software, you are now ready to declare your gateway on ThingPark GUI, as described in Adding base stations on ThingPark.

In case you need to troubleshoot the Basics Station's bootstrapping flow, see reference logs in Troubleshooting Basics Station bootstrapping issues.

About Basics Station's persistent storage

Basics Station binary starts with only 3 configuration files: cups.uri, cups.trust, station.conf. During the software execution, 12 new files are created and are very important to keep in this persistent storage, to allow the Basics Station binary to restart properly without requiring new certificates exchange phases:

  • tc.uri, tc.crt, tc.key, tc.trust
  • cups-back.done, cups-back.uri, cups-back.trust
  • tc-back.done, tc-back.uri, tc-back.crt, tc-back.key, tc-back.trust

In case you delete those files, the Basics Station gateway will not be able to reconnect, it will be rejected at the authentication step during the certificate exchange phase with CUPS since certificates can only be served once. If this happens, you need to regenerate new certificates in ThingPark GUI (Advanced tab of the Base Station's detailed page) before restarting the gateway.