<
From version < 157.1 >
edited by Dilisi S
on 2025/03/17 01:45
To version < 159.1 >
edited by Dilisi S
on 2025/03/18 03:49
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -458,6 +458,8 @@
458 458  * **Topic: v1/devices/+/telemetry** (the + replaces any 'device name' will create a device in the Entities -> Devices)
459 459  * **QoS:** 0-At most once
460 460  
461 +
462 +
461 461  [[image:add-integration-connection.png||height="511" width="500"]]
462 462  
463 463  
... ... @@ -500,29 +500,17 @@
500 500  
501 501  We use the Mosquitto MQTT client to simulate MQTT messages, acting as a virtual device. First, install the Mosquitto client on your computer from [[this link>>url:https://mosquitto.org/download/]]. The Mosquitto client publishes messages to the MQTT broker (HiveMQ) on a specified MQTT topic. ThingsBoard subscribes to these messages using the same topic.
502 502  
503 -The Mosquitto client publishes messages on the topic v1/devices/[device_name]/telemetry. The [device_name]placeholder can be replaced with any device name, for example, 'S31B-NB'. Then, the MQTT topic would be v1/devices/S31B-NB/telemetry.
505 +The Mosquitto client publishes messages (payloads) on the topic **v1/devices/me/telemetry**. Of course, you can use any topic for testing.
504 504  
505 -On the ThingsBoard side, we configure the MQTT topic subscription as v1/devices/+/telemetry. The + wildcard represents any device name and allows ThingsBoard to automatically create (provision) a device with that name, such as S31B-NB, for example.
507 +(% id="cke_bm_37386S" style="display:none" %) (%%)The MQTT payload format is as follows, which is common for all **~-~-NB** and **~-~-CB** series devices. The **IMEI** field is mandatory and is used to provision a new device with the name assigned to it in ThingsBoard.
506 506  
507 -
508 -**The new device is created the first time the MQTT topic is received. For subsequent MQTT topics with the same device name, no duplicate devices will be created.**
509 -
510 -
511 -For example, if you send two MQTT messages with different device names in the topic:
512 -
513 -1. v1/devices/**S31B-NB**/telemetry
514 -1. v1/devices/**LDS25-NB**/telemetry
515 -
516 -ThingsBoard will create two devices named **S31B-NB** and **LDS25-NB** in the **//Devices//** section.
517 -
518 -
519 -The MQTT payload format is as follows, which is common for all ~-~-NB and ~-~-CB series devices:
520 -
521 521  {{code language="none"}}
522 -{"temperature":10.4, "humidity":85}
510 +{"IMEI": "S31B-NB", "temperature": 27, ......}
523 523  {{/code}}
524 524  
513 +Once ThingsBoard receives this message, it automatically creates (provisions) the device mentioned in the **IMEI**, for example, S31B-NB.
525 525  
515 +
526 526  == 5.2 Sending messages ==
527 527  
528 528  
add-integration-connection.png
Size
... ... @@ -1,1 +1,1 @@
1 -124.4 KB
1 +153.2 KB
Content
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0