---
title: Connecting Loriot LoRaWAN© network server to your IoT Hub
description: Learn how to configure your Loriot backend to enable LoRaWAN devices to send messages to your IoT Hub.
tags: IoT-Hub LoRaWAN
products:
  - iot-hub
dates:
  validation: 2025-07-02
  posted: 2020-07-02
  validation_frequency: 12
difficulty: beginner
usecase:
  - iot
ecosystem:
  - third-party
---

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](https://loriot.io) 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:

* Create an IoT Hub to receive/send messages from/to LoRaWAN© devices
* Add a Device to the Hub to prepare the Loriot-to-Scaleway connection
* Set up the Loriot backend to use the Device credentials to establish a connection with IoT Hub
* Add another Device and connect it as a subscriber to receive LoRaWAN© messages

## Before you start

To complete the following actions, you must have:

* [Owner](/en/docs/iam/concepts/glossary/#owner) status or [IAM permissions](/en/docs/iam/concepts/glossary/#permission) allowing you to perform actions in the intended Organization

## Create an IoT Hub

First, we need to create a Hub. Its role will be to distribute messages from your LoRaWAN© devices to the intended targets. Follow [this procedure](/en/docs/iot-hub/how-to/create-hub/) to create an IoT Hub if you do not have one already. The hub's name and plan does not matter for this tutorial.

## Create an IoT Device

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. Follow [this procedure](/en/docs/iot-hub/how-to/add-device/) to create a device.

> **Note**
>
> * Use the `Allow Insecure` connections setting.
> * The device name is not important for this tutorial.

Once done, copy the `Device ID`, you will need them to set up the Loriot backend.

## Set up the Loriot backend

Now IoT Hub is ready to exchange messages, let's configure the Loriot side:

* Go to your Loriot Dashboard

* Click `Applications` and select your application in the list

* Click `Output` in the left pane, click `Add a new output` and choose `MQTT`

* Fill in the following parameters:

  * MQTT Broker URL: your IoT Hub Endpoint, followed by MQTTs port (ex: `iot.fr-par.scw.cloud`)
  * MQTT Path: the MQTT topic to publish messages to, set it to `my-app/{DEVEUI}/uplink`.
  * Username: you can not leave this field empty, so just write `x` here, it will not be used
  * Password: you can not leave this field empty, so just write `x` here, it will not be used
  * Client ID: your IoT Hub Device ID

* That's it, click `Add Output` button

> **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.

## Verify we have done things right

It is time to see messages flowing on IoT Hub:

* Create another IoT Hub Device, but this time choose the `Allow Insecure` connections setting. Secured connections are not supported over Web Sockets, which the `MQTT Webclient` uses.
* On the Device page, click the `MQTT Webclient` button. The client will open and automatically connect.

![](/en/docs/assets/tutorials/loriot-lorawan-network-server/assets/scaleway-mqtt_webclient.webp)

* Now subscribe to the LoRaWAN© devices messages:

  * Click `Add New Topic Subscription` in the `Subscriptions` block
  * Pick any color to identify this subscription
  * Leave QoS 0
  * Use `my-app/+/uplink` as the topic, this will instruct IoT Hub to send you uplink messages from all devices
  * Click subscribe

![](/en/docs/assets/tutorials/loriot-lorawan-network-server/assets/scaleway-mqtt_webclient_2.webp)

* Your subscription now appears in the `Subscriptions` block and the messages from your LoRaWAN© devices will start showing in the `Messages` block.

This means that messages are flowing as expected.

## Going further

You could leverage the power of IoT Hub to build a dashboard to display your data in a few easy steps:

* [Start a PostgreSQL managed DB Instance](/en/docs/managed-databases-for-postgresql-and-mysql/how-to/create-a-database/) and create a `lora` table with the following fields: `time` (timestamp type) and `data` (`jsonb` type)
* Configure a Database Route to push data in there, [see how to](/en/docs/managed-databases-for-postgresql-and-mysql/how-to/create-a-database/). The topic filter should be `my-app/things/+/uplink`. Your query should look like `INSERT INTO lora (time, data) VALUES (NOW(), $PAYLOAD)`.
* Start a [new Scaleway Instance](/en/docs/instances/how-to/create-an-instance/) and [setup Grafan](/en/docs/tutorials/prometheus-monitoring-grafana-dashboard/#installing-grafana).
* Add widgets to your dashboard, for a graph your query could look like `SELECT time, data->'DevEUI_uplink'->'payload'->'batteryLevel' as batteryLevel FROM lora WHERE $__timeFilter(time)`.

Your LoRaWAN© devices' data is now backed by a production-grade dashboard.

![](/en/docs/assets/tutorials/loriot-lorawan-network-server/assets/scaleway-iothub_howto_loriot_grafana.webp)

***

Learn more about [Scaleway IoT Hub](/en/docs/iot-hub/concepts/), discover how to add [Devices to the hub](/en/docs/iot-hub/how-to/add-device/) or how to check the [IoT Hub metrics](/en/docs/iot-hub/how-to/view-metrics/).
