WisGateOS2 Basics Station to TTNv3
This guide shows how to configure and connect the RAK Edge Gateway V2 with WisGateOS2 to a LoRaWAN Network Server using the Basics Station protocol.
For this example, the gateway will be connected to TTNv3.
LoRa Basics Station is an implementation of a LoRa packet forwarder. This protocol simplifies the management of large-scale LoRaWAN Networks. More information about Basics Station protocol can be found in the explanatory document provided by Semtech.
Register the Gateway
- To log in into the TTNv3, head on to the TTN website. If you already have a TTN account, you can use your The Things ID credentials to log in.
This guide is for the EU868 frequency band.
- To register a commercial gateway, choose Register a gateway (for new users that do not already have a registered gateway). Or, go to Gateways > + Add gateway (for users that have registered gateways before).
- Fill in the needed information:
- Owner: Automatically filled by The Things Stack, based on the user's account or created Organization.
- Gateway ID: This will be the unique ID of the user's gateway in the Network. Note that the ID must contain only lowercase letters, numbers, and dashes (-).
- Gateway EUI: A 64 bit extended unique identifier for the gateway. The gateway's EUI can be found either on the sticker on the casing or by going to the Overview page in the Web UI. Instructions on how to access the gateway via Web UI can be found in the Quick Start Guide for each one.
- Gateway name: A name for the gateway.
- Gateway description (optional): Can be used to save notes about the gateway.
- Gateway Server Address: The address of the Gateway Server to connect to.
- Frequency plan: The Frequency plan used by the gateway.
- This tutorial is based on using the EU868 Frequency band, so the server address is
eu1.cloud.thethings.network
. - The Europe 863-870 MHz (SF12 for RX2 - recommended) is used.
- The other settings are optional and can be changed to satisfy the user's requirements.
- To register the gateway, scroll down and click Create gateway.
TTNv3 supports TLS Server Authentication and Client token, which require a trust file and a key file to configure the gateway to successfully connect it to the network. You can connect your gateway to TTNv3 by using either LNS or CUPS Server.
Connect the Gateway via LNS Server
Connect the Gateway
- To generate a key file, from the Overview page of the registered gateway, navigate to API keys.
- On the API keys page, choose + Add API key.
- In the Name field, type the name of the key (for example - Ins_key). Choose Grant individual rights and select Link as Gateway to a Gateway for traffic exchange, i.e. read uplink and write downlink.
- Generate a key by clicking Create API key. A window will pop up, prompting to copy the generated key. Then, click I have copied the key to proceed.
Once the key is copied, paste and save it in a .txt
file (or other) because you won't be able to view or copy your key afterward.
Configure the Gateway
- To configure the gateway, access it via the Web UI. For more details, refer to the Quick Start Guide for each gateway.
- Navigate to LoRa > Configuration > Work mode and select Basics station.
- Expand the Basics Station settings by clicking Configure Basics Station server setup.
- To connect the gateway to TTNv3, configure the following parameters:
- Basics Station Server Type: For server type, choose LNS Server.
- Server URL: This is the link to The Things Stack server.
For this tutorial, the gateway is connected to the European cluster. For Europe, fill in the following:
wss://eu1.cloud.thethings.network
- Server Port: The LNS Server uses port 8887. Type in 8887.
- Authentication Mode: Choose TLS server authentication and Client token. When selected, the Trust (CA Certificate) and Client token fields will show up.
- Trust (CA Certificate): For trust, upload the Let’s Encrypt ISRG ROOT X1 Trust certificate by clicking choose file. The file with the certificate can be downloaded directly.
- Client Token: This is the generated API key. The key must start with Authorization:.
For example:
Authorization: YOUR_API_KEY
- Replace
YOUR_API_KEY
with the key generated previously. Have in mind that there should be a space between Authorization: and YOUR_API_KEY, as shown in the example.
- To save the changes, click Save Changes.
Now, the gateway is connected to TTNv3 as Basics Station.
Connect the Gateway via CUPS Server
Connect the Gateway
- Since CUPS automatically configures LNS, you need to generate two API keys—one for CUPS and one for LNS. To generate the key files, from the Overview page (in the TTN console) of the registered gateway, navigate to API keys.
- On the API keys page, choose + Add API key.
- In the Name field, type the name for the LNS key (for example - lns_key). Choose Grant individual rights and select Link as Gateway to a Gateway for traffic exchange, i.e. read uplink and write downlink.
- Generate a key by clicking Create API key. A window will pop up, prompting to copy the generated key. Then, click I have copied the key to proceed.
Once the key is copied, paste and save it in a .txt
file (or other) because you won't be able to view or copy your key afterward.
-
Click on the +Add API key again. In the Name field, type the name for the CUPS key (for example - CUPS_key). Choose Grant individual rights, select the following rights below, then click on the Create API key.
- View gateway information
- Retrieve secrets associated with a gateway
- Edit basic gateway settings
- Click I have copied the key to proceed.
- Navigate to General settings and scroll down to LoRa Basics Station LNS Authentication Key. Paste the copied LNS key there.
- Scroll down and click Save changes to save the settings.
Configure the Gateway
- To configure the gateway, access it via the Web UI. For more details, refer to the Quick Start Guide for each product.
- Navigate toLoRa > Configuration > Work mode and select Basics station.
- Expand the Basics Station settings by clicking on Configure Basics Station server setup.
- To connect the gateway to TTNv3 with CUPS Server, configure the following parameters:
- Basics Station Server Type– For server type, choose CUPS Server.
- Server URL: This is the link to The Things Stack server.
For this tutorial, the gateway is connected to the European cluster. For Europe, fill in the following:
https://eu1.cloud.thethings.network
- Server Port: The LNS Server uses port 443. Type in 443.
- Authentication Mode: Choose TLS server authentication and Client token. When selected, the Trust (CA Certificate) and Client token field will show up.
- Trust (CA Certificate): For trust upload the Let’s Encrypt ISRG ROOT X1 Trust certificate by clicking choose file. The file with the certificate can be downloaded directly.
- Client Token: This is the generated CUPS key. The key must start with Authorization:.
For example:
Authorization: YOUR_API_KEY
Replace YOUR_API_KEY
with the key generated previously. Have in mind that there should be a space between Authorization: and YOUR_API_KEY, as shown in the example.
- To save the changes, click Save Changes.
Now, the gateway is connected to TTNv3 as Basics Station.