<
From version < 49.1 >
edited by Kilight Cao
on 2022/07/29 11:38
To version < 44.6 >
edited by Xiaoling
on 2022/07/14 15:57
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Kilight
1 +XWiki.Xiaoling
Content
... ... @@ -22,6 +22,8 @@
22 22  * LIG16
23 23  * MS14 series if installed with the same firmware. (in this case, the MQTT forward will work , but no LoRa support)
24 24  
25 +
26 +
25 25  = 2.  Firmware Change Log for MQTT feature =
26 26  
27 27  
... ... @@ -32,6 +32,8 @@
32 32  * LG02_LG08-5.3.1580178039
33 33  ** Initiate version
34 34  
37 +
38 +
35 35  = 3.  MQTT forward operating principle =
36 36  
37 37  
... ... @@ -41,7 +41,7 @@
41 41  Below shows the network structure for MQTT forwarding.
42 42  
43 43  * **For Uplink:**  The sensor sends data to LoRa Gateway via LoRa wireless, The gateway will process these data and forward to remote MQTT Broker via Internet.
44 -* **For Downlink:** The gateway subscribe a topic in the MQTT broker, when there is update on the topic, the gateway will know and broadcast the data to Local LoRa network.
48 +* **For Downlink:** The gateway subscribe a topic in the MQTT broker, when there is update on the topic, the gateway will know and broadcast the data to Local LoRa network,
45 45  
46 46  [[image:image-20220527133547-1.png]]
47 47  
... ... @@ -48,7 +48,6 @@
48 48  General MQTT structure
49 49  
50 50  
51 -
52 52  == 3.2  How sensor data is forwarded ==
53 53  
54 54  
... ... @@ -57,13 +57,10 @@
57 57  
58 58  === 3.2.1  Upstream ===
59 59  
60 -
61 61  Assume there are two sensor nodes, their ID are Node1 ID: 6734 , Node2 ID: 7456. In the remote MQTT broker there are two topics: Topic1: /channel/765800, Topic2: /channel/367860. We can set up in the gateway to map Node1 to Topic1 and Node2 to Topic2. So when there is a sensor data from Node1, the gateway will forward the data to Topic1, when there is sensor data from Node2, the gateway will forward to Topic2.
62 62  
63 63  (((
64 64  The data flow works as below diagram.
65 -
66 -
67 67  )))
68 68  
69 69  [[image:image-20220527134000-2.png]]
... ... @@ -96,7 +96,6 @@
96 96  Downstream path
97 97  
98 98  
99 -
100 100  == 3.3  Macro Definition ==
101 101  
102 102  
... ... @@ -105,7 +105,6 @@
105 105  (((
106 106  Currently the (% style="color:#4f81bd" %)**-t (topic)**(%%) and (% style="color:#4f81bd" %)**-m (message)**(%%) support Macros.
107 107  
108 -
109 109  
110 110  )))
111 111  
... ... @@ -118,6 +118,9 @@
118 118  * USERNAME: User ID (-u)
119 119  * HOSTNAME: Device Hostname
120 120  
119 +
120 +
121 +
121 121  === 3.3.2  -m message macro ===
122 122  
123 123  
... ... @@ -127,6 +127,9 @@
127 127  * META: Completely sensor data with time stamp and rssi
128 128  * JSON: Convert META to json format.
129 129  
131 +
132 +
133 +
130 130  === 3.3.3  Example for Macro ===
131 131  
132 132  
... ... @@ -321,7 +321,6 @@
321 321  
322 322  == 4.3  Simulate via Dragino Command Line ==
323 323  
324 -
325 325  For first try of MQTT connection, simulate via command line is recommend, there are many servers / connection type for MQTT. They are using different connection parameters. Simulating the connection via command line will help us rapidly connect to server and debug.
326 326  
327 327  In the Dragino Gateway, we use [[mosquitto client>>url:https://mosquitto.org/]] for MQTT connection.
... ... @@ -350,10 +350,8 @@
350 350  mosquitto_sub
351 351  
352 352  
356 +== 4.4 Configure Dragino UI for MQTT connection ==
353 353  
354 -== 4.4  Configure Dragino UI for MQTT connection ==
355 -
356 -
357 357  This chapter are step by step to show to configure the Dragino Menu for MQTT auto connection.
358 358  
359 359  (((
... ... @@ -360,7 +360,7 @@
360 360  Go to (% style="color:#4f81bd" %)**Dragino Menu ~-~-> MQTT Client**
361 361  )))
362 362  
363 -[[image:image-20220714155901-1.png]]
364 +[[image:https://wiki.dragino.com/images/thumb/b/bc/MQTT_Command_8.png/600px-MQTT_Command_8.png||height="249" width="600"]]
364 364  
365 365  go to mqtt configure menu
366 366  
... ... @@ -374,28 +374,24 @@
374 374  forward to MQTT
375 375  
376 376  
378 +=== 4.4.1 Configure the MQTT Client for Upstream ===
377 377  
378 -=== 4.4.1  Configure the MQTT Client for Upstream ===
380 +Below screenshot is same as the publish command:
379 379  
380 -
381 -**Below screenshot is same as the publish command:**
382 -
383 383  (% class="box" %)
384 384  (((
385 -**mosquitto_pub -h 192.168.199.148 -p 1883 -i dragino-1b7060 -t CLIENTID/CHANNEL/data -m DATA
384 +mosquitto_pub -h 192.168.199.148 -p 1883 -i dragino-1b7060 -t CLIENTID/CHANNEL/data -m DATA
386 386  ~/~/where the CLIENTID, CHANNEL & DATA are macro. represent for
387 387  ~/~/CLIENTID: dragino-1b7060
388 388  ~/~/CHANNEL: Remote ID in Channel settings; here is 78901 or 567456
389 -~/~/DATA: The data stores in /var/iot/channels/**
388 +~/~/DATA: The data stores in /var/iot/channels/
390 390  )))
391 391  
392 -
393 393  [[image:image-20220527135828-12.png]]
394 394  
395 395  MQTT Publish configure
396 396  
397 397  
398 -
399 399  [[image:image-20220527135929-13.png]]
400 400  
401 401  MQTT Channel settings
... ... @@ -424,10 +424,8 @@
424 424  MQTT Publish
425 425  
426 426  
424 +=== 4.4.2 Configure the MQTT Client for Downstream ===
427 427  
428 -=== 4.4.2  Configure the MQTT Client for Downstream ===
429 -
430 -
431 431  Below screen shot equal to this subscribe command:
432 432  
433 433  (% class="box" %)
... ... @@ -456,15 +456,13 @@
456 456  downstream simulation
457 457  
458 458  
459 -== 4.5  Add LoRa support to communicate with remote sensor ==
454 +== 4.5 Add LoRa support to communicate with remote sensor ==
460 460  
461 -
462 462  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.
463 463  
464 464  
465 -=== 4.5.1  Use LoRa Raw protocol for communication ~-~- For LG01/LG02 ===
459 +=== 4.5.1 Use LoRa Raw protocol for communication ~-~- For LG01/LG02 ===
466 466  
467 -
468 468  (((
469 469  We can use [[LoRa Shield>>url:http://www.dragino.com/products/lora/item/102-lora-shield.html]] to send LoRa Raw data to Gateway and receive data from gateway.
470 470  )))
... ... @@ -475,8 +475,6 @@
475 475  
476 476  (((
477 477  And this link is the required library: [[arduino-LoRa-master>>url:http://www.dragino.com/downloads/index.php?dir=LoraShield/]]. Unzip this library and put in Arduino library location.
478 -
479 -
480 480  )))
481 481  
482 482  (((
... ... @@ -506,10 +506,8 @@
506 506  Downstream Data Flow
507 507  
508 508  
500 +=== 4.5.2 Use LoRaWAN Protocol for communication ~-~- For LG308/LPS8/DLOS8 ===
509 509  
510 -=== 4.5.2  Use LoRaWAN Protocol for communication ~-~- For LG308/LPS8/DLOS8 ===
511 -
512 -
513 513  (((
514 514  Since firmware (% style="color:#4f81bd" %)**LG02_LG08~-~-build-v5.3.1585192026-20200326-1109,**(%%) Dragino LoRaWAN gateways support the communication to LoRaWAN (% style="color:#4f81bd" %)**ABP end node**(%%) locally without the need of LoRaWAN server. This feature allow us to integrate MQTT in the gateway to support LoRaWAN to MQTT forwarding or visa verse.
515 515  )))
... ... @@ -516,17 +516,15 @@
516 516  
517 517  (((
518 518  When use test this feature, please use the version higher then : (% style="color:#4f81bd" %)**LG02_LG08~-~-build-v5.4.1593400722-20200629-1120**(%%), in this version, the upload format is changed and readable, which is easier for integration.
519 -
520 -
521 -(% style="color:blue" %)**Video Instruction**(%%): (% style="color:blue" %)[[https:~~/~~/youtu.be/qJTY441-t90>>url:https://youtu.be/qJTY441-t90]]
508 +(% style="color:#4f81bd" %)**Video Instruction**(%%): (% style="color:blue" %)[[https:~~/~~/youtu.be/qJTY441-t90>>url:https://youtu.be/qJTY441-t90]]
522 522  )))
523 523  
524 524  (((
525 -(% style="color:blue" %)**Step 1**(%%): Refer [[Communicate with ABP End Node>>Communicate with ABP End Node without LoRaWAN Network Server --- LG308]] to know how to set up LG308 to work with LoRaWAN End node.
512 +(% style="color:#4f81bd" %)**Step 1**(%%): Refer [[Communicate with ABP End Node>>Communicate with ABP End Node without LoRaWAN Network Server --- LG308]] to know how to set up LG308 to work with LoRaWAN End node.
526 526  )))
527 527  
528 528  (((
529 -(% style="color:blue" %)**Step 2**(%%): Make sure your Radio settings match the End Node settings.
516 +(% style="color:#4f81bd" %)**Step 2**(%%): Make sure your Radio settings match the End Node settings.
530 530  )))
531 531  
532 532  [[image:image-20220527141235-21.png]]
... ... @@ -536,7 +536,7 @@
536 536  
537 537  (((
538 538  (((
539 -(% style="color:blue" %)**Step 3**(%%): Set up publish format and MQTT channel. The LG308 will store the Data from End node in (% style="color:#4f81bd" %)**HEX format**(%%) in the file.
526 +(% style="color:#4f81bd" %)**Step 3**(%%): Set up publish format and MQTT channel. The LG308 will store the Data from End node in (% style="color:#4f81bd" %)**HEX format**(%%) in the file.
540 540  )))
541 541  )))
542 542  
... ... @@ -544,13 +544,13 @@
544 544  
545 545  
546 546  
547 -(% style="color:blue" %)**Step 4**(%%): Map the Device Address to Remote ID in MQTT server.
534 +(% style="color:#4f81bd" %)**Step 4**(%%): Map the Device Address to Remote ID in MQTT server.
548 548  
549 549  [[image:image-20220613190635-2.png]]
550 550  
551 551  
552 552  
553 -(% style="color:blue" %)**Step 5: Upstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server
540 +(% style="color:#4f81bd" %)**Step 5: Upstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server
554 554  
555 555  [[image:image-20220527141843-24.png]]
556 556  
... ... @@ -569,19 +569,19 @@
569 569  
570 570  
571 571  
572 -(% style="color:blue" %)**Step 6: Set up subscribe**(%%)**:** Subscribe a topci for downstream.
559 +(% style="color:#4f81bd" %)**Step 6: Set up subscribe**(%%)**:** Subscribe a topci for downstream.
573 573  
574 574  [[image:image-20220613191426-5.png]]
575 575  
576 576  
577 577  
578 -(% style="color:blue" %)**Step 7: Downstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server.
565 +(% style="color:#4f81bd" %)**Step 7: Downstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server.
579 579  
580 580  [[image:image-20220527142239-28.png]]
581 581  
582 582  
583 583  
584 -=== 4.5.3 MQTT Downstream format ===
571 +=== MQTT Downstream format ===
585 585  
586 586  
587 587  mosquitto_pub -h $server_address -p $server_port -t $Client_ID -m "**dev_addr,imme/time,txt/hex,payload**"
... ... @@ -588,7 +588,7 @@
588 588  
589 589  (% class="box infomessage" %)
590 590  (((
591 -**mosquitto_pub -h 10.130.2.192 -p 1883 -t dragino-1d25dc/ -m "260211D,time,txt,hello"**
578 +mosquitto_pub -h 10.130.2.192 -p 1883 -t dragino-1d25dc/ -m "260211D,time,txt,hello"
592 592  )))
593 593  
594 594  mosquitto_pub -h $server_address -p $server_port -t $Client_ID -m "**dev_addr,imme/time,txt/hex,payload,txpw,txbw,SF,frequency,rxwindow**"
... ... @@ -595,7 +595,7 @@
595 595  
596 596  (% class="box infomessage" %)
597 597  (((
598 -**mosquitto_pub -h 10.130.2.192 -p 1883 -t dragino-1d25dc/ -m "260211D,time,txt,hello,20,1,SF12,923300000,2"**
585 +mosquitto_pub -h 10.130.2.192 -p 1883 -t dragino-1d25dc/ -m "260211D,time,txt,hello,20,1,SF12,923300000,2 > /var/iot/push/test"
599 599  )))
600 600  
601 601  Or use [[MQTT.fx>>https://mqttfx.jensd.de/index.php/download]]
... ... @@ -602,23 +602,17 @@
602 602  
603 603  [[image:image-20220613192816-6.png||height="440" width="1056"]]
604 604  
605 -
606 606  (% style="color:red" %)**Notice: The text use for Downstream must meet the requirement from [[LG308 Downstream Payload>>Communicate with ABP End Node without LoRaWAN Network Server --- LG308||anchor="H2.2Downstream"]]**
607 607  
608 -
609 609  Check out this link for more mosquito-related directives [[https:~~/~~/mosquitto.org/man/mosquitto_pub-1.html>>https://mosquitto.org/man/mosquitto_pub-1.html]]
610 610  
596 += 5. How to Debug =
611 611  
612 -
613 -= 5.  How to Debug =
614 -
615 -
616 616  User can login the gateway's console and run (% style="color:#4f81bd" %)**logread -f**(%%). It will shows the output when there is packet arrive.User can see if it is correct.
617 617  
618 618  
619 -= 6.  How to ask for Support =
601 += 6. How to ask for Support =
620 620  
621 -
622 622  If a user still not have trouble making it works. please send a mail to support@dragino.com with the below info:
623 623  
624 624  * Detail of your LoRaWAN end node.
image-20220714155901-1.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -75.2 KB
Content
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0