index
The Things Network (TTN)
This tutorial illustrates how to configure and connect your RAK Gateway with WisGateOS 2 to a LoRaWAN Network Server by using the Basics Station protocol. For this example, it will be shown how to connect the gateway 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 the Basics Station protocol can be found in the explanatory document provided by Semtech.
Registering the Gateway
- Log in first and head on to TTNv3 website. If you already have a TTN account, you can use your The Things ID credentials to log in.

This tutorial 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 > + Register gateway (for users that have registered gateways before).

-
You will be redirected to the Register gateway page.
-
In the Gateway EUI field, type the EUI of the gateway. The gateway's EUI can be found either on the sticker on the casing or by going to the Dashboard > Overview page via the Web UI. Instructions on how to access your gateway via Web UI can be found in the product's Quick Start Guide.

- After typing the EUI, click Confirm. Additional fields will pop up. Fill in the following information:
- Gateway ID – This will be the unique ID of your gateway in the Network. An ID based on the EUI is automatically generated. You can change it if you need. Note that the ID must contain only lowercase letters, numbers, and dashes (-).
- Gateway name – Optionally, you can type a name for your gateway.
- Frequency plan - The frequency plan used by the gateway.
- The other settings are optional and can be changed to satisfy your requirements.
- For this tutorial, we will use Europe 863-870 MHz (SF12 for RX2).

- To register your gateway, click Register gateway.

Generating the Token
TTNv3 supports TLS server authentication and Client token, which requires a trust file and a key file to configure the gateway to successfully connect it to the network.
- 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 your key (for example - mykey). Choose Grant individual rights and select Link as Gateway to a Gateway for traffic exchange, i.e. write uplink and read downlink.

- To generate the key, choose Create API key. The following window will pop up, telling you to copy the key you just generated.

Copy the key and save it in a .txt
file (or other), because you won’t be able to view or copy your key after that.
- Click I have copied the key to proceed.
Configuring the Gateway
-
To configure the gateway, access it via the Web UI. To learn how to do that, 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. Note that, 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.

- To save the changes, click Save Changes.
If everything is set correctly, you can see the gateway is connected to TTNv3.
