Learn how to connect a RAK gateway to The Things Network (TTN) v3 using Basics™ Station with CUPS enabled for centralized configuration and credential management.
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.
Configure CUPS and LNS API Keys
LoRa Basics™ Station separates configuration (CUPS) and data traffic (LNS) workflows. Gateways connect to the CUPS server first, retrieve connection settings and authentication tokens, and then automatically connect to the LNS server using the downloaded credentials.
- A CUPS key (for downloading configuration and updates)
- An LNS key (for actual data transmission to/from the network)
Generate a CUPS API Key
To generate a key file, navigate to API keys from the Overview page of the registered gateway.
Figure 1: The Things Stack Gateway Overview
On the API Keys page, click + Add API Key.
Figure 2: The Things Stack Gateway API Keys Overview
In the Name field, enter a name such as CUPS.
Select Grant individual rights, then enable the following permissions:
- View gateway information
- Retrieve secrets associated with a gateway
- Edit basic gateway settings
Figure 3: The Things Stack CUPS API Key Parameters
Click Create API Key to proceed.
Figure 4: The Things Stack CUPS API Key Created
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.
Generate an LNS API Key
On the same API keys page, click + Add API key again.
In the Name field, enter a name such as LNS.
Select Grant individual rights, then enable:
- Link as Gateway to a Gateway for traffic exchange, i.e., write uplink and read downlink.
Figure 5: The Things Stack Add LNS API Key
Click Create API Key to proceed.
Figure 6: The Things Stack LNS API Key Created
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.
Assign the LNS API Key to the Gateway's General Settings
To ensure the LNS key is passed to the gateway by the CUPS server:
Go to the General Settings of your gateway in the TTN Console.
In the LoRa Basics Station LNS Authentication Key field, paste the LNS API key you generated in the previous step.
Figure 7: The Things Stack Assing LNS Key to the Gateway
Click Save changes to update the gateway settings. When your gateway connects to CUPS, The Things Network will send the LNS configuration settings and the API key.
Configure 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.
Figure 8: WisGateOS 2 Login Page
- Go to LoRa > Configuration and set Work Mode to Basics Station.
Figure 9: WisGateOS 2 Configuration Page
Click Configure Basics Station server setup to expand the settings panel. Configure the following parameters:
Basics Station Server Type: CUPS Server.
Server URL: This is the link to The Things Network server. For this tutorial, the gateway is connected to the European cluster. For Europe, enter: https://eu1.cloud.thethings.network.
Server Port: 443
Authentication Mode: TLS Server & Client Token Authentication
Trust (CA Certificate): For Trust, upload the Let’s Encrypt ISRG ROOT X1 Trust certificate by clicking Choose File. You can download the certificate file here.
Client Token: Paste the CUPS API key you generated in the previous step.
Figure 10: WisGateOS 2 CUPS Server Configuration
To save your changes, click Save changes.
If everything is configured correctly, you should see that the gateway is connected to TTN console.
Figure 11: The Things Stack Gateway Connected Using CUPS
Troubleshooting
| ISSUE | POSSIBLE CAUSE | SOLUTION |
|---|---|---|
|
Gateway not connected to TTN
|
Internet not connected | Check Wi-Fi/Ethernet/cellular connectivity on the gateway. |
| Incorrect Server URL or port | Verify that you are using the correct cluster URL and port 443. |
FAQs
Q: What is the main difference between CUPS and LNS modes?
A: CUPS manages remote configuration and credential updates, whereas LNS is responsible for uplink and downlink packet forwarding. When CUPS is configured, it overrides any manual entries in LNS.
Q: Do I need both a CUPS and an LNS API key?
A: Yes. The CUPS API key is used for initial authentication and configuration retrieval, while the LNS API key is passed from CUPS to authorize uplink and downlink operations.
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
(CUPS)
- Date Published: 08/07/2025
Updated