Changes for page ThingsBoard
Last modified by Dilisi S on 2025/04/15 23:13
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 1 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -164,13 +164,16 @@ 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.Type your information message here.** 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 172 172 173 -In the left navigation, click Entities -> Devices. 176 +In the left navigation, click **Entities -> Devices**. 174 174 175 175 Click the **Add Device** button (the button with the **+** sign), and from the dropdown menu, click **Add new device**. 176 176 ... ... @@ -364,8 +364,6 @@ 364 364 * **Topic: device/a** (The topic can be anything; you can even use just the device name.) 365 365 * **QoS:** 0-At most once 366 366 367 - 368 - 369 369 [[image:add-integartion-connection.png||height="505" width="500"]] 370 370 371 371 ... ... @@ -396,9 +396,10 @@ 396 396 Since we haven't received data from a device yet, the integration **Status** is shown as **Pending.** 397 397 398 398 399 -[[image: new-integration-pending.png]]400 +[[image:integration-added.png]] 400 400 401 401 403 + 402 402 = 6. Verifying the receipt of data from virtual devices = 403 403 404 404 ... ... @@ -421,7 +421,7 @@ 421 421 == 5.2 Sending messages == 422 422 423 423 424 -On t he terminal, issue the following MQTT command which simulates the deviceS31B-NB. The message payload contains the fieldsandhumidity, which hold the valuesS31B-NBand27,respectively. This payload is also (technically) known as telemetry.426 +On your computer's terminal, issue the following MQTT command which simulates the device '**Device A'**. The message payload contains the fields IMEI, temperature, humidity, and pressure, which hold the values 350693903995577, 30, 80, and 1005 respectively. This payload is also (technically) known as telemetry. 425 425 426 426 {{code language="none"}} 427 427 mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -u "xxxxx" -P "xxxxx" -t "device/a" -m '{"IMEI":"350693903995577", "temperature":30, "humidity":80, "pressure":1005}' ... ... @@ -433,8 +433,6 @@ 433 433 [[image:integration-active.png]] 434 434 435 435 436 - 437 - 438 438 == 6.3 Viewing messages == 439 439 440 440 ... ... @@ -453,21 +453,28 @@ 453 453 Then click on the **Apply changes** (//**tick icon**//) button. 454 454 455 455 456 -[[image: Screenshot2025-03-18at9.23.10.png]]456 +[[image:debug-enabled.png||height="301" width="700"]] 457 457 458 458 459 + 460 + 459 459 Now go to the **Events** tab. 460 460 461 -Select the Event type as **Debug** from the dropdown list. 463 +Select the **Event type** as **Debug** from the dropdown list. 462 462 463 - Nowyou canseelltheUplinkmessagesyouaremulating through theMQTTbroker.Thestatusshouldbe**OK **ifthereis noerrorsinyourintegration.465 +Publish another message (of course, you can repeat the previous message by pressing the UP arrow on your keyboard and then press Enter key) to your MQTT broker from your terminal, for example: 464 464 467 +{{code language="none"}} 468 +mosquitto_pub -d -q 1 -h 011731f7928xxxxx.s1.eu.hivemq.cloud -p 8883 -u "xxxxx" -P "xxxxx" -t "device/a" -m '{"IMEI":"350693903995577", "temperature":30, "humidity":80, "pressure":1005}' 469 +{{/code}} 465 465 466 - [[image:Screenshot2025-03-26at19.49.31.png]]471 +Now you can see that uplink message in the **Events** tab (Click the **refresh** button if you didn't see any messages in the Events tab). The status should be **OK **if there is no errors in your integration. 467 467 468 468 474 +[[image:Screenshot 2025-03-26 at 19.49.31.png]] 469 469 470 470 477 + 471 471 Then click on the **three dots (...)** in the **Message** column. You can see the uplink message's **payload** in the **Message** window. 472 472 473 473 ... ... @@ -489,7 +489,7 @@ 489 489 490 490 First simulate a few messages using MQTT. This time, we have added the 'humidity' field to the payload. Eg: 491 491 492 -{{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}} 493 493 494 494 495 495 In **ThingsBoard**, from the left navigation menu, click **Dashboards**. Then, click the **+** button and select **Create new dashboard** from the dropdown menu. ... ... @@ -527,7 +527,7 @@ 527 527 528 528 Configure the **Time series chart** widget as follows: 529 529 530 -* **Datasource** - select S31B-NBdevice you provisioned.537 +* **Datasource** - select **Device A** device you provisioned. 531 531 * **Series**: 532 532 ** **temperature** - you can see this key by default. 533 533 ** **humidity** - Click **Add series** button. Then add the **humidity** for the key and then type **%** as its unit. ... ... @@ -548,12 +548,11 @@ 548 548 549 549 550 550 {{code language="none"}} 551 -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":558 +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}' 552 552 553 -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":560 +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}' 554 554 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": 19, "humidity":80}' 556 - 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":19, "humidity":80, "pressure":1005}' 557 557 {{/code}} 558 558 559 559 The chart will update with the values in realtime, as shown in the below image. ... ... @@ -584,7 +584,7 @@ 584 584 585 585 586 586 587 -The following image shows the uplink payload of a real Dragino device. The publish topic is **,and the device nameis**861275077962896**,which isrepresentedbythe**IMEI**.593 +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. 588 588 589 589 {{info}} 590 590 The ThingsBoard uses the device's IMEI number included in the payload to create a device in the Devices section. ... ... @@ -591,5 +591,3 @@ 591 591 {{/info}} 592 592 593 593 [[image:image-4.png]] 594 - 595 -
- debug-enabled.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.pradeeka - Size
-
... ... @@ -1,0 +1,1 @@ 1 +196.3 KB - Content