how to connect rak gateways to ttn v3 using basics™ station (lns)

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:

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.

  1. To generate a key file, navigate to API keys from the Overview page of the registered gateway.
TTN V3 Gateway Overview Tab
Figure 1: TTN V3 Gateway Overview Tab
  1. On the API Keys page, click + Add API Key.
TTN V3 API Keys Tab
Figure 2: TTN V3 API Keys Tab
  1. In the Name field, enter the name of your key (for example, mykey).

  2. 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
TTN V3 Add API Keys
Figure 3: TTN V3 Add API Keys 
  1. Click on the button Create API Key.
TTN V3 Copy Created API Key
Figure 4: TTN V3 Copy Created API Key
‼️
IMPORTANT

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.

  1. 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.

  1. Log in to the gateway's Web UI.
wisgateos 2 login page
Figure 5: WisGateOS 2 Login Page
  1. Go to LoRa > Configuration and set Work Mode to Basics Station.
WisGateOS 2 Configuration Page
Figure 6: WisGateOS 2 Configuration Page
  1. 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.
WisGateOS 2 LNS Server Configuration
Figure 7: WisGateOS 2 LNS Server Configuration
  1. To save your changes, click Save changes.

If everything is set up correctly, you should see that the gateway is connected to TTN console.

TTN V3 WisGate Gateway Connected
Figure 8: TTN V3 WisGate Gateway Connected

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

  1. 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.
  2. 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.
  3. 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