CONTENTS



1. Introduction

This document introduces a simple step-by-step guide to quickly integrate Milesight LoRaWAN devices with ThingsBoard platform, enabling real-time display of LoRaWAN sensor data on the platform.

 

2. Requirement

  • Milesight LoRaWAN Gateway: take UG65 as example
  • ThingsBoard account (cloud or on-premises version): take cloud account as example
  • Milesight LoRaWAN devices: take AM308 as example

 

 

3. Configuration

3.1. Register and Login a ThingsBoard Account

Visit https://thingsboard.cloud/signup and follow the instructions to register an account. And login to this account after registration.

 

Next, choose one of the following methods to achieve integration.

 

3.2. Integration via Gateway Embeded LNS (HTTP)

This method only works with Milesight UG56/UG65/UG67 gateways.


3.2.1. Create a HTTP Endpoint

Add an integration:

 

In the pop-up interface, select "HTTP":

 

Click "Next":

 

In the next interface, click "Library":

 

Enter "Milesight" in the Vendor field. The "Model" field will automatically display a dropdown list of all Milesight sensors. Select your sensor type. For this example, select "AM308: 8-in-1 IAQ Sensor":

 

Once selected, the Decode script will be auto-populated:

 

Click "Next" to create a new downlink converter or skip this step.

 

Copy the HTTP endpoint URL as it will be used later. 

 

Click "Add" to complete the setup.

 

3.2.2. Add a HTTP Integration to Gateway

Go to Application page to add a HTTP integration:

 

Enter the HTTP address obtained in Create a HTTP Endpoint into the "Uplink data" configuration field.

Click “save” to complete the configuration.


3.2.3. Add Sensors to the Gateway

Refer to article How to Connect LoRaWAN Nodes to Milesight Gateway to add sensors to gateway.

 

Note: Set "Payload Codec" to "None" since the decoding will be handled by ThingsBoard, not the gateway.

 

3.2.4. Check Results

Click the integration:

 

You will see the AM308 device successfully transmitting data from UG65 to ThingsBoard.

 

 

3.3. Integration via Third-Party LNS Platforms

Take The Things Stack as example to integrate Milesight LoaWAN devices to Thingsboard.


3.3.1. Connect the Gateway to The Things Stack

Refer article Milesight Gateway - The Things Stack(TTN) Integration via Semtech Packet Forwarder or Milesight Gateway - The Things Stack(TTN) Integration via Basic Station to connect gateway to The Things Stack and ensure the gateway is online.

 

 

3.3.2. Add Devices to The Things Stack

Refer article The Things Stack-Milesight LoRaWAN Device Integration to add the LoRaWAN devices to The Things Stack.

The result after adding is as follows:

 

 

3.3.3. Get MQTT Server Information

Record the MQTT server information of The Things Stack and click “Generate new API key” to get the content of the key, which will be used in later steps.

 

 

 

3.3.4. Create The Things Stack Community Integration

Add an integration:

 

Select the option shown in the pop-up screen:

 

Click “Next”:

 

In the next interface, fill in “Milesight” for “Vendor”, then fill in ” AM308”, and scroll down to select the corresponding device:

 

Once configured, click “Next”:

 

Click "Next" to create a new downlink converter or skip this step.

 

Just fill in the parameters as shown (all parameters here are taken from Get MQTT Server Information):

 

When the configuration is complete, click “Check connection”:

 

3.3.5. Check Results

As shown in the figure, the ThingsBoard has successfully connected to The Things Stack, and the result is as follows:

 

And you can see real-time device data:

 

And in Devices page, you can see the AM308 devices and see the real-time data:

 

At this point, we have completed the interface between The Things Stack and the ThingsBoard platform, in which the data from the sensor AM308 is forwarded to The Things Stack through the UG65, and then forwarded to the ThingsBoard platform by The Things Stack. ThingsBoard can decode the data from AM308 in real time.

 

3.4. Create a Dashboard Example

Click on the AM308 column:

 

In the pop-up window, follow the configuration shown in the image and select the desired fields:

 

For this example, select battery, co2, humidity, and light_level. Click "Show on widget":

 

 In the pop-up window, click "Add":

 

After a short wait, the Dashboard menu will display the newly created example:

 

 

-END-