Connecting to TTN
There are two ways to connect to the Things Network: Packet forward and Basics™ Station. Choose a way to connect your gateway.
Semtech UDP Packet Forwarder is the original LoRaWAN® packet forwarder, connecting to servers through the Semtech UDP protocol.
LoRa Basics™ Station is the preferred way of connecting Gateways to The Things Stack.
Connecting via Packet Forwarders
The Semtech UDP Packet Forwarder is the original LoRaWAN® packet forwarder, connecting to servers through the Semtech UDP protocol.
TTN Configuration
Step 1: Log into The Things Stack. If you don't have a TTN account, please register first.
Step 2: Register the gateway
Gateway EUI: Gateway EUI can be found on the device label or Local Console
Gateway ID: A unique identifier for your gateway(the ID must contain only lowercase letters, numbers, and dashes)
Gateway name: A name of your gateway
Frequency plan: Select the corresponding frequency according to your gateway version
You can check the Gateway in the overview after successful registration.
Gateway Configuration
Configure the gateway via the Web UI,please check the Quick Start to log into Local Console first.
- Step 1: LoRa Network Settings
Navigate to LoRa > LoRa Network
- Step 2: Set Mode to Packet Forward
- Step 3:Packet Forwarder Settings:
Gateway EUI: It will automatically get the EUI of the connected gateway
Server Address: For Semtech UDP Packet Forwarder use 'server-address' The 'server-address' is the address of your The Things Stack deployment. See Server Addresses for more info.
Server Port(Up/Down): The Up Port and Down Port are typically 1700.
Other settings can be left as default, or can be changed to suit your requirements.
Click Save&Apply to apply your settings.
- Step 4: Channel Plan Settings
Navigate to LoRa > Channel Plan
Select the Region and Frequency plan according to the actual choice.
After setting, click Save&Apply
Connecting via Basic Station
LoRa Basics™ Station is the preferred way of connecting Gateways to The Things Stack.
TTN Configuration
- Step 1: Register gateway
- Step 2:Enable Require authenticated connection
This will only allow a gateway to connect if it uses a TLS enabled Basic Station or MQTT connection.
- Step 3: Create an API key
Select a option to generate a API key for the CUPS or LNS service automatically, then you can authorize the gateway right away.
Choose a Server according to your need, then click “Register gateway”
LoRaWAN Network Server (LNS)
LNS establishes a data connection between a LoRa Basics™ Station gateway and a Network Server (in this case, The Things Stack). LoRa® uplink and downlink frames are exchanged through this data connection. The LNS protocol is required for sending and receiving LoRaWAN data.
Configuration and Update Server (CUPS)
CUPS allows a Network Server to configure gateways remotely, and to update gateway firmware. CUPS is not required for sending and receiving LoRaWAN data, but it can greatly simplify the management of gateways. Configuring CUPS will also automatically retrieve LNS credentials and configure LNS on your gateway.
More information about LoRa Basics™ Station is available at Semtech’s Developer Portal.
Gateway Configuration
- Step 1: LoRa Network Settings Navigate to LoRa > LoRa Network
- Step 2:Set Mode to Basics Station
- Step 3:Basic Station Settings:
Gateway EUI: It will automatically get the EUI of the connected gateway
Server: Select LNS or CUPS Check the previous step for more details about the servers.
URL: CUPS uses the URI: https://server-address:443, LNS uses the URI: wss://server-address:8887
Authentication Mode: TLS server authentication and Client token The Things Stack supports TLS server authentication and client token. This requires a .trust file and a .key file. .
trust: This is the CA certificate which secures your domain. A .pem file containing common certificates is available in the Root Certificates Reference. Download the minimal certificate list, then copy the data content of the certificate file (the certificate can be opened in text form).
- token: Authorization:Bearer <Your_API_Key>
Other settings can be left as default, or can be changed to suit your requirements.
Check the Gateway Status
After the settings are completed, we can view the live data of your gateway.
You can see that your gateway is connected to TTN now.