New: the AI firewall watches every module and explains each incident in plain words. See how it works

Connect your first LoRaWAN sensor

The short path – add a Basics Station gateway, put its token on it, add an OTAA sensor, check the codec and see the first decoded uplink.

This page takes one LoRaWAN gateway and one LoRaWAN sensor from the box to decoded readings in about fifteen minutes. It uses the most common setup: a gateway that speaks Basics Station and a sensor that joins over the air (OTAA). Each step links to the full page in the LoRaWAN section.

What you need

  • The Admin role (permission to manage LoRaWAN gateways and devices).
  • An EU868 gateway that supports Basics Station (LNS mode), with access to its own configuration page. Gateways that only run the UDP packet forwarder are not supported.
  • An EU868 sensor and its supplier sheet with the DevEUI, JoinEUI (also called AppEUI) and AppKey.
  • Room for two more devices in your plan: the gateway and the sensor each count as one device.

If your gateway is a licensed router with a LoRa radio, skip steps 1 and 2 and follow Licensed routers as LoRaWAN gateways.

1. Add the gateway

  1. Open Devices and select New device.
  2. Choose LoRaWAN gateway (“A Basics Station gateway, by its EUI; its token is shown once.”).
  3. Enter a Name (for example Roof, north side) and the Gateway EUI: 16 hexadecimal digits from the gateway’s label or web page. Spaces, - and : are removed for you. The Region is fixed to EU868.
  4. Select Add gateway.

The drawer shows the Connect the gateway values: the LNS address, the Discovery address and the Token header, with buttons to download tc.uri, tc.trust and tc.key.

Warning

The token is shown only here, once. Copy the token header or download the three files before you close the drawer. If you lose it, rotate the token later. See Add a LoRaWAN gateway.

2. Configure the gateway

On the gateway’s own configuration page:

  1. Choose the network server mode Basics Station (LNS).
  2. Set the server address (tc.uri) to the LNS address, wss://<your organisation's address>.<network server host>. If the gateway asks for a discovery address instead, use the Discovery address.
  3. Set the server certificate (tc.trust): upload the downloaded file, or choose the gateway’s system certificate store.
  4. Set the authorisation token (tc.key) to the Token header line, or upload the downloaded tc.key.
  5. Save and restart the gateway’s forwarder.

Back in Hermetry, open the gateway from Devices and select its LoRaWAN tab. Within a minute the status says Online, and Round trip and Connected since fill in. See Connect a Basics Station gateway.

3. Add the sensor

  1. Open Devices > New device and choose LoRaWAN device (“An end device, by its DevEUI, JoinEUI and AppKey.”).
  2. Keep Activation on OTAA (joins with its AppKey).
  3. Fill in Name, DevEUI, JoinEUI (AppEUI) (use 0000000000000000 when the sheet has none), AppKey (32 hexadecimal digits), LoRaWAN version (1.0.3 unless the sheet says otherwise) and Class (A for battery sensors).
  4. Select Add device. The drawer says The device was added. It shows as joined after its first join request.

The sensor is added on the built-in profile LoRaWAN EU868 Class A OTAA (1.0.3). Only pairing mode adds devices to a profile of your choice.

Warning

The AppKey is stored encrypted and never shown again. Keep the supplier’s sheet.

See Add an OTAA device. For sensors with fixed session keys, see Add an ABP device.

4. Let it join

Power the sensor on, or make it join again (many sensors have a button or a magnet for this). Open the sensor’s LoRaWAN tab: the join badge next to the heading changes to Joined after a successful join. The join and the first uplinks also appear in the frames log: Devices > ⋯ > LoRaWAN frames.

See How a device joins, step by step.

5. Check the codec

A codec turns the sensor’s bytes into readings. A new device uses Automatic (by maker and port): Hermetry picks the codec that claims the sensor’s maker (from its DevEUI) and the frame’s FPort. Your own codecs are tried before the library’s 106 codecs.

On the sensor’s LoRaWAN tab, look at Codec:

  • If a codec was found, keep Automatic.
  • If no codec claims the sensor, the payload arrives undecoded as hex under the key raw. Choose the sensor’s codec from the list and select Save, or use None (raw payload to the flows) and decode it in a flow.

See Codecs: turning bytes into values and The codec library.

6. See the first readings

Open the sensor’s Telemetry tab. After the next uplink, the Latest values table shows the decoded keys, for example temperature, humidity and battery, plus the radio keys lora.rssi, lora.snr and others when the profile adds them. The LoRaWAN tab shows the Latest reception with the gateways that heard it.

Battery sensors often send only every 10 to 60 minutes. Check the frames log if you do not want to wait.

If it does not work

SymptomFirst check
The gateway never shows OnlineIt still runs the UDP forwarder, the token line is incomplete, or it does not trust the certificate. See the troubleshooting table in Connect a Basics Station gateway.
Nothing from the sensor in the frames logThe sensor is out of range, is not an EU868 device, or has not tried to join.
A join is refused in the frames logWrong AppKey or JoinEUI, or a reused DevNonce. See Troubleshooting joins.
Joined, but only raw arrivesNo codec claims the sensor. Pick one on the LoRaWAN tab.
Values arrive with the maker’s namesRename and convert them. See Cleaning up decoded values.

Next steps