Integrating Libelium Meshlium with Azure IoT Hub

This article has the objective to share how we connect Libelium Meshlium gateway and his devices, called Waspmote, with Azure IoT Hub.

Danilo Zabeu
BeyondLabsEY
7 min readSep 19, 2018

--

Libelium is a Spanish vendor specialized in providing professional Internet of Things (IoT) kits, ready for deployment, to different sectors, from e-health to smart cities. In their website has good use cases of how to explore each kit and how other companies scale their IOT applications using their technology. The most interesting thing about it it's their technology based on mesh network that enables applications with reach sensor range up to 7 Km from the gateway, which fits even in restricted conditions, of a farm, or isolated industries, such as mining, for example.

Smart Agriculture project for Organic Farms in UK

The Meshlium gateway is capable to deliver sensor events to dozens of cloud providers, including Amazon Web Services, IBM Cloud, and, for our case, Azure.

Regarding the Azure cloud, its IoT ecosystem has improved, year by year, and now became a robust platform. In the past, the events were delivered using queues applications such as Service Bus and Event Hub. Now, we have a more reliable platform that merges the important aspects of queues and events, called Azure IoT Hub.

Azure IOT Hub

Azure IoT Hub is able to receive and send commands directly to IoT devices. For our example we will only explore the data from IoT to the cloud.

The basic architecture of connection is based on, firstly, connect wirelessly the Waspmotes to the Meshlium gateway. They came pre-configured from the factory.

Waspmotes attached to sensors of Smart Cities for noise detection

Waspmotes are wireless devices attached to the sensors. In that kit they come with a solar panel and is powered by a battery as result, does not require a constant power source.

Connecting into Libelium Meshlium

There is more than one way to connect with Libelium Meshlium. One way is to use the ethernet cable, connecting the computer with the Meshlium gateway, by the LAN port.

Connecting the computer with Meshlium gateway through lan port.

The Meshlium gateway has a wireless connection too, this is the recommended way to connect with it. In our case, we have connected in Meshlium by wireless connection, and the LAN port has been used to connect the Meshlium to the internet, through a router. It’s important to say that the wireless connection is not used to connect Meshlium with the internet, instead of this, we need to use the Ethernet cable or use a SIM card for 3G or 4G wireless connection using a cellular carrier.

Access the Libelium Manager System

We choose to use the wireless connection to connect the computer with the Libelium Meshlium. The wireless connection, by default, has the same name that the device, so we can see the SSID name starting by "meshlium" connection like any other wifi available using the Windows.

There is no password to connect.

Wifi connection from Windows OS

After connect, use the browser to access the Meshlium Manager, through the address https://10.10.10.1/ManagerSystem/login.php

If doesn’t work this IP, check the correct IP accessing your wireless router configuration.

The Libelium Manager system is a portal that provides all functionality that we need to manage the Libelium IoT Kit. In this portal, we can check if the Waspmotes are sending data, configure the data integration to another place, such as an external database (on-premise or cloud database), check with the gateway has an internet connection, cloud integration, etc.

Main page of Libelium Manager System

Meshlium Manager System has default credentials:

Checking the Waspmotes data

Now that we have access, check if your sensor is connected with Meshlium. To do it, go to the “Sensor Networks” menu, and click on “RF Modules”. In this option, you can check how many sensors are connected and the last communication date.

Now we can check if the receiving sensor data, through the menu “Capturer” and clicking in “Show Data”. Check if your last data are up to date.

Waspmotes data

In our lab, we have bought more the one Libelium kits, and each kit comes two Waspmotes and one pre-configured Meshlium for this specifics Waspmotes. We had tried to use another Meshlium from another kit, it would not work, each Meshlium works only with pre-configure Waspmotes.

Its important to check if the data is consistent with the sensors. In our case, we had some old data sending by other Waspmote. One way to check it, is verify if the last data is recent.

Preparing the Azure IoT Hub environment

If all of those things is working, we can start the integration between Meshlium and Azure IoT Hub. The first step is to access your Azure subscription, go to Azure Marketplace and choose the “Internet of Things” then select "Iot Hub".

Azure Marketplace, Internet of Things, IoT Hub

Now, select the correct subscription and choose the size and scale option. We recommend to use the Basic Tier, it has all functionality limited to an amount of events and is free.

Azure IoT Hub: configuring the subscription

Finally, we can get the connection string to insert into Meshlium.

Azure IOT Hub — Shared access policies

Integrating Meshlium with Azure IoT Hub

Once we have the connection string, we can start the Meshlium integration configuration. Go to menu “Cloud Connector”, click on “Advanced Partner”, and then in “Microsoft Azure IoT Hub”.

Libelium Advanced Cloud Partner

In this configuration form, we will put the connection string that was created previously. After that, change the value of menu “Protocol” to “mqtt” and save the configuration.

A example of connection string from Azure:

In this example, the log level option has been set “Debug”. With it, we can get more information about the integration, especially if we have connections issues.

Libelium — Azure IOT Hub menu

Load your sensor to connect with Azure IoT Hub by clicking in “Load local VM” and check if your Waspmotes will be shown if not, you will need to check if you have communication between Meshlium and Waspmotes. After this, click in “Create devices in Azure IoT” and wait Meshlium create the Waspmotes in Azure.

Check if the Waspmotes were created in Azure IoT Hub.

Azure — List of Libelium devices

Finally, click on “Start” to start sending the data.

Check if your configuration status by accessing the “Log” tab. If everything is good, we will see logs like this:

In case of trouble with unauthorized to connect

We had a java exception when we were trying to send the data, just like that:

In this specific case, we were setting manually the Date and Time for Meshlium. So, we change to get the date through the NTP server and everything work normally.

Libelium time synchronization: Enable Ntp server

In the next articles, we will explain how to save the IoT events to Azure SQL Database for integration with PowerBI, developing dashboards to demonstrate, real-time, what we can discover and trigger with data available.

Stay tuned. 😎

--

--