This guide explains how to connect a RAK gateway to The Things Network (TTN) v3 using Basics™ Station with LNS for secure TLS-based LoRaWAN® data communication.
Prerequisites
Before starting, ensure you have the following items to proceed with the tutorial:
A RAK gateway running WisGateOS 2.0 or later
A LoRaWAN gateway that is connected to the Internet via Wi-Fi, Ethernet, or cellular.
A registered TTN v3 account
Register the Gateway in TTN v3
This section guides the user through the TTN registration process on the TTN console.
For detailed instructions, refer to: How to Register a RAK Gateway in TTN v3.
Generate the LNS API Key (Client Token)
This key will be used by the gateway to authenticate with the LNS when operating in a Basics™ Station (LNS) connection.
- To generate a key file, navigate to API keys from the Overview page of the registered gateway.
- On the API Keys page, click + Add API Key.
In the Name field, enter the name of your key (for example, mykey).
Select Grant individual rights, then enable the following:
- Link as a Gateway to a Gateway for traffic exchange, i.e. write uplink and read downlink
- Click on the button Create API Key.
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 continue.
Configuring the Gateway
To connect your gateway to The Things Network (TTN) v3 using the LoRa Basics™ Station protocol, you need to configure the device through its Web UI.
- Log in to the gateway's Web UI.
- Go to LoRa > Configuration and set Work Mode to Basics Station.
- Click Configure Basics Station server setup to expand the relevant settings panel. Configure the following parameters:
- Basics Station Server Type: LNS Server
- Server URL: This is the link to The Things Network server. For this tutorial, the gateway is connected to the European cluster. In the Server URL field, enter: wss://eu1.cloud.thethings.network
- Server Port: 8887
- Authentication Mode: TLS server authentication and Client token
- Trust (CA Certificate): For Trust, upload the Let’s Encrypt ISRG ROOT X1 Trust certificate by clicking Choose File. The certificate file can be downloaded from this link.
- Client Token: Paste the LNS API key you generated in the previous step.
- To save your changes, click Save changes.
If everything is set up correctly, you should see that the gateway is connected to TTN console.
Troubleshooting
| ISSUE | POSSIBLE CAUSE | SOLUTION |
| Gateway not connected to TTN | Internet not connected | Check Wi-Fi, Ethernet, or Cellular connectivity on the gateway |
| Incorrect Server URL or port | Ensure you are using the correct cluster URL and port: 8887 |
FAQs
-
Is the Basics Station protocol more secure than Semtech UDP?
Yes. Basics Station uses WebSockets (WSS) and TLS encryption, providing enhanced security, authentication, and support for remote management compared to the legacy Semtech UDP forwarder. -
Can multiple gateways share the same API Key (Client Token)?
No. Each gateway must have its own API Key to ensure identity and security isolation. Reusing the same token can lead to authentication conflicts or unexpected behavior. -
My gateway is behind a firewall. What ports should be open?
Ensure that TCP port 8887 is open for outbound traffic to allow WebSocket connections between the gateway and TTN’s LNS server.
Changelog
-
Version 1.1 - Added UTM links
- Date Published: 09/01/2025
-
Version 1 - How to Connect RAK Gateways to TTN v3 Using Basics™ Station
(LNS)
- Date Published: 08/07/2025
Updated