TABLE OF CONTENTS

Description

ThingsBoard is an open-source Internet of Things (IoT) platform designed to manage devices, collect and visualize telemetry data, and enable automation.Users can create customizable dashboards to monitor real-time data, analyze historical trends, and set up rule-based alerts or automated actions. ThingsBoard also provides scalable solutions suitable for both small deployments and enterprise-level applications. With support for device provisioning, multi-tenant management, and extensible APIs, it enables developers and businesses to build complex IoT systems efficiently while maintaining flexibility and security.


Next, this article will explain how to use a ThingsBoard platform gateway as a data interface for integration. In this demonstration, the gateway used is still the UG65, and the sensor is the AM308, serving as an example for a complete end-to-end workflow.


Note: The AM08 device mentioned here is only for demonstration purposes and does not imply that other types of sensors are not supported. Readers should refer to the steps according to their actual situations.


Requirement

  • Gateway Model: UG65 (UG67 also supported)

    • Firmware Version: v60.0.0.47 or later

  • Gateway Model: UG56

    • Firmware Version: v56.0.0.7 or later

  • Sensor Model: AM308, EM300-SLD

  • Frequency Band: US915 (used in this demonstration)

  • Gateway must already be connected to the Internet

  • A valid ThingsBoard Platform account is also required


Configuration

Step 1: Register an Account of ThingBoard Platform

Visit https://thingsboard.cloud/signup and follow the on-screen :


The interface displayed upon first login after registration is as follows:  


Step 2: Create the Gateway configuration

Next, create a Gateway configuration on ThingsBoard. 

From this point onward, all of our sensors will use this gateway as the data entry point for communication. 


Refer to the screenshot below for the specific steps :


Enter a Name according to your actual situation, select Default for the Device Profile, and then click the Create button to complete the gateway creation :


Click Close to exit the pop-up window :



Step 3: Obtain the Gateway Access Token

Refer to the screenshot below for the specific steps :


In the pop-up interface, the Security section displays the token. Copy it, as it will be needed later when configuring the gateway. 

At this point, the configuration on ThingsBoard is complete. 

Next, we will start configuring the gateway. 


Step 4: Configure the gateway

a) Enable the Embedded NS feature

First, log in to your gateway management interface (refer to <How to Login Web GUI of Milesight Gateway>). 

Then operate as shown in the screenshots:

(If it is already enabled, you can skip this step.)

If the status shows Embedded NS is Enabled and Connected, it means the Embedded NS is successfully enabled. 


b) Create the Application MQTT configuration

Next, continue following my steps to configure the MQTT settings for the gateway’s application :

(These steps mainly follow "How to Connect LoRaWAN Gateway to MQTT Broker” , below are key screenshots from my configuration process for your reference. ) 

Note 1: 

Fill in the parameters exactly as shown in my screenshot. For Username, enter the gateway token we obtained earlier. Leave the Password field empty. The Broker Address and Broker Port are fixed values, use the ones shown in the screenshot.


Note 2:

The Uplink Data field must be set to v1/gateway/telemetry (as required by the ThingsBoard platform).


c) Create custom Payload Codec

Since there are two device types in this demonstration, AM308 and EM300-SLD, we need to create two records. 

First, create the AM308 Payload Codec configuration, following the steps shown in the screenshot below.


Enter am308-thingsboard-gw for the Name, select AM308 from the Template dropdown, and the Function section under Decoder will automatically populate with the corresponding code :


Scroll down to around line 179, paste the following code:

    var tb_mqtt_payload = {};
    var deviceName = LoRaObject.devEUI + " " + LoRaObject.devEUI;
    tb_mqtt_payload[deviceName] = [
    { ts: new Date().getTime(), values: decoded }
    ];
    
    return tb_mqtt_payload;

And the final result will look like the screenshot below :

Finally, click Save. Repeat the same steps for the EM300-SLD configuration. 


The final result after completing all configurations is as follows. 


d) Add the devices to the gateway

Here, the configuration mainly follows How to Connect LoRaWAN Nodes to Milesight Gateway

Below are key screenshots from the configuration process for your reference.

When adding a device, select the application we just created from the dropdown, and choose the corresponding custom Payload Codec for the device model. 


Similarly, add the remaining sensors in the same way. The final result after adding all devices is as follows:  


At this point, our configuration is complete. 

Next, go to ThingsBoard to check whether the devices have been automatically created and if the data is being received in real time. 


Step 5: Check the result

Return to the ThingsBoard platform and navigate to the Devices page. 

We can see the following results:

The platform has automatically created the corresponding device configurations, and the real-time data reported by the devices is visible.


At this point, our entire guide is complete. Next, we will create a simple Dashboard to display the data.


Step 6: Create a dashboard example

--END--