LoRa 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.
LoRa devices broadcast their data to reachable LoRa gateways, which forward the messages on the LoRa operator network. The operator de-duplicates the messages from multiple gateways and hand over the message to the “LoRa application”. In our scenario, the “LoRa application” is Scaleway IoT Hub.
Loriot is a LoRaWAN network server provider which to connect your LoRa gateways and build your private LoRa network.
In this tutorial we are going to:
First, we need to create a Hub. Its role will be to distribute messages from your LoRa devices to the intended targets. Please follow this procedure to create an IoT Hub. Choose any name and any plan you wish.
We now need to add a Device to the IoT Hub because the Loriot platform will connect as a MQTT device to exchange data on IoT Hub. Please follow this procedure to do so. Give it the name you want. You should choose
allow insecure connection setting. Although data exchanged between Loriot and Scaleway will safely be encrypted with TLS, Loriot doesn’t yet support mutual authentication.
Once it is done, copy the
Device ID, you will need it to set up the Loriot backend.
Now IoT Hub is ready to exchange messages, let’s configure the Loriot side:
Applicationsand select your application in the list
Outputin the left pane, click
Add a new outputand choose
xhere, it won’t be used
xhere, it won’t be used
Please note 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 connectionsetting to keep this step simple.
Add New Topic Subscriptionin the
my-app/+/uplinkas the topic, this will instruct IoT Hub to send you uplink messages from all devices
Subscriptionsblock and the messages from your LoRa devices will start showing in the
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:
loratable with the following fields:
time(timestamp type) and
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 LoRa devices data is now backed by a production-grade dashboard!