<
From version < 1.9 >
edited by Xiaoling
on 2022/05/12 16:02
To version < 1.10 >
edited by Xiaoling
on 2022/05/12 16:08
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -276,19 +276,19 @@
276 276  
277 277  In this test, the MQTT broker and MQTT.fx are installed in the same PC, so the MQTT server address in MQTT.fx should be localhost. Below shows how to connect to the server.
278 278  
279 -[[~[~[image:https://wiki.dragino.com/images/thumb/0/06/MQTT_Forward_4.png/600px-MQTT_Forward_4.png~|~|height="201" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Forward_4.png]]
279 +[[image:https://wiki.dragino.com/images/thumb/0/06/MQTT_Forward_4.png/600px-MQTT_Forward_4.png||height="201" width="600"]]
280 280  
281 281  Connect to MQTT Broker
282 282  
283 283  After connected, use publish to public some thing to MQTT server. This to simulate upsteam
284 284  
285 -[[~[~[image:https://wiki.dragino.com/images/thumb/b/bd/MQTT_Forward_5.png/600px-MQTT_Forward_5.png~|~|height="149" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Forward_5.png]]
285 +[[image:https://wiki.dragino.com/images/thumb/b/bd/MQTT_Forward_5.png/600px-MQTT_Forward_5.png||height="149" width="600"]]
286 286  
287 287  Upstream: Publish message to MQTT Broker
288 288  
289 289  To simulate a downstream, use MQTT.fx to subscribe a topic, and publish something to this topic. as Below:
290 290  
291 -[[~[~[image:https://wiki.dragino.com/images/thumb/3/3d/MQTT_Forward_6.png/600px-MQTT_Forward_6.png~|~|height="279" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Forward_6.png]]
291 +[[image:https://wiki.dragino.com/images/thumb/3/3d/MQTT_Forward_6.png/600px-MQTT_Forward_6.png||height="279" width="600"]]
292 292  
293 293  Downstream: Subscribe a topic to get downstream
294 294  
... ... @@ -308,7 +308,7 @@
308 308  
309 309  Note: 192.168.199.148 is MQTT broker address, the gateway and the MQTT broker PC are in the same network.
310 310  
311 -[[~[~[image:https://wiki.dragino.com/images/thumb/d/d0/MQTT_Command_6.png/600px-MQTT_Command_6.png~|~|height="188" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_6.png]]
311 +[[image:https://wiki.dragino.com/images/thumb/d/d0/MQTT_Command_6.png/600px-MQTT_Command_6.png||height="188" width="600"]]
312 312  
313 313  mosquitto_pub
314 314  
... ... @@ -317,10 +317,11 @@
317 317  
318 318  Use [[mosquitto_sub>>url:https://mosquitto.org/man/mosquitto_sub-1.html]] to subscribe the change on the topic.
319 319  
320 -[[~[~[image:https://wiki.dragino.com/images/thumb/8/89/MQTT_Command_7.png/600px-MQTT_Command_7.png~|~|height="267" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_7.png]]
320 +[[image:https://wiki.dragino.com/images/thumb/8/89/MQTT_Command_7.png/600px-MQTT_Command_7.png||height="267" width="600"]]
321 321  
322 322  mosquitto_sub
323 323  
324 +
324 324  == 4.4 Configure Dragino UI for MQTT connection ==
325 325  
326 326  This chapter are step by step to show to configure the Dragino Menu for MQTT auto connection.
... ... @@ -327,16 +327,17 @@
327 327  
328 328  Go to Dragino Menu ~-~-> MQTT Client
329 329  
330 -[[~[~[image:https://wiki.dragino.com/images/thumb/b/bc/MQTT_Command_8.png/600px-MQTT_Command_8.png~|~|height="249" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_8.png]]
331 +[[image:https://wiki.dragino.com/images/thumb/b/bc/MQTT_Command_8.png/600px-MQTT_Command_8.png||height="249" width="600"]]
331 331  
332 332  go to mqtt configure menu
333 333  
334 334  Select Forward to MQTT server. Notice: This option is removed from the latest firmware, in the latest firmware, if user submit "SAVE & APPLY" in MQTT page, the gateway will use MQTT service.
335 335  
336 -[[~[~[image:https://wiki.dragino.com/images/thumb/1/14/MQTT_Commands_8.png/600px-MQTT_Commands_8.png~|~|height="240" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Commands_8.png]]
337 +[[image:https://wiki.dragino.com/images/thumb/1/14/MQTT_Commands_8.png/600px-MQTT_Commands_8.png||height="240" width="600"]]
337 337  
338 338  forward to MQTT
339 339  
341 +
340 340  === 4.4.1 Configure the MQTT Client for Upstream ===
341 341  
342 342  Below screenshot is same as the publish command:
... ... @@ -348,11 +348,11 @@
348 348  //DATA: The data stores in /var/iot/channels/
349 349  }}}
350 350  
351 -[[~[~[image:https://wiki.dragino.com/images/thumb/c/c7/MQTT_Command_9.png/600px-MQTT_Command_9.png~|~|height="385" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_9.png]]
353 +[[image:https://wiki.dragino.com/images/thumb/c/c7/MQTT_Command_9.png/600px-MQTT_Command_9.png||height="385" width="600"]]
352 352  
353 353  MQTT Publish configure
354 354  
355 -[[~[~[image:https://wiki.dragino.com/images/thumb/b/b7/MQTT_Command_10.png/600px-MQTT_Command_10.png~|~|height="544" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_10.png]]
357 +[[image:https://wiki.dragino.com/images/thumb/b/b7/MQTT_Command_10.png/600px-MQTT_Command_10.png||height="544" width="600"]]
356 356  
357 357  MQTT Channel settings
358 358  
... ... @@ -366,7 +366,7 @@
366 366  
367 367  Below is a simulation to put this data to active the MQTT publish.
368 368  
369 -[[~[~[image:https://wiki.dragino.com/images/thumb/3/30/MQTT_Command_11.png/600px-MQTT_Command_11.png~|~|height="308" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_11.png]]
371 +[[image:https://wiki.dragino.com/images/thumb/3/30/MQTT_Command_11.png/600px-MQTT_Command_11.png||height="308" width="600"]]
370 370  
371 371  MQTT Publish
372 372  
... ... @@ -378,7 +378,7 @@
378 378  {{{ mosquitto_sub -h 192.168.199.148 -p 1883 -i dragino-1b7060 -t command.
379 379  }}}
380 380  
381 -[[~[~[image:https://wiki.dragino.com/images/3/36/MQTT_Command_12.png~|~|height="173" width="579"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_12.png]]
383 +[[image:https://wiki.dragino.com/images/3/36/MQTT_Command_12.png||height="173" width="579"]]
382 382  
383 383  MQTT Subscribe
384 384  
... ... @@ -385,7 +385,7 @@
385 385  
386 386  When MQTT broker receive a update on this topic, the gateway will get the update and use LoRa radio to broadcast this message. The LoRa parameters used for update is:
387 387  
388 -[[~[~[image:https://wiki.dragino.com/images/thumb/b/b8/MQTT_Command_13.png/600px-MQTT_Command_13.png~|~|height="300" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_13.png]]
390 +[[image:https://wiki.dragino.com/images/thumb/b/b8/MQTT_Command_13.png/600px-MQTT_Command_13.png||height="300" width="600"]]
389 389  
390 390  LoRa Broadcast parameters.
391 391  
... ... @@ -392,12 +392,11 @@
392 392  
393 393  And below is the subscribe simulation:
394 394  
395 -[[~[~[image:https://wiki.dragino.com/images/thumb/6/60/MQTT_Command_14.png/600px-MQTT_Command_14.png~|~|height="255" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_14.png]]
397 +[[image:https://wiki.dragino.com/images/thumb/6/60/MQTT_Command_14.png/600px-MQTT_Command_14.png||height="255" width="600"]]
396 396  
397 397  downstream simulation
398 398  
399 399  
400 -
401 401  == 4.5 Add LoRa support to communicate with remote sensor ==
402 402  
403 403  In above section, we have configured the UI to support MQTT upstream and downstream. We can simulate via Linux command. In this section, we will guide how to communicate with remote LoRa End Node for upstream and downstream.
... ... @@ -416,7 +416,7 @@
416 416  * Downstream: Listening broadcast message from gateway, and print it in console.
417 417  * The LoRa parameter settings in Arduino should match the LoRa settings in gateway, as below:
418 418  
419 -[[~[~[image:https://wiki.dragino.com/images/thumb/3/3b/MQTT_Command_17.png/600px-MQTT_Command_17.png~|~|height="197" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_17.png]]
420 +[[image:https://wiki.dragino.com/images/thumb/3/3b/MQTT_Command_17.png/600px-MQTT_Command_17.png||height="197" width="600"]]
420 420  
421 421  LoRa Parameter should match
422 422  
... ... @@ -423,11 +423,11 @@
423 423  
424 424  Below is the test result after the Arduino Sketch is running.
425 425  
426 -[[~[~[image:https://wiki.dragino.com/images/thumb/6/63/MQTT_Command_18.png/600px-MQTT_Command_18.png~|~|height="319" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_18.png]]
427 +[[image:https://wiki.dragino.com/images/thumb/6/63/MQTT_Command_18.png/600px-MQTT_Command_18.png||height="319" width="600"]]
427 427  
428 428  Upstream Data Flow
429 429  
430 -[[~[~[image:https://wiki.dragino.com/images/thumb/1/18/MQTT_Command_19.png/600px-MQTT_Command_19.png~|~|height="309" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_19.png]]
431 +[[image:https://wiki.dragino.com/images/thumb/1/18/MQTT_Command_19.png/600px-MQTT_Command_19.png||height="309" width="600"]]
431 431  
432 432  Downstream Data Flow
433 433  
... ... @@ -447,7 +447,7 @@
447 447  
448 448  Step 2: Make sure your Radio settings match the End Node settings.
449 449  
450 -[[~[~[image:https://wiki.dragino.com/images/thumb/f/f7/LG308_MQTT_5.png/600px-LG308_MQTT_5.png~|~|height="387" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_5.png]]
451 +[[image:https://wiki.dragino.com/images/thumb/f/f7/LG308_MQTT_5.png/600px-LG308_MQTT_5.png||height="387" width="600"]]
451 451  
452 452  Use Same Frequency Band as End Node
453 453  
... ... @@ -454,7 +454,7 @@
454 454  
455 455  Step 3: Set up publish format and MQTT channel. The LG308 will store the Data from End node in HEX format in the file. And we need to config the format to META
456 456  
457 -[[~[~[image:https://wiki.dragino.com/images/thumb/8/8d/LG308_MQTT_3.png/600px-LG308_MQTT_3.png~|~|height="385" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_3.png]]
458 +[[image:https://wiki.dragino.com/images/thumb/8/8d/LG308_MQTT_3.png/600px-LG308_MQTT_3.png||height="385" width="600"]]
458 458  
459 459  Publish mush use META as data format for LG308
460 460  
... ... @@ -461,7 +461,7 @@
461 461  
462 462  Step 4: Map the Device Address to Remote ID in MQTT server.
463 463  
464 -[[~[~[image:https://wiki.dragino.com/images/thumb/7/7f/LG308_MQTT_4.png/600px-LG308_MQTT_4.png~|~|height="335" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_4.png]]
465 +[[image:https://wiki.dragino.com/images/thumb/7/7f/LG308_MQTT_4.png/600px-LG308_MQTT_4.png||height="335" width="600"]]
465 465  
466 466  Map Dev Addr to remote ID
467 467  
... ... @@ -468,21 +468,21 @@
468 468  
469 469  Step 5: Upstream: Save the change, we can see the log info via "sytem log", End Node and MQTT Server
470 470  
471 -[[~[~[image:https://wiki.dragino.com/images/thumb/b/be/LG308_MQTT_6.png/600px-LG308_MQTT_6.png~|~|height="279" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_6.png]]
472 +[[image:https://wiki.dragino.com/images/thumb/b/be/LG308_MQTT_6.png/600px-LG308_MQTT_6.png||height="279" width="600"]]
472 472  
473 473  Upstream Process
474 474  
475 -[[~[~[image:https://wiki.dragino.com/images/thumb/0/07/LG308_MQTT_6_1.png/600px-LG308_MQTT_6_1.png~|~|height="246" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_6_1.png]]
476 +[[image:https://wiki.dragino.com/images/thumb/0/07/LG308_MQTT_6_1.png/600px-LG308_MQTT_6_1.png||height="246" width="600"]]
476 476  
477 477  Choose ASCII Format
478 478  
479 -[[~[~[image:https://wiki.dragino.com/images/thumb/a/a3/LG308_MQTT_6_2.png/600px-LG308_MQTT_6_2.png~|~|height="248" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_6_2.png]]
480 +[[image:https://wiki.dragino.com/images/thumb/a/a3/LG308_MQTT_6_2.png/600px-LG308_MQTT_6_2.png||height="248" width="600"]]
480 480  
481 481  LHT65 Decoder
482 482  
483 483  Step 6: Set up subscribe: Subscribe a topci for downstream.
484 484  
485 -[[~[~[image:https://wiki.dragino.com/images/thumb/b/b9/LG308_MQTT_7.png/600px-LG308_MQTT_7.png~|~|height="176" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_7.png]]
486 +[[image:https://wiki.dragino.com/images/thumb/b/b9/LG308_MQTT_7.png/600px-LG308_MQTT_7.png||height="176" width="600"]]
486 486  
487 487  Subscribe to a topic
488 488  
... ... @@ -489,7 +489,7 @@
489 489  
490 490  Step 7: Downstream: Save the change, we can see the log info via "sytem log", End Node and MQTT Server.
491 491  
492 -[[~[~[image:https://wiki.dragino.com/images/thumb/9/97/LG308_MQTT_8.png/600px-LG308_MQTT_8.png~|~|height="298" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:LG308_MQTT_8.png]]
493 +[[image:https://wiki.dragino.com/images/thumb/9/97/LG308_MQTT_8.png/600px-LG308_MQTT_8.png||height="298" width="600"]]
493 493  
494 494  Downstream Flow
495 495  
... ... @@ -498,23 +498,26 @@
498 498  
499 499  = 5. Example For Different MQTT Servers =
500 500  
501 -|=(((
502 -[[~[~[image:https://wiki.dragino.com/images/thumb/7/73/ThingSpeak1.png/200px-ThingSpeak1.png~|~|alt="ThingSpeak1.png" height="98" width="200"~]~]>>url:https://wiki.dragino.com/index.php/File:ThingSpeak1.png]]
502 +(% style="width:715.222px" %)
503 +|=(% style="width: 238px;" %)(((
504 +[[image:https://wiki.dragino.com/images/thumb/7/73/ThingSpeak1.png/200px-ThingSpeak1.png||alt="ThingSpeak1.png" height="98" width="200"]]
503 503  
504 504  === [[ThingSpeak Server>>url:http://www.thingspeak.com/]] ===
505 505  
506 506  
507 507  [[Examples>>url:https://wiki.dragino.com/index.php/ThingSpeak_Examples]]
508 -)))|=(((
509 -[[~[~[image:https://wiki.dragino.com/images/thumb/3/3b/Lewei50.png/200px-Lewei50.png~|~|alt="Lewei50.png" height="58" width="200"~]~]>>url:https://wiki.dragino.com/index.php/File:Lewei50.png]]
510 +)))|=(% style="width: 235px;" %)(((
511 +[[image:https://wiki.dragino.com/images/thumb/3/3b/Lewei50.png/200px-Lewei50.png||alt="Lewei50.png" height="58" width="200"]]
510 510  
511 511  === [[乐联网平台>>url:https://www.lewei50.com/]] ===
512 512  
513 513  
514 -[[lewei Example>>url:https://wiki.dragino.com/index.php/Lewei_Example_mqtt]]
515 -)))|=(((
516 -[[~[~[image:https://wiki.dragino.com/images/thumb/a/aa/AWS-IOT.png/200px-AWS-IOT.png~|~|alt="AWS-IOT.png" height="122" width="200"~]~]>>url:https://wiki.dragino.com/index.php/File:AWS-IOT.png]]
517 517  
517 +
518 +[[lewei Example>>url:https://wiki.dragino.com/index.php/Lewei_Example_mqtt]]
519 +)))|=(% style="width: 239px;" %)(((
520 +[[image:https://wiki.dragino.com/images/thumb/a/aa/AWS-IOT.png/200px-AWS-IOT.png||alt="AWS-IOT.png" height="122" width="200"]]
521 +
518 518  === [[AWS-IOT>>url:https://aws.amazon.com/cn/iot-platform/how-it-works/]] ===
519 519  
520 520  
... ... @@ -523,7 +523,7 @@
523 523  
524 524  = 6. How to Debug =
525 525  
526 -User can login the gateway's console and run **logread -f**. It will shows the output when there is packet arrive.User can see if it is correct.
530 +User can login the gateway's console and run (% class="mark" %)**logread -f**(%%). It will shows the output when there is packet arrive.User can see if it is correct.
527 527  
528 528  = 7. How to ask for Support =
529 529  
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0