Changes for page How to Uplink -NB and -CB series devices data by MQTT with Thingseye
Last modified by Alec Chen on 2025/04/02 18:03
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 1 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -How to Uplink-NB and -CB series devices data by MQTT with Thingseye1 +How to connect -NB and -CB series devices data by MQTT with Thingseye - Content
-
... ... @@ -1,5 +1,7 @@ 1 1 **Table of Contents:** 2 2 3 +{{toc/}} 4 + 3 3 = 1. Introduction = 4 4 5 5 This document guides you on integrating Dragino **-NB** and **-CB** series devices data with Thingseye. ... ... @@ -15,10 +15,57 @@ 15 15 [[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"]] 16 16 17 17 18 -= (% style="color:#333333; font-family:inherit; font-size:max(23px, min(29px, 12.3333px + 1.38889vw))" %)3.Configure Thingseye's Integration(%%)=20 += 3.General MQTT Connection = 19 19 20 - == 3.1 CreatnewMQTTintegration==22 +The NB-IoT Sensor can send packet to server use MQTT protocol. 21 21 24 +Below are the commands. 25 + 26 +**AT Commands:** 27 + 28 +{{code language="none"}} 29 +AT+PRO=3,0 // Set to use MQTT protocol to uplink, Payload Type select Hex payload. 30 +AT+SERVADDR=120.24.4.116,1883 // Set MQTT server address and port 31 +AT+CLIENT=CLIENT // Set up the CLIENT of MQTT 32 +AT+UNAME=UNAME // Set the username of MQTT 33 +AT+PWD=PWD // Set the password of MQTT 34 +AT+PUBTOPIC=NSE01_PUB // Set the sending topic of MQTT 35 +AT+SUBTOPIC=NSE01_SUB // Set the subscription topic of MQTT 36 +{{/code}} 37 + 38 +[[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-20230802112413-4.png?rev=1.1||alt="image-20230802112413-4.png"]] 39 + 40 +[[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-20230802112413-5.png?width=987&height=530&rev=1.1||alt="image-20230802112413-5.png" height="530" width="987"]] 41 + 42 +(% class="mark small text-uppercase" %)##**Notice: MQTT protocol has a much higher power consumption compare with UDP/CoAP protocol. Please check the power analyze document and adjust the uplink**## 43 + 44 +(% class="mark small text-uppercase" %)##**period to a suitable interval.**## 45 + 46 += 4. Data Converters = 47 + 48 +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. 49 + 50 +== 4.1 Uplink == 51 + 52 +In the left navigation, click **Integrations center**, and then click **Data converters**. 53 + 54 +On the **Data converters** page, click on the ‘**+**’ button, and then click on the **Create new converter** from the dropdown menu. 55 + 56 +[[image:1743578461281-635.png]] 57 + 58 + 59 +Once you modify the decoder function, click on the **Add** button. 60 + 61 +[[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"]] 62 + 63 +You should see that the newly added **MQTT Uplink converter **NB/CB is listed on the **Data Converters** page. 64 + 65 +[[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"]] 66 + 67 += 5. Add Integration = 68 + 69 +== 5.1. Creat new MQTT integration == 70 + 22 22 In the left navigation, click **Integrations center**, and then click **Integrations**. 23 23 24 24 On the **Integrations** page, click on the '**+**' button. ... ... @@ -78,7 +78,7 @@ 78 78 79 79 [[image:1743579352961-586.png||height="507" width="502"]] 80 80 81 -[[image:174358 4347047-327.png]]130 +[[image:1743580606618-281.png||height="495" width="504"]] 82 82 83 83 84 84 Click on the **Add** button. ... ... @@ -87,16 +87,13 @@ 87 87 88 88 Since we haven't received data from a device yet, the integration **Status** is shown as **Pending, Active instead if it have.** 89 89 90 -[[image:1743580606618-281.png||height="495" width="504"]] 91 91 92 92 93 -= 4. Configure Thingseye's Data Converters = 94 94 95 -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]]. 96 96 97 - In **Thingseye**, **DataConverters** arecomponentsusedto transform incoming or outgoingdata betweenifferentformats, typically to convert rawtelemetry data from devices intoa structured format that Thingseye can understand, or viceversa.143 +== 5.2. Setup uplink and downlink converters == 98 98 99 - ==4.1Uplink ==145 +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]]. 100 100 101 101 * **Uplink Converter** 102 102 ... ... @@ -112,12 +112,8 @@ 112 112 [[image:1743581965585-763.png]] 113 113 114 114 115 - ==4.2Downlink==161 +* **Downlink Converter** 116 116 117 -* ((( 118 -**Downlink Converter** 119 -))) 120 - 121 121 Go to the **Integrations center** -> **Data converters** page, and find that MQTT downlink converter that was newly created when the integration was created. 122 122 123 123 ... ... @@ -126,37 +126,25 @@ 126 126 [[image:1743582084494-111.png]] 127 127 128 128 129 -= =4.3SimulatewithMQTT.fx==171 += 6. Configure Physical NB-IoT Sensor = 130 130 131 - [[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"]]173 +Now, let's experiment with sending data to Thingseye using a real NB-IoT device. For example, we will use the **TS01-NB**. 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-20241126193252-25.png?width=803&height=663&rev=1.1||alt="image-20241126193252-25.png"]]175 +First, configure the NB-IoT device with the necessary MQTT settings using AT commands. Below is a list of AT commands you can use. 134 134 135 - 136 -= 5. Test connect = 137 - 138 138 **AT Commands** 139 139 140 -* **AT+PRO=3,5 **~/~/ Use MQTT Connection & Json Payload 141 -* **AT+SERVADDR=lns1.thingseye.io,8883** 142 -* **AT+SUBTOPIC=8899 **~/~/ Consistent with the Topic of MQTT integration created by ThingsEye 143 -* **AT+PUBTOPIC=8899 **~/~/ Consistent with the Topic of MQTT integration created by ThingsEye 144 -* **AT+CLIENT=NULL** 145 -* **AT+UNAME=NULL** 146 -* **AT+PWD=NULL** 147 -* **AT+TLSMOD=1,2** 179 +* **AT+PRO=3,3 **~/~/ Use MQTT to connect to Thingseye. Payload Type set to 3. 180 +* **AT+SUBTOPIC=<MQTT subscribe topic> Eg: TS01-NB** 181 +* **AT+PUBTOPIC=<MQTT publish topic> Eg: TS01-NB** 182 +* **AT+CLIENT=null** 183 +* **AT+UNAME=<MQTT Username>** 184 +* **AT+PWD=<MQTT Password>** 185 +* **AT+SERVADDR=<Broker address, Port>** 148 148 149 -(% class="box warningmessage" %) 150 -((( 151 -Be careful, “ Topic” should be same of device & serve. If your device not belongs Dragino, address should be same of the broker which using. 152 -))) 187 +Test your uplink by pressing the ACT button for 1 second. 188 + 153 153 154 -Test Uplinkbyclick thebutton for 1~~3seconds, theMQTTintegrationThingsEye allowsyou toviewthedataupstreamfromthedevice:190 +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. 155 155 156 - 157 - 158 -Go to **"Device" ** -> ** "Search Device"**, enter the ** IMEI** of the device to find the device. 159 - 160 - 161 - 162 - 192 +[[image:https://wiki.dragino.com/xwiki/bin/download/Main/ThingsBoard/image-4.png?rev=1.2||alt="image-4.png"]]
- 1743584347047-327.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Alec - Size
-
... ... @@ -1,1 +1,0 @@ 1 -126.3 KB - Content