LNS establishes a data connection between a LoRa Basics™ Station and The Things Enterprise Stack . This page contains information about connecting your gateway to The Things Enterprise Stack using the LoRaWAN® Network Server (LNS) protocol.
The LNS protocol is required for sending and receiving LoRaWAN data with LoRa Basics™ Station, while the CUPS protocol is not.
- User account on The Things Enterprise Stack with rights to create gateways.
- A gateway which support LoRa Basics™ Station.
Create a Gateway
To connect a gateway using the LNS protocol, you must first add the gateway in The Things Enterprise Stack . This can be done either in the console, or via the command line. See instructions for Adding Gateways.
Create an API Key
LNS requires an API Key with the following rights:
- Link as Gateway to a Gateway Server for traffic exchange, i.e. write uplink and read downlink
To create an API key for your gateway, follow instructions for Creating a Gateway API key in Adding Gateways.
Gateway configuration menus differ depending on the manufacturer, but all LoRa Basics™ Station gateways support the following configuration options. Consult your gateway documentation for more information about configuring your specific gateway.
LNS Server Address
The server address is the network endpoint of The Things Enterprise Stack LNS. It is a combination of the protocol (wss), the server address, and the port:
Enter the following in your gateway as the LNS Server Address:
<server-address>is the address of The Things Enterprise Stack . If you followed the Getting Started guide this is the same as what you use instead of
LNS Server Certificate / LNS Trust
.pem file in your gateway as the LNS Server Certificate / LNS Trust.
LNS Key File
This is a file which The Things Enterprise Stack uses to verify the identity of your gateway.
Use the following command to create a file called
lns.key with the
<gateway-api-key> you created above.
echo "Authorization: Bearer <gateway-api-key>" | perl -p -e 's/\r\n|\n|\r/\r\n/g' > lns.key
The above command creates a file called
lns.key, terminated with a Carriage Return Line Feed (
0x0D0A) character. Upload this file in your gateway as the LNS key.