Changes for page ThingsBoard
Last modified by Dilisi S on 2025/04/23 19:23
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (1 modified, 2 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -164,8 +164,11 @@ 164 164 [[image:ins1.png||height="310" width="500"]] 165 165 166 166 167 -= 3. Creating Devices = 167 += 3. Creating Devices (Optional) = 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}} 169 169 170 170 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. 171 171 ... ... @@ -219,7 +219,7 @@ 219 219 //var data = decodeToJson(payload)// 220 220 221 221 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. 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. 223 223 * From **line 38**: Modify the telemetry section to allow parsed data to be assigned to the fields. 224 224 225 225 //telemetry: { ... ... @@ -318,7 +318,7 @@ 318 318 * **Integration type**: MQTT 319 319 * **Name**: MQTT integration - Device A 320 320 * **Enable integration**: YES 321 -* **Allow screate devices or assets**: YES324 +* **Allow create devices or assets**: YES 322 322 323 323 Click **Next** button. 324 324 ... ... @@ -493,7 +493,7 @@ 493 493 494 494 First simulate a few messages using MQTT. This time, we have added the 'humidity' field to the payload. Eg: 495 495 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":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}} 497 497 498 498 499 499 In **ThingsBoard**, from the left navigation menu, click **Dashboards**. Then, click the **+** button and select **Create new dashboard** from the dropdown menu. ... ... @@ -531,15 +531,19 @@ 531 531 532 532 Configure the **Time series chart** widget as follows: 533 533 534 -* **Datasource** - select S31B-NBdevice you provisioned.537 +* **Datasource** - select **Device A** device you provisioned. 535 535 * **Series**: 536 536 ** **temperature** - you can see this key by default. 537 537 ** **humidity** - Click **Add series** button. Then add the **humidity** for the key and then type **%** as its unit. 538 538 * Click on the **Add** button. 539 539 540 -[[image:timeseries-1.png||height="491" width="700"]] 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}} 541 541 547 +[[image:Screenshot 2025-03-31 at 06.51.15.png||height="485" width="700"]] 542 542 549 + 543 543 The time-series chart will appear in edit mode. Resize it by clicking and dragging the lower-right corner. 544 544 545 545 Click the **Save** button to add the widget to the dashboard. ... ... @@ -552,12 +552,11 @@ 552 552 553 553 554 554 {{code language="none"}} 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":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}' 556 556 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":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}' 558 558 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 - 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}' 561 561 {{/code}} 562 562 563 563 The chart will update with the values in realtime, as shown in the below image. ... ... @@ -566,7 +566,7 @@ 566 566 [[image:timeseries-4.png||height="316" width="700"]] 567 567 568 568 569 -= 8. Configure 575 += 8. Configure Physical NB-IoT Sensor = 570 570 571 571 572 572 Now, let's experiment with sending data to ThingsBoard using a real NB-IoT device. For example, we will use the **TS01-NB**. ... ... @@ -588,10 +588,7 @@ 588 588 589 589 590 590 591 -The following image shows the uplink payload of a real Dragino device. The publish topic is **,and the device nameis**861275077962896**,which isrepresentedbythe**IMEI**.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. 592 592 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}} 596 596 597 597 [[image:image-4.png]]
- data-converters-list.png
-
- Size
-
... ... @@ -1,1 +1,1 @@ 1 - 212.2KB1 +19.0 KB - Content
- Screenshot 2025-03-31 at 06.51.15.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.pradeeka - Size
-
... ... @@ -1,0 +1,1 @@ 1 +179.5 KB - Content
- mqtt-uplink-converter.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.pradeeka - Size
-
... ... @@ -1,0 +1,1 @@ 1 +75.3 KB - Content