File | File Name |
1) Quick Start Guide | Tektelic_Gateways_with_TTNv3_Getting_Started_Guide_v2.pdf |
2) Software packages in zip file | Basic-Station-packages-v1.5.1-for-Tektelic-gateways.tar.gz |
3) Read Me (captures instructions to install software packages) | README.tektelic-basic-station |
WARNING: Installing Basics Station in a gateway with BSP older than the major+minor version of the 2021-08 system release will cause the gateway to be CORRUPTED indefinitely. Hence, please make sure that the BSP is updated prior to installing Basics Station. The 2021-08 system releases are listed below. BSP Upgrade instructions can be found in the COMMUNITY section of the Support Portal.
- Kona Micro -> major+minor version: 3.3.x
- Kona Macro -> major+minor version: 4.3.x
- Kona Mega -> major+minor version: 4.3.x
INFO : Either a Linux machine or Windows Subsystem for Linux (WSL Ubuntu) is required for following along in this guide. For all the terminal commands in this document, please DO NOT enter $. It is used to indicate the beginning of a new command.Login to the gateway using SSH with the following command:NOTE: For the commands below, please replace gateway-ip with the IP Address of your gateway.$ ssh root@gateway-ipEnter the password of the gateway when requested (9-Digit Serial Number by default).You can find the current Basics Station version (if installed) on the gateway with the following command:$ opkg info tektelic-bstn | grep Status
The latest version of Basics Station is v1.5.1. If you are not on the latest version please install to the latest version, run the following commands on the gateway SSH terminal:
$ curl -k --user customer:vU6_ATR3 --ssl-reqd ftp://ftp.tektelic.com/Basic_Station/Basic-Station-packages-v1.5.1-for-Tektelic-gateways.tar.gz -o /lib/firmware/Basic-Station-packages-v1.5.1-for-Tektelic-gateways.tar.gz$ tar -C /lib/firmware -zxvf /lib/firmware/Basic-Station-packages-v1.5.1-for-Tektelic-gateways.tar.gz$ echo "src/gz bstn file:///lib/firmware/Basic-Station-packages-v1.5.1-for-Tektelic-gateways" > /etc/opkg/bstn-feed.conf$ opkg update$ opkg install tektelic-bstn curl libcurl4
After running the above commands please make sure that in /etc/default/config.json the server_address field has a value of "127.0.0.1". In addition, add report_count: 1, in the gateway-conf section of the file.
Customer with a US gateway, need to make sure that the /etc/default/config.json file is configured for the 2nd sub-band of frequencies in US915
- Login to TTNv3 Network Server with a web browser:
- If using The Things Stack Community Edition:
- https://eu1.cloud.thethings.network/ - For EU based Customers
- https://nam1.cloud.thethings.network/ - For NA Based Customers
- https://au1.cloud.thethings.network/ - For AU Based Customers
- If using The Things Stack Cloud:
- Use the URL for your organization. More information can be found here.
- Navigate to the Gateways page and select Add gateway button
- Enter the Gateway ID , Gateway EUI and Gateway Name
- Select the frequency plan for your region (with used by TTN)
- Select Submit. This will add a new Gateway to TTNv3
Since CUPS automatically configures LNS, you will need two API keys.WARNING : Please save the keys in a secure location as you will not be able access them again in the future. If you lose them, you will have to create new keys and replace them in the gateway configuration.LNS API Key
- Go to Gateways page and select your gateway
- Select API Keys from the left side menu
- Select Add API key on the right side to add an API Key
- Enter a name for your key
- Select Grant Individual Rights
- Select ONLY the following checkbox:
- Link as Gateway to a Gateway Server for traffic exchange, i.e. write uplink and read downlink
- Click Create API Key
- You will see a screen that shows your newly created API Key. You can now copy it to your clipboard by pressing the copy button. After saving the key in a safe place, press I have copied the key
- This is your LNS API Key
CUPS API Key
- Go to Gateways page and select your gateway
- Select API Keys from the left side menu
- Select Add API key on the right side to add an API Key
- Enter a name for your key
- Select Grant Individual Rights
- Select ONLY the following checkboxes:
- View gateway information
- Retrieve secrets associated with a gateway
- Edit basic gateway settings
- Click Create API Key
- You will see a screen that shows your newly created API Key. You can now copy it to your clipboard by pressing the copy button. After saving the key in a safe place, press I have copied the key
- This is your CUPS API Key
1. Run the following commands either on a Linux machine or an instance of Windows Subsystem for Linux:WARNING: Do not run these commands on the gateway, as it will CORRUPT the gateway!Note : For the commands below, please change thethings.example.com with your TTNv3 Network Server URL. As mentioned here, the Identity Server APIs are only available in the eu1 cluster. Hence, clusterID must be changed to eu1. This is the case for both Cloud and Community Editions.
$ curl -k -O -L https://github.com/TheThingsNetwork/lorawan-stack/releases/download/v3.11.3/lorawan-stack_3.11.3_linux_amd64.deb$ sudo apt install ./lorawan-stack_3.11.3_linux_amd64.deb$ sudo apt install xdg-utils$ ttn-lw-cli use thethings.example.com --fetch-ca --user --overwrite$ ttn-lw-cli login
2. After logging in to the browser it should display a message saying: The CLI successfully got an access token. You can now close this window and return to the CLI.3. Now you can configure CUPS in The Things Stack to transmit the LNS API key when a gateway connects. Run the following commands:Note: For the commands below, please change the following:
- your-gateway-id with your Gateway ID from The Things Stack
- your-lns-api-key with the LNS API Key created in the previous step
$ export GTW_ID="your-gateway-id"$ export LNS_KEY="your-lns-api-key"$ export SECRET=$(echo -n $LNS_KEY | xxd -ps -u -c 8192)$ ttn-lw-cli gateways update $GTW_ID --lbs-lns-secret.value $SECRET
4. If successful, you should receive a response as follows:{"ids": {"gateway_id": "<gateway-id>"},"created_at": "2020-10-13T10:49:02.730Z","updated_at": "2020-11-17T14:52:06.440Z","version_ids": {},"lbs_lns_secret": {"key_id": "is/gateway-secrets-encryption-key","value": "<encrypted-base64-lns-api-key>"}}
The following files (keys and certificates) are required for the gateway to connect to TTNv3:
- tc.uri
- tc.trust
- cups.uri
- cups.trust
- tc.key
- cups.key
tc.uri: (LNS Server Address)
This file should contain the LNS Server Address: wss://<server-address>:8887The server address is the network endpoint of The Things Stack LNS. It is a combination of the protocol (wss) , the server address , and the port. To create a new folder to keep all files and create this file, run the following commands:Note: For the commands below, please replace server-address with your TTNv3 Network Server URL$ mkdir certificates$ cd certificates$ echo "wss://server-address:8887" > tc.uritc.trust: (LNS Trust)
To create a tc.trust file, you will have to download the complete certificate list (.pem) file from this link. To do so, please run the following command:$ curl https://curl.haxx.se/ca/cacert.pem --output tc.trust -Ltc.key: (LNS Key)
Make sure that you have logged into TTN CLI or followed all steps above before executing the following commands. Run the following commands to create a tc.key file.NOTE: For the commands below, please replace your-lns-api-key with the LNS API key you created above.$ export LNS_KEY="your-lns-api-key"$ echo "Authorization: Bearer $LNS_KEY" | perl -p -e 's/\r\n|\n|\r/\r\n/g' > tc.keycups.trust: (CUPS Trust)
To create a cups .trust file, you will have to download the complete certificate list (.pem) file from this link. To do so, please run the following command:$ curl https://curl.haxx.se/ca/cacert.pem --output cups.trust -Lcups.uri: (LNS Server Address)
This file should contain the LNS Server Address: https://<server-address>:443The server address is the network endpoint of The Things Stack LNS. It is a combination of the protocol (https) , the server address , and the port. To create this file, run the following command:Note: For the commands below, please replace server-address with your TTNv3 Network Server URL$ echo "https://server-address:443" > cups.uricups.key
Make sure that you have logged into TTN CLI or followed all steps above before executing the following commands. Run the following commands to create a cups .key file:NOTE: For the commands below, please replace your-cups-api-key with the LNS API key you created above.$ export CUPS_KEY="your-cups-api-key"$ echo "Authorization: Bearer $CUPS_KEY" | perl -p -e 's/\r\n|\n|\r/\r\n/g' > cups.key
Make sure that the gateway is powered on, and you have SSH access to it. SCP can be used to transfer the files to the gateway. Run the following commands to transfer the certificates and keys to the /etc/bstn directory on gateway:NOTE: For the commands below, please replace gateway-ip with the IP Address of your gateway$ scp * root@gateway-ip:/etc/bstnEnter the password of the gateway when requested (9-Digit Serial Number by default).All certificates and files have now been transferred to the gateway successfully.
SSH back into the gateway, Reboot Basics Station and TEKTELIC Packet Forwarder with the following commands:
$ /etc/init.d/tektelic-bstn restart$ /etc/init.d/pkt_fwd restart