LoRaWAN© is a low-power, low-bandwidth, long-range radio protocol used by many devices to send their data over the air. This protocol is specifically designed for battery powered devices with little to no installation cost.
LoRaWAN© devices broadcast their data to reachable LoRaWAN© gateways, which forward the messages on the LoRaWAN© operator network. The operator de-duplicates the messages from multiple gateways and hand over the message to the “LoRaWAN© application”. In our scenario, the “LoRaWAN© application” is Scaleway IoT Hub.
Loriot is a LoRaWAN© network server provider on which to connect your LoRaWAN© gateways and build your private LoRaWAN© network.
In this tutorial we are going to:
First, we need to create a Hub. Its role will be to distribute messages from your LoRaWAN© devices to the intended targets. Please follow this procedure to create an IoT Hub if you don’t have one already. The hub’s name and plan does not matter for this tutorial.
The Loriot platform will connect as a MQTT device to exchange data on IoT Hub. This means that we need to add a Device to the IoT Hub. Please follow this procedure to create a device.
Notes:
Allow Insecure
connections setting.Once done, copy the Device ID
, you will need them to set up the Loriot backend.
Now IoT Hub is ready to exchange messages, let’s configure the Loriot side:
Applications
and select your application in the listOutput
in the left pane, click Add a new output
and choose MQTT
iot.fr-par.scw.cloud
)my-app/{DEVEUI}/uplink
.x
here, it won’t be usedx
here, it won’t be usedAdd Output
buttonPlease note that there is an additional step to be performed if you are using a Loriot private network server. You should get in touch with your Loriot representative for this.
It is time to see messages flowing on IoT Hub:
Allow Insecure
connections setting. Secured connections are not supported over Web Sockets, which the MQTT Webclient
uses.MQTT Webclient
button. The client will open and automatically connect.Add New Topic Subscription
in the Subscriptions
blockmy-app/+/uplink
as the topic, this will instruct IoT Hub to send you uplink messages from all devicesSubscriptions
block and the messages from your LoRaWAN© devices will start showing in the Messages
block.Congratulations! Messages are flowing as expected.
You could leverage the power of IoT Hub to build a dashboard to display your data in a few easy steps:
lora
table with the following fields: time
(timestamp type) and data
(jsonb type)my-app/+/uplink
. Your query should look like INSERT INTO lora (time, data) VALUES (NOW(), $PAYLOAD)
.SELECT time, data->'bat' as batteryLevel FROM lora WHERE $__timeFilter(time)
.That’s it! Your LoRaWAN© devices data is now backed by a production-grade dashboard!
Learn more about Scaleway IoT Hub, discover how to add Devices to the hub, check the IoT Hub metrics or get started in a few clicks with the IoT Hub Kickstarts.