Changes for page ThingsBoard

Last modified by Dilisi S on 2025/04/23 19:23

From version 201.1
edited by Dilisi S
on 2025/04/15 23:13
Change comment: There is no comment for this version
To version 194.1
edited by Dilisi S
on 2025/03/28 00:23
Change comment: Mar 27 edits - part 3

Summary

Details

Page properties
Content
... ... @@ -164,11 +164,8 @@
164 164  [[image:ins1.png||height="310" width="500"]]
165 165  
166 166  
167 -= 3. Creating Devices (Optional) =
167 += 3. Creating Devices =
168 168  
169 -{{info}}
170 -**The following procedure is optional. If you haven't created any device in ThingsBoard first, ThingsBoard will automatically create a device for you based on the integration settings (the device name defined in the uplink decoder) just after it receives the first uplink from your device.**
171 -{{/info}}
172 172  
173 173  First, you need to create devices in ThingsBoard to represent your physical devices. For example, you can name it **Device A**, and the second device could be **Device B** or any name you prefer. The device name should be unique within the **Devices** space.
174 174  
... ... @@ -222,7 +222,7 @@
222 222  //var data = decodeToJson(payload)//
223 223  
224 224  
225 -* **Line 13**: Assign your device name to the **deviceName** field. - We used **Device A** as it is to match with our device, **Device A **in the **Devices **section.
222 +* **Line 13**: Assign your device name to the **deviceName** field. - We used **Device A** as it is to match with our device, **Device A **in the Devices section.
226 226  * From **line 38**: Modify the telemetry section to allow parsed data to be assigned to the fields.
227 227  
228 228  //telemetry: {
... ... @@ -321,7 +321,7 @@
321 321  * **Integration type**: MQTT
322 322  * **Name**: MQTT integration - Device A
323 323  * **Enable integration**: YES
324 -* **Allow create devices or assets**: YES
321 +* **Allows create devices or assets**: YES
325 325  
326 326  Click **Next** button.
327 327  
... ... @@ -496,7 +496,7 @@
496 496  
497 497  First simulate a few messages using MQTT. This time, we have added the 'humidity' field to the payload. Eg:
498 498  
499 -{{code language="none"}}mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -u "xxxxx" -P "xxxxx" -t "device/a" -m '{"IMEI":"350693903995577", "temperature":22, "humidity":80, "pressure":1005}'{{/code}}
496 +{{code language="none"}}mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -t "v1/devices/me/telemetry" -u "xxxxx" -P "xxxxx" -m '{"IMEI": "S31B-NB", "temperature": 22, "humidity":80}'{{/code}}
500 500  
501 501  
502 502  In **ThingsBoard**, from the left navigation menu, click **Dashboards**. Then, click the **+** button and select **Create new dashboard** from the dropdown menu.
... ... @@ -534,19 +534,15 @@
534 534  
535 535  Configure the **Time series chart** widget as follows:
536 536  
537 -* **Datasource** - select **Device A** device you provisioned.
534 +* **Datasource** - select S31B-NB device you provisioned.
538 538  * **Series**:
539 539  ** **temperature** - you can see this key by default.
540 540  ** **humidity** - Click **Add series** button. Then add the **humidity** for the key and then type **%** as its unit.
541 541  * Click on the **Add** button.
542 542  
543 -{{info}}
544 -You can add only the relevant fields from the device's payload to display data on a widget. These fields are called 'keys'.
545 -{{/info}}
540 +[[image:timeseries-1.png||height="491" width="700"]]
546 546  
547 -[[image:Screenshot 2025-03-31 at 06.51.15.png||height="485" width="700"]]
548 548  
549 -
550 550  The time-series chart will appear in edit mode. Resize it by clicking and dragging the lower-right corner.
551 551  
552 552  Click the **Save** button to add the widget to the dashboard.
... ... @@ -559,11 +559,12 @@
559 559  
560 560  
561 561  {{code language="none"}}
562 -mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -u "xxxxx" -P "xxxxx" -t "device/a" -m '{"IMEI":"350693903995577", "temperature":22, "humidity":70, "pressure":1005}'
555 +mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -t "v1/devices/me/telemetry" -u "xxxxx" -P "xxxxx" -m '{"IMEI": "S31B-NB", "temperature": 22, "humidity":70}'
563 563  
564 -mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -u "xxxxx" -P "xxxxx" -t "device/a" -m '{"IMEI":"350693903995577", "temperature":27, "humidity":72, "pressure":1005}'
557 +mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -t "v1/devices/me/telemetry" -u "xxxxx" -P "xxxxx" -m '{"IMEI": "S31B-NB", "temperature": 27, "humidity":72}'
565 565  
566 -mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -u "xxxxx" -P "xxxxx" -t "device/a" -m '{"IMEI":"350693903995577", "temperature":19, "humidity":80, "pressure":1005}'
559 +mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -t "v1/devices/me/telemetry" -u "xxxxx" -P "xxxxx" -m '{"IMEI": "S31B-NB", "temperature": 19, "humidity":80}'
560 +
567 567  {{/code}}
568 568  
569 569  The chart will update with the values in realtime, as shown in the below image.
... ... @@ -572,7 +572,7 @@
572 572  [[image:timeseries-4.png||height="316" width="700"]]
573 573  
574 574  
575 -= 8. Configure Physical NB-IoT Sensor =
569 += 8. Configure NB-IoT Sensor =
576 576  
577 577  
578 578  Now, let's experiment with sending data to ThingsBoard using a real NB-IoT device. For example, we will use the **TS01-NB**.
... ... @@ -594,7 +594,10 @@
594 594  
595 595  
596 596  
597 -The following image shows the uplink payload of a real Dragino device. The publish topic is '**TS01-NB' that contains fields in the payload, IMEI, IMSI, Model, temperature, etc**. Note that we have created a device named **TS01-NB** in the **Devices** section in advance.
591 +The following image shows the uplink payload of a real Dragino device. The publish topic is **TS01-NB**, and the device name is **861275077962896**, which is represented by the **IMEI**.
598 598  
593 +{{info}}
594 +The ThingsBoard uses the device's IMEI number included in the payload to create a device in the Devices section.
595 +{{/info}}
599 599  
600 600  [[image:image-4.png]]
Screenshot 2025-03-31 at 06.51.15.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.pradeeka
Size
... ... @@ -1,1 +1,0 @@
1 -179.5 KB
Content