Call Phone +8618073152920 Hotline: +8618073152920
Call Phone +8618073152920
CONTACT US/ CONTACT US
Consumer hotline +8618073152920
Changsha Zoko Link Technology Co., Ltd.

Email:Arvin@niubol.com

WhatsApp:+8615367865107

Address:Room 102, District D, Houhu Industrial Park, Yuelu District, Changsha City, Hunan Province, China

Position:Home >> Blogs >> Technical Support

Technical Support

How to Connect NiuBoL Sensor to Thinger IoT Platform via MQTT Protocol

Time:2025-04-10 21:24:42 Popularity:118

This page (https://docs.thinger.io/mqtt) explains how to connect Niubol devices to the Thinger.io platform via the MQTT protocol. MQTT is a lightweight publish/subscribe messaging protocol, well-suited for communication between IoT devices and platforms. Below, I will summarize the content of the page and provide a step-by-step guide on how to connect your device to the Thinger.io platform using MQTT. 

This article will detail how the NiuBoL sensor, through a data logger (gateway/data recorder), uses the MQTT protocol to connect to the Thinger.io platform. Thinger.io supports the MQTT protocol, allowing devices to communicate with the platform by publishing (Publish) and subscribing (Subscribe) to messages. Devices need to use specific MQTT topic formats and authenticate through a device token. This article will also explain how to configure the MQTT client, connect to Thinger.io's MQTT server, publish and subscribe to data, and manage device properties, resources, and callbacks.

 Iot platform.png

 *Prerequisites:

- You already have a Thinger.io account. If not, please register.

- Your device supports the MQTT protocol. 

 Step-by-Step Guide 

 Step 1: Create a Device on Thinger.io

1. Login to Thinger.io

   - Open your browser, visit Thinger.io, and log in using your username and password.

2. Go to the Devices Management Page

   - In the left menu, click "Devices."

3. Add a New Device

   - Click the "Add Device" button.

Add a New Device.png

4. Choose Device Type

   - Device Type: Select "MQTT Device."

   - Device ID: Enter a unique device name, e.g., "NiuBoL."

   - Device Credentials: This is the device security password, which can be randomly generated using the button at the bottom. Copy and save this token for later use.

   - Description: Optional, fill in a description like "My MQTT device," I used "Soil sensor NBL-S-TMC."

Add a New Device.png

   - Click "Add Device" to save.

device to set up.png

   After creating the device, you can click to enter the device to set up or change its password.

set up or change its password.png

Notes:

- Device Type: "MQTT device" should be selected.

- Device Identifier: Must be unique among your devices.

- Device Description: Additional information to help identify each device.

- Device Credentials: This is the device security password, which can be randomly created using the button at the bottom. 

When all information is entered, pressing the "Add Device" button will create a new device profile in the device list. If everything is correct, indicating that the Thinger.io platform is ready to receive data from your MQTT devices. 

 Step 2: Create a Dashboard

- Create a new dashboard and set up the necessary information.

Create a new dashboard and set up the necessary information.png Adding a Dashboard and setting up related information

Once the dashboard is created, you can proceed to display data.png

- Once the dashboard is created, you can proceed to display data. 

 Step 3: Create Data Buckets

1. Store Data

   - In the Thinger.io device dashboard, create a data bucket, such as "Soildata" or "Weatherdata," or customize it according to your preference.

   - In the device settings, configure it to store the incoming MQTT data in the bucket.

Create Data Buckets.png

The following parameters need to be configured:

- Bucket ID: A unique identifier for the bucket, e.g., "Soildata" or "Weatherdata."

- Bucket Name: Use a representative name, like "Weather Data" or "Soil data" or the project name.

- Bucket Description: Provide any additional details, like "Soil sensor data."

- Enabled: Toggle data bucket recording on or off. Turn it on to enable it.

- Data Source: Typically defines the Thinger.io device or resource subscribed by the server. In this case, you should select "From MQTT Topic."

- MQTT Topic: Enter the MQTT topic that will be subscribed to by the server. 

For example:

- MQTT Topic: yourusername/devices/NiuBoL/Soildata 

This way, Thinger.io will configure the platform as an MQTT broker but also as a topic consumer, allowing additional features. The client must send data in JSON format. 

 Step 4: Configure Modbus Collection Rules and Parameters on Data Logger (Gateway)

Basic Settings: Set the Collect Period and Report Period according to your needs.

Basic Settings.png 

Interface Settings:

Interface Settings.png 

Modbus Rules Settings: Refer to the specific sensor data table.

Modbus Rules Settings.png 

Set Sensor Output Units and Precision.

Set Sensor Output Units and Precision.png 

  Step 5: Server Setting-Set MQTT Connection Parameters on Data Logger (Data Recorder/Gateway)

For example:

- Communication Protocol: MQTT

- Encapsulation Type: JSON

- Server Address: backend.thinger.io

- Port: 1883

- MQTT Public Topic: yourusername/devices/NiuBoL/Soildata

- MQTT Subscribe Topic: Can be empty

- MQTT Username: yourusername (your Thinger.io username)

- MQTT Password: This is the Device Credentials password.

- Client ID: The device identifier that was configured in the device form, such as "NiuBoL"

Set MQTT Connection Parameters on Data Logger.png 

Notes:

- Broker Address: backend.thinger.io (without the http:// part)

- Broker Port: 1883 for non-secure connections, or 8883 for SSL/TLS

- Username: yourusername (not your email address).

- MQTT Public Topic: <username>/devices/<deviceID>/<resource>

- MQTT Subscribe Topic: Can be empty

- MQTT Password: Must match the password you placed in the "Device Credentials" field on Thinger.io.

- Client ID: The device identifier you set up at the device form. 

2. Test the Connection

   - Start the client and check if the connection is successful.

   - If the connection fails, check:

     - Whether the username and password are correct.

     - Whether the network is working (check if port 1883 is blocked by the firewall). 

 Step 6: Verification and Debugging

1. Check the Thinger.io Dashboard

   - Go back to Thinger.io and enter the "Soildata" dashboard.

   - Check whether data has been received in "Device Properties" or "Data Buckets."

device is online.png

Once the device is online, it indicates a successful connection.

data is being received.png 

 You can check the Data Buckets to see if data is being received.

check the Data Buckets.png 

If you need to change the password, you can set it in the Data Buckets settings. No action is required if you do not need to modify it. 

 Step 7: Configure Data Storage and Display

- Create a dashboard (Dashboard), add charts, and bind them to the Data Buckets to view the data in real-time.

Add a Tab or Widget.png 

   - Add a Tab or Widget.

Choose the type of Widget.png 

   - Choose the type of Widget.

Select the data source for the Widget.png

   - Select the data source for the Widget.

Set the unit of measurement, maximum, and minimum values.png 

   - Set the unit of measurement, maximum, and minimum values.

Set the unit of measurement, maximum, and minimum values.png 

   Data Display: Once set up, data will be displayed on the dashboard.

 displayed on the dashboard.png

Final Debugging:

- If data is not displayed, check:

  - Whether the topic format is correct.

  - Whether the device token is valid.

  - Whether the message format is correct (e.g., JSON).

How to Connect NiuBoL Sensor to Thinger IoT Platform via MQTT Protocol.pdf

Related recommendations

Sensors & Weather Stations Catalog

Agriculture Sensors and Weather Stations Catalog-NiuBoL.pdf

Weather Stations Catalog-NiuBoL.pdf

Agriculture Sensors Catalog-NiuBoL.pdf

Related products

Tell us your requirements, Let's discuss more about your project.we can do more.

Name*

Tel*

Email*

Company*

Country*

Message

online
Contacts
Email
Top
XHow to Connect NiuBoL Sensor to Thinger IoT Platform via MQTT Protocol-Technical Support-Automatic weather stations_Pyranometer_Agricultural sensor_Soil sensor_temperature and humidity sensor_PH sensor_NPK sensor_environmental monitoring-NiuBoL

Screenshot, WhatsApp to identify the QR code

WhatsApp number:+8615367865107

(Click on WhatsApp to copy and add friends)

Open WhatsApp

The WhatsApp ID has been copied, please open WhatsApp to add consultation details!