<
From version < 53.22 >
edited by Xiaoling
on 2023/08/02 14:25
To version < 53.20 >
edited by Xiaoling
on 2023/08/02 14:14
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -237,14 +237,12 @@
237 237  Firstly, we need to set the MQTT mode to datacake, and we need to run** AT+PRO=3,2**. This command is set to datacake. After running the command, the device automatically sets the server address, port.
238 238  
239 239  
240 -By chosing to add the device under a (% style="color:blue" %)**"New Product"**(%%) you are required to give a name for this product. You can name it something like "My First MQTT Product".
240 +By chosing to add the device under a **"New Product"** you are required to give a name for this product. You can name it something like "My First MQTT Product".
241 241  
242 242  [[image:image-20230802112413-14.png]]
243 243  
244 +== 1.2 Create Device ==
244 244  
245 -=== 3.4.2 Create Device ===
246 -
247 -
248 248  In the second step you have to define the device which should be added to the product.
249 249  
250 250  [[image:image-20230802112413-15.png]]
... ... @@ -252,9 +252,8 @@
252 252  Enter a name here (such as "My First MQTT Device") and complete the creation of the device by clicking on the "Next" button.
253 253  
254 254  
255 -=== 3.4.3 Create Database Fields ===
253 +== 1.3 Create Database Fields ==
256 256  
257 -
258 258  After creating the device, it is listed in the table of the fleet view. Now open the device by clicking on the entry in the list.
259 259  
260 260  You will then see a device view with an empty dashboard. Now, the first thing we want to do is navigate to the Device configuration. To do this, use the tab bar and click on "Configuration".
... ... @@ -271,10 +271,8 @@
271 271  
272 272  [[image:image-20230802112413-19.png]]
273 273  
271 +== 1.4 Set up Broker ==
274 274  
275 -=== 3.4.4 Set up Broker ===
276 -
277 -
278 278  The broker is running on mqtt.datacake.co on ports 1883 and 8883. Port 1883 is unsecured and should not be used in production environments. Port 8883 uses a CA signed server certificate.
279 279  
280 280  You will need an access token to log into the Datacake MQTT Broker. You can use your own personal token or create a token explicitly for individual devices or groups of devices.
... ... @@ -285,24 +285,23 @@
285 285  
286 286  [[image:image-20230802112413-20.png]]
287 287  
288 -(% style="color:blue" %)**MQTT Client-ID**
283 +MQTT Client-ID
289 289  
290 290  The Datacake Broker manages the client IDs internally. You do not need to worry about a client ID. If your client optionally supports the specification of a client ID, please leave this specification blank. Your client then creates a randomly generated ID.
291 291  
292 -(% style="color:blue" %)**AT+CLIENT=“Any value”**
287 +AT+CLIENT=“Any value”
293 293  
294 -(% style="color:blue" %)**AT+UNAME=Token**
289 +AT+UNAME=Token
295 295  
296 -(% style="color:blue" %)**AT+PWD=Token**
291 +AT+PWD=Token
297 297  
298 298  [[image:image-20230802112413-21.png]]
299 299  
300 300  
301 -=== 3.4.5 Create your first Subscription ===
296 +== 1.6 Create your first Subscription ==
302 302  
298 +Subscribe
303 303  
304 -(% style="color:blue" %)**Subscribe**
305 -
306 306  Data is published according to the following structure:
307 307  
308 308  dtck~/~//
... ... @@ -319,18 +319,16 @@
319 319  [[image:image-20230802112413-24.png]]
320 320  
321 321  
322 -(% style="color:blue" %)**example:**
316 +example:
323 323  
324 324  AT+PUBTOPIC=dtck-pub/nbmattest/936c0db6-e9a5-4353-9fdb-3f63c8bfce7e/Temperature
325 325  
326 326  [[image:image-20230802112413-25.png]]
327 327  
322 +== 1.7 Define Publish Topic ==
328 328  
329 -=== 3.4.6 Define Publish Topic ===
324 +Publish
330 330  
331 -
332 -(% style="color:blue" %)**Publish**
333 -
334 334  To upload data into the Datacake Cloud and into a specific device, you publish the data to the respective topic structure.
335 335  
336 336  Due to the nature of MQTT, the topic prefix differs as follows:
... ... @@ -337,14 +337,12 @@
337 337  
338 338  dtck-pub~/~//
339 339  
340 -(% style="color:blue" %)**example:**
332 +example:
341 341  
342 342  AT+SUBTOPIC=dtck/nbmattest/936c0db6-e9a5-4353-9fdb-3f63c8bfce7e/Temperature
343 343  
336 +== 1.8 upload data ==
344 344  
345 -=== 3.4.7 upload data ===
346 -
347 -
348 348  [[image:image-20230802112413-26.png]]
349 349  
350 350  [[image:image-20230802112413-27.png]]
... ... @@ -351,50 +351,43 @@
351 351  
352 352  [[image:image-20230802112413-28.png]]
353 353  
344 += =
354 354  
355 -== 3.5 Node-Red (via MQTT) ==
346 += 5. Node-Red (via MQTT) =
356 356  
357 -=== 3.5.1 Configure Node-Red ===
358 358  
349 +== 1.1 Configure Node-Red ==
350 +
359 359  [[image:image-20230802112413-29.png]]
360 360  
361 361  [[image:image-20230802112413-30.png]]
362 362  
363 -=== 3.5.2 Simulate Connection ===
355 +== 1.2 Simulate Connection ==
364 364  
365 -
366 366  [[image:image-20230802112413-31.png]]
367 367  
359 +== 1.3 Configure NB-IoT Sensors ==
368 368  
369 -=== 3.5.3 Configure NB-IoT Sensors ===
361 +* AT+PRO=3,0(hex format) or 3,5(json format)    ~/~/Set to mqtt Server and  Payload
362 +* AT+CLIENT=any value
363 +* AT+UNAME=any value
364 +* AT+PWD=any value
365 +* AT+PUBTOPIC=any value
366 +* AT+SUBTOPIC=any value
370 370  
368 += 6. ThingsBoard.Cloud (via MQTT) =
371 371  
372 -* (% style="color:blue" %)**AT+PRO=3,0(hex format) or 3,5(json format)**(%%)    ~/~/Set to mqtt Server and  Payload
370 +== 1.1 Configure ThingsBoard ==
373 373  
374 -* (% style="color:blue" %)**AT+CLIENT=any value**(%%)
372 +=== 1.1.1 Create Device ===
375 375  
376 -* (% style="color:blue" %)**AT+UNAME=any value**(%%)
377 -
378 -* (% style="color:blue" %)**AT+PWD=any value**(%%)
379 -
380 -* (% style="color:blue" %)**AT+PUBTOPIC=any value**(%%)
381 -
382 -* (% style="color:blue" %)**AT+SUBTOPIC=any value**(%%)
383 -
384 -
385 -== 3.6 ThingsBoard.Cloud (via MQTT) ==
386 -
387 -=== 3.6.1 Configure ThingsBoard ===
388 -
389 -==== 3.6.1.1 Create Device ====
390 -
391 391  Create a New Device in [[ThingsBoard>>url:https://thingsboard.cloud/]].
392 392  
393 393  [[image:image-20230802112413-32.png]]
394 394  
395 -==== 3.6.2.2 Create Uplink & Downlink Converter ====
378 +=== 1.1.2 Create Uplink & Downlink Converter ===
396 396  
397 -(% style="color:blue" %)**Uplink Converter**
380 +Uplink Converter
398 398  
399 399  The purpose of the decoder function is to parse the incoming data and metadata to a format that ThingsBoard can consume. deviceName and deviceType are required, while attributes and telemetry are optional. Attributes and telemetry are flat key-value objects. Nested objects are not supported.
400 400  
... ... @@ -403,15 +403,14 @@
403 403  [[image:image-20230802112413-33.png]]
404 404  
405 405  
406 -(% style="color:blue" %)**Downlink Converter**
389 +Downlink Converter
407 407  
408 408  The Downlink converter transforming outgoing RPC message and then the Integration sends it to external MQTT broke
409 409  
410 410  [[image:image-20230802112413-34.png]]
411 411  
412 -(% style="color:red" %)**Note:Our device payload is already human readable data. Therefore, users do not need to write decoders. Simply create by default.**
395 +Note:Our device payload is already human readable data. Therefore, users do not need to write decoders. Simply create by default.
413 413  
414 -
415 415  === 1.1.3 MQTT Integration Setup ===
416 416  
417 417  Go to the Integrations center -> Integrations page and click “plus” icon to add a new integration. Name it “MQTT Integration”, select type MQTT;
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0