Last modified by Alec Chen on 2025/04/02 18:03

From version 8.1
edited by Alec Chen
on 2025/04/02 17:57
Change comment: There is no comment for this version
To version 2.1
edited by Alec Chen
on 2025/04/02 14:49
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -How to Uplink -NB and -CB series devices data by MQTT with Thingseye
1 +How to integrating Dragino -NB and -CB series devices data with Thingseye
Content
... ... @@ -12,22 +12,132 @@
12 12  
13 13  To complete this tutorial, you need to have certificate files. [[lns1.thingseye.io>>url:http://lns1.thingseye.io/]] is the Dragino's MQTT broker, which requires a CA certificate file, Certificate file, and the Private key file to use.
14 14  
15 -If customers need to use this MQTT connection with Thingseye, they need to contact TE team to obtain three license files or click this [[link>>url:https://www.dropbox.com/scl/fo/d5s1wf36f4syv30a8laup/AK8FjVpNXYXCWodRnnQ1Hig?rlkey=jrz1ip0f0xwwq5z2m2gu1tuij&e=1&st=kl4caub0&dl=0]] to download the certificates..
15 +If customers need to use this MQTT connection with Thingseye, they need to contact the TE team to obtain three license files.
16 16  
17 17  [[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/ins1.png?width=500&height=310&rev=1.1||alt="ins1.png" height="310" width="500"]]
18 18  
19 19  
20 -= (% style="color:#333333; font-family:inherit; font-size:max(23px, min(29px, 12.3333px + 1.38889vw))" %)3. Configure Thingseye's Integration(%%) =
20 += 3. Creating Devices (Optional) =
21 21  
22 -== 3.1 Creat new MQTT integration ==
22 +**The following procedure is optional. If you haven't created any device in Thingseye first, Thingseye 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.**
23 23  
24 -In the left navigation, click **Integrations center**, and then clic**Integrations**.
24 +First, you need to create devices in Thingseye 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.
25 25  
26 -On the **Integrations** page, click on the '**+**' button.
26 +In the left navigation, click **Entities -> Devices**.
27 27  
28 -[[image:1743578691561-822.png]]
28 +Click the **Add Device** button (the button with the **+** sign), and from the dropdown menu, click **Add new device**.
29 29  
30 +In the **Add new device** dialog box, enter the device name in the **Name** text box. For example, we will use **Device A**.
30 30  
32 +Click the **Add** button.
33 +
34 +Skip the **connectivity testing** by clicking the **Close** button.
35 +
36 +The device is created and listed on the **Devices** page. Note that its initial state is **Inactive** because it has not received any data yet.
37 +
38 += 4. Data Converters =
39 +
40 +In **Thingseye**, **Data Converters** are components used to transform incoming or outgoing data between different formats, typically to convert raw telemetry data from devices into a structured format that Thingseye can understand, or vice versa.
41 +
42 +== 4.1 Uplink ==
43 +
44 +In the left navigation, click **Integrations center**, and then click **Data converters**.
45 +
46 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/data-converters-list-empty.png?rev=1.1||alt="data-converters-list-empty.png"]]
47 +
48 +On the **Data converters** page, click on the ‘**+**’ button, and then click on the **Create new converter** from the dropdown menu.
49 +
50 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/create-new-converter-menu.png?width=500&height=259&rev=1.1||alt="create-new-converter-menu.png"]]
51 +
52 +The **Add data converter** window will appear.
53 +
54 +Let's create an uplink data converter for the device named '**Device A**'. Name it ‘**MQTT Uplink Converter - Device A**’ and select the Type as **Uplink**.
55 +
56 +Click on the **TBEL** button if it has not been selected by default.
57 +
58 +Modify the default TBEL function to match with your device as described below:
59 +
60 +* Uncomment** line 11**:
61 +
62 +//var data = decodeToJson(payload)//
63 +
64 +* **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.
65 +* From **line 38**: Modify the telemetry section to allow parsed data to be assigned to the fields.
66 +
67 +//telemetry: {
68 + temperature: data.temperature,
69 + humidity: data.humidity,
70 + rawData: payloadStr
71 + }//
72 +
73 +The modified uplink decoder function to match with **Device A** is shown below.
74 +
75 +{{code language="nono"}}
76 +// Decode an uplink message from a buffer
77 +// payload - array of bytes
78 +// metadata - key/value object
79 +
80 +/** Decoder **/
81 +
82 +// decode payload to string
83 +var payloadStr = decodeToString(payload);
84 +
85 +// decode payload to JSON
86 +var data = decodeToJson(payload);
87 +
88 +var deviceName = 'Device A';
89 +var deviceType = 'thermostat';
90 +var customerName = 'Customer C';
91 +var groupName = 'thermostat devices';
92 +var manufacturer = 'Example corporation';
93 +// use assetName and assetType instead of deviceName and deviceType
94 +// to automatically create assets instead of devices.
95 +// var assetName = 'Asset A';
96 +// var assetType = 'building';
97 +
98 +// Result object with device/asset attributes/telemetry data
99 +var result = {
100 +// Use deviceName and deviceType or assetName and assetType, but not both.
101 +  deviceName: deviceName,
102 +   deviceType: deviceType,
103 +// assetName: assetName,
104 +// assetType: assetType,
105 +// customerName: customerName,
106 +  groupName: groupName,
107 +   attributes: {
108 +       model: 'Model A',
109 +       serialNumber: 'SN111',
110 +       integrationName: metadata['integrationName'],
111 +       manufacturer: manufacturer
112 +   },
113 +   telemetry: {
114 +       temperature: data.temperature,
115 +       humidity: data.humidity,
116 +       rawData: payloadStr
117 +   }
118 +};
119 +
120 +/** Helper functions 'decodeToString' and 'decodeToJson' are already built-in **/
121 +
122 +return result;
123 +{{/code}}
124 +
125 +Once you modify the decoder function, click on the **Add** button.
126 +
127 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/ul-data-converter-device-a.png?width=500&height=524&rev=1.1||alt="ul-data-converter-device-a.png"]]
128 +
129 +You should see that the newly added **MQTT Uplink converter **NB/CB is listed on the **Data Converters** page.
130 +
131 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/ul-data-converter-added.png?height=257&rev=1.1||alt="ul-data-converter-added.png"]]
132 +
133 += 5. Add Integration =
134 +
135 +In the left navigation, click **Integrations center**, and then click **Integrations**.
136 +
137 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/integrations-list-empty.png?rev=1.1||alt="integrations-list-empty.png"]]
138 +
139 +On the **Integrations** page, click on the '**+**' button.
140 +
31 31  The **Add integration** window appears.
32 32  
33 33  In the **Add integration** window, configure the following settings:
... ... @@ -35,152 +35,222 @@
35 35  **Basic settings:**
36 36  
37 37  * **Integration type**: MQTT
38 -* **Name**: MQTT integration
148 +* **Name**: MQTT integration - Device A
39 39  * **Enable integration**: YES
40 -* **Debug mode**:YES
41 41  * **Allows create devices or assets**: YES
42 42  
43 43  Click **Next** button.
44 44  
45 -[[image:1743578960106-916.png||height="549" width="547"]]
154 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/add-integration-basic-settings.png?width=500&height=504&rev=1.2||alt="add-integration-basic-settings.png"]]
46 46  
156 +**Uplink data converter:**
47 47  
48 -**Uplink/downlink  data converter:**
158 +* Click on the **Select existing** button.
159 +* **Uplink data converter**: Select **MQTT Uplink Converter NB/CB **from the dropdown list.
49 49  
50 -* (((
51 -Next, directly select to create a new Uplink data converter .
52 -)))
53 -
54 54  Click **Next** button.
55 55  
56 -[[image:1743581191958-140.png||height="547" width="543"]]
163 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/add-integration-ul-data-converter.png?width=500&height=505&rev=1.1||alt="add-integration-ul-data-converter.png"]]
57 57  
58 -
59 -
60 60  **Downlink data converter:**
61 61  
62 -* Next, directly select to create a new Uplink data converter .
167 +Dragino NB/CB devices don't require a downlink data converter to decode their payloads, so you can skip this step.
63 63  
169 +* Click on the **Skip **button in the Downlink data converter section.
170 +
64 64  Click **Skip** button.
65 65  
66 -[[image:1743581287837-189.png||height="547" width="542"]]
173 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/integration-dl-skip.png?width=500&height=511&rev=1.1||alt="integration-dl-skip.png"]]
67 67  
68 -
69 69  **Connection:**
70 70  
71 -* **Host**: [[lns1.thingseye.io>>url:http://lns1.thingseye.io/]]
177 +* **Host**: Host URL (Eg. **//011731f7xxxxxxxxxxxfbbedfc63f4.s1.eu.hivemq.cloud//**)
72 72  * **Port**: 8883
73 -* **Credentials **: PEM(Paste 3 certificates to boxs below)Click this [[link>>url:https://www.dropbox.com/scl/fo/d5s1wf36f4syv30a8laup/AK8FjVpNXYXCWodRnnQ1Hig?rlkey=jrz1ip0f0xwwq5z2m2gu1tuij&e=1&st=kl4caub0&dl=0]] to download the certificates.
74 -* **Password:** Password or nothng
179 +* **Credentials type**: Basic
180 +* **Username**: Username (from your HiveMQ Cloud Cluster with your credentials)
181 +* **Password:** Password (from your HiveMQ Cloud Cluster with your credentials)
75 75  * **Enable SSL**: YES
76 -* **Topic: ** **It needs to align with the device's topic.**
77 -* **QoS:** 0-At most once or an MQTT QoS level
183 +* **Topic: device/a** (The topic can be anything; you can even use just the device name.)
184 +* **QoS:** 0-At most once
78 78  
79 -Click **Skip** button.
186 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/add-integartion-connection.png?width=500&height=505&rev=1.1||alt="add-integartion-connection.png"]]
80 80  
81 -[[image:1743579352961-586.png||height="507" width="502"]]
188 +Click on the **Advanced settings** button.
82 82  
83 -[[image:1743584347047-327.png]]
190 +* **Clean session:** YES
191 +* **Retained**: YES
84 84  
193 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/add-integration-connection-advanced-settings.png?width=500&height=510&rev=1.2||alt="add-integration-connection-advanced-settings.png"]]
85 85  
195 +Click on the **Check connection** button to verify the MQTT connection using the provided parameters.
196 +
197 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/check-connection.png?width=300&height=83&rev=1.1||alt="check-connection.png"]]
198 +
199 +If the connection is successful, you will see the **Connected** message. If not, check your connection parameters again.
200 +
201 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/connection-success.png?width=500&height=511&rev=1.1||alt="connection-success.png"]]
202 +
86 86  Click on the **Add** button.
87 87  
88 88  You should see that the newly added integration is listed on the **Integrations** page.
89 89  
90 -Since we haven't received data from a device yet, the integration **Status** is shown as **Pending,  Active  instead if it have.**
207 +Since we haven't received data from a device yet, the integration **Status** is shown as **Pending.**
91 91  
92 -[[image:1743580606618-281.png||height="495" width="504"]]
209 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/integration-added.png?rev=1.1||alt="integration-added.png"]]
93 93  
211 += 6. Verifying the receipt of data from virtual devices =
94 94  
95 -= 4. Configure Thingseye's Data Converters =
213 +== 6.1 How does it work? ==
96 96  
97 -First, you need to download the [[**MQTT uplink/downlink JS** **code**>>url:https://www.dropbox.com/scl/fo/d5s1wf36f4syv30a8laup/AK8FjVpNXYXCWodRnnQ1Hig?rlkey=jrz1ip0f0xwwq5z2m2gu1tuij&e=1&st=kl4caub0&dl=0]].
215 +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.
98 98  
99 -In **Thingseye**, **Data Converters** are components used to transform incoming or outgoing data between different formats, typically to convert raw telemetry data from devices into a structured format that Thingseye can understand, or vice versa.
217 +The Mosquitto client publishes messages (payloads) on the topic **/device/a**. Of course, you can use any topic for testing.
100 100  
101 -== 4.1 Uplink ==
219 +The MQTT payload format is as follows:
102 102  
103 -* **Uplink Converter**
221 +{{code language="none"}}
222 +{"IMEI": "350693903995577", "temperature":25, "humidity":80, "pressure":1005}
223 +{{/code}}
104 104  
105 -The purpose of the decoder function is to parsthincoming data and metadata to a format that ThingsBoard can consume.
225 +Once Thingseye receives this message, it forwards this payload to the matching device through the integration.
106 106  
107 -Go to the **Integrations center** -> **Data converters** page, and find that MQTT uplink converter that was newly created when the integration was created.
227 +== 5.2 Sending messages ==
108 108  
109 -[[image:1743581830822-223.png]]
229 +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.
110 110  
231 +{{code language="none"}}
232 +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}'
233 +{{/code}}
111 111  
112 -Enter edit mode and apply **MQTT uplink JS code** to this uplink converter.
235 +If the integration was performed without errors, the status of the integration changes to 'Active' after the first telemetry transmission.
113 113  
114 -[[image:1743581965585-763.png]]
237 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/integration-active.png?rev=1.2||alt="integration-active.png"]]
115 115  
239 +== 6.3 Viewing messages ==
116 116  
117 -== 4.2 Downlink ==
241 +Go back to the **Integrations** page.
118 118  
119 -* (((
120 -**Downlink Converter**
121 -)))
243 +Click on the **MQTT integration NB/CB** in the **Integrations** page to see its details.
122 122  
123 -Go to the **Integrations center** -> **Data converters** page, and find that MQTT downlink converter that was newly created when the integration was created.
245 +Click on the **Edit** button (//**pen icon**//).
124 124  
247 +Click on the **Disabled** button in the upper-right corner.
125 125  
126 -Enter edit mode and apply **MQTT downlink JS code** to this downlink converter.
249 +Turn on the **All messages (15 min)** option. This will enable displaying all messages in the **Events** tab. This setting will expire in 15 minutes, and you will need to repeat the same steps if you want to view the messages in the Events tab later.
127 127  
128 -[[image:1743582084494-111.png]]
251 +Click on the **Apply** button.
129 129  
253 +Then click on the **Apply changes** (//**tick icon**//) button.
130 130  
131 -== 4.3 Simulate with MQTT.fx ==
255 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/debug-enabled.png?width=700&height=301&rev=1.1||alt="debug-enabled.png"]]
132 132  
133 -[[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126191118-18.png?width=835&height=605&rev=1.1||alt="image-20241126191118-18.png"]]
257 +Now go to the **Events** tab.
134 134  
135 -[[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126193252-25.png?width=803&height=663&rev=1.1||alt="image-20241126193252-25.png"]]
259 +Select the **Event type** as **Debug** from the dropdown list.
136 136  
261 +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:
137 137  
138 -= 5. Configure Physical NB-IoT Sensor =
263 +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}'
139 139  
140 -First you need to configure the certificate to the -NB node. Follow the instructions in this **[[link>>url:https://wiki.dragino.com/xwiki/bin/view/Dragino%20NB%20device%20connection%20to%20AWS%20platform%20instructions/#H4.1.2Configurecertificate]]** to configure the certificate.
265 +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.
141 141  
142 -Screenshot of successful certificate configuration:
267 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/Screenshot%202025-03-26%20at%2019.49.31.png?rev=1.1||alt="Screenshot 2025-03-26 at 19.49.31.png"]]
143 143  
144 -* Configuring the CA Certificate
269 +Then click on the **three dots (...)** in the **Message** column. You can see the uplink message's **payload** in the **Message** window.
145 145  
146 -[[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126192009-19.png?width=697&height=431&rev=1.1||alt="image-20241126192009-19.png" height="431" width="697"]]
271 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/Screenshot%202025-03-26%20at%2019.47.52.png?rev=1.1||alt="Screenshot 2025-03-26 at 19.47.52.png"]]
147 147  
148 -[[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126192130-21.png?width=694&height=426&rev=1.1||alt="image-20241126192130-21.png" height="426" width="694"]]
273 +Now, you have successfully tested your integration with a simulated uplink payload and verified that it is received by Thingseye, and the device is provisioned.
149 149  
150 -* Configure client certificate
275 += 7. Creating a Dashboard =
151 151  
152 -[[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126192246-22.png?width=693&height=397&rev=1.1||alt="image-20241126192246-22.png" height="397" width="693"]][[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126192315-23.png?width=645&height=402&rev=1.1||alt="image-20241126192315-23.png" height="402" width="645"]]
277 +Thingseye **Dashboards** provide a powerful way to visualize and monitor real-time and historical data from connected devices. They allow users to create interactive, customizable panels displaying telemetry data, device status, and other key metrics. With a variety of widgets, including charts, maps, and tables, dashboards help users gain insights, track trends, and manage IoT deployments efficiently.
153 153  
154 -* Configure client private key
279 +This section guides you on how to create a dashboard to display temperature and humidity data from the device on a time-series chart. You may also use other widgets in Thingseye to display data according to your requirements.
155 155  
156 -[[image:https://wiki.dragino.com/xwiki/bin/download/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/WebHome/image-20241126192415-24.png?width=737&height=435&rev=1.1||alt="image-20241126192415-24.png" height="435" width="737"]]
281 +First simulate a few messages using MQTT. This time, we have added the 'humidity' field to the payload. Eg:
157 157  
158 -When the certificate is configured, burn the boot program, burn the working firmware, and then restart the device.
283 +{{code language="none"}}
284 +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}'
159 159  
160 -Then configure the -NB node to connect to the ThingsEye platform:
286 +{{/code}}
161 161  
162 -**AT Commands**
288 +In **Thingseye**, from the left navigation menu, click **Dashboards**. Then, click the **+** button and select **Create new dashboard** from the dropdown menu.
163 163  
164 -* **AT+PRO=3,5      **~/~/ Use MQTT Connection & Json Payload
165 -* **AT+SERVADDR=lns1.thingseye.io,8883**
166 -* **AT+SUBTOPIC=8899     **~/~/ Consistent with the Topic of MQTT integration created by ThingsEye
167 -* **AT+PUBTOPIC=8899     **~/~/ Consistent with the Topic of MQTT integration created by ThingsEye
168 -* **AT+CLIENT=NULL**
169 -* **AT+UNAME=NULL**
170 -* **AT+PWD=NULL**
171 -* **AT+TLSMOD=1,2**
290 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/dashboard-1.png?rev=1.1||alt="dashboard-1.png"]]
172 172  
173 -(% class="box warningmessage" %)
292 +In the **Title** text box, enter **NB/CB Test Dashboard** as the title of the dashboard.
293 +
294 +Click on the **Add** button.
295 +
296 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/dashboard-2.png?width=500&height=526&rev=1.1||alt="dashboard-2.png"]]
297 +
298 +Click on the **Add widget / Add new widget** button.
299 +
300 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/dashboard-3.png?rev=1.1||alt="dashboard-3.png"]]
301 +
302 +In the **Select widgets bundle** window, click **Charts**.
303 +
304 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/dashboard-4.png?width=700&height=537&rev=1.1||alt="dashboard-4.png"]]
305 +
306 +In the **Charts: select widget** window, click **Time series chart**.
307 +
308 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/dashboard-5.png?width=700&height=525&rev=1.1||alt="dashboard-5.png"]]
309 +
310 +Configure the **Time series chart** widget as follows:
311 +
312 +* **Datasource** - select **Device A** device you provisioned.
313 +* **Series**:
314 +** **temperature** - you can see this key by default.
315 +** **humidity** - Click **Add series** button. Then add the **humidity** for the key and then type **%** as its unit.
316 +* Click on the **Add** button.
317 +
318 +(% class="box infomessage" %)
174 174  (((
175 -Be careful, “ Topic” should be same of device & serve. If your device not belongs Dragino, address should be same of the broker which using.
320 +You can add only the relevant fields from the device's payload to display data on a widget. These fields are called 'keys'.
176 176  )))
177 177  
178 -Test Uplink by click the button for 1~~3 seconds, the MQTT integration in ThingsEye allows you to view the data upstream from the device:
323 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/Screenshot%202025-03-31%20at%2006.51.15.png?width=700&height=485&rev=1.1||alt="Screenshot 2025-03-31 at 06.51.15.png"]]
179 179  
325 +The time-series chart will appear in edit mode. Resize it by clicking and dragging the lower-right corner.
180 180  
327 +Click the **Save** button to add the widget to the dashboard.
181 181  
182 -Go to **"Device" ** -> ** "Search Device"**, enter the ** IMEI** of the device to find the device.
329 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/timeseries-3.png?width=700&height=347&rev=1.1||alt="timeseries-3.png"]]
183 183  
331 +Now send the following MQTT messages from the terminal to simulate the data.
184 184  
333 +{{code language="none"}}
334 +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}'
185 185  
336 +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}'
337 +
338 +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}'
339 +{{/code}}
340 +
341 +The chart will update with the values in realtime, as shown in the below image.
342 +
343 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/timeseries-4.png?width=700&height=316&rev=1.1||alt="timeseries-4.png"]]
344 +
345 += 8. Configure Physical NB-IoT Sensor =
346 +
347 +Now, let's experiment with sending data to Thingseye using a real NB-IoT device. For example, we will use the **TS01-NB**.
348 +
349 +First, configure the NB-IoT device with the necessary MQTT settings using AT commands. Below is a list of AT commands you can use.
350 +
351 +**AT Commands**
352 +
353 +* **AT+PRO=3,3    **~/~/ Use MQTT to connect to Thingseye. Payload Type set to 3.
354 +* **AT+SUBTOPIC=<MQTT subscribe topic> Eg: TS01-NB**
355 +* **AT+PUBTOPIC=<MQTT publish topic> Eg: TS01-NB**
356 +* **AT+CLIENT=null**
357 +* **AT+UNAME=<MQTT Username>**
358 +* **AT+PWD=<MQTT Password>**
359 +* **AT+SERVADDR=<Broker address, Port>**
360 +
361 +Test your uplink by pressing the ACT button for 1 second.
186 186  
363 +
364 +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.
365 +
366 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/image-4.png?rev=1.2||alt="image-4.png"]]
1743578461281-635.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -272.1 KB
Content
1743578691561-822.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -230.6 KB
Content
1743578748298-164.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -86.7 KB
Content
1743578921379-944.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -85.5 KB
Content
1743578960106-916.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -85.4 KB
Content
1743579352961-586.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -104.7 KB
Content
1743580188942-159.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -157.1 KB
Content
1743580264901-750.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -154.8 KB
Content
1743580288154-524.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -154.3 KB
Content
1743580307872-530.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -155.1 KB
Content
1743580606618-281.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -127.1 KB
Content
1743581191958-140.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -154.2 KB
Content
1743581219626-974.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -156.7 KB
Content
1743581287837-189.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -180.8 KB
Content
1743581830822-223.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -249.6 KB
Content
1743581965585-763.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -418.9 KB
Content
1743582084494-111.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -418.8 KB
Content
1743584347047-327.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Alec
Size
... ... @@ -1,1 +1,0 @@
1 -126.3 KB
Content