Changes for page MQTT Forward Instruction
Last modified by Kilight Cao on 2024/08/31 16:26
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -9,7 +9,6 @@ 9 9 Dragino LoRa/LoRaWAN gateway support MQTT forwarding. It can forward the sensor data from LoRa network to MQTT server , and vice verse. 10 10 11 11 12 - 13 13 == 1.1 Support Devices == 14 14 15 15 ... ... @@ -24,7 +24,6 @@ 24 24 * MS14 series if installed with the same firmware. (in this case, the MQTT forward will work , but no LoRa support) 25 25 26 26 27 - 28 28 = 2. Firmware Change Log for MQTT feature = 29 29 30 30 ... ... @@ -36,10 +36,8 @@ 36 36 ** Initiate version 37 37 38 38 39 - 40 40 = 3. MQTT forward operating principle = 41 41 42 - 43 43 == 3.1 Network Structure == 44 44 45 45 ... ... @@ -48,13 +48,11 @@ 48 48 * **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. 49 49 * **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. 50 50 51 - 52 52 [[image:image-20220527133547-1.png]] 53 53 54 54 General MQTT structure 55 55 56 56 57 - 58 58 == 3.2 How sensor data is forwarded == 59 59 60 60 ... ... @@ -61,7 +61,6 @@ 61 61 In this MQTT forward feature, the key point is how the gateway process the sensor data. 62 62 63 63 64 - 65 65 === 3.2.1 Upstream === 66 66 67 67 ... ... @@ -69,8 +69,6 @@ 69 69 70 70 ((( 71 71 The data flow works as below diagram. 72 - 73 - 74 74 ))) 75 75 76 76 [[image:image-20220527134000-2.png]] ... ... @@ -87,8 +87,6 @@ 87 87 88 88 ((( 89 89 90 - 91 - 92 92 ))) 93 93 94 94 === 3.2.2 Downstream === ... ... @@ -98,8 +98,6 @@ 98 98 99 99 ((( 100 100 Below are the data flow for downstream. 101 - 102 - 103 103 ))) 104 104 105 105 [[image:image-20220527134038-3.png]] ... ... @@ -107,7 +107,6 @@ 107 107 Downstream path 108 108 109 109 110 - 111 111 == 3.3 Macro Definition == 112 112 113 113 ... ... @@ -116,7 +116,6 @@ 116 116 ((( 117 117 Currently the (% style="color:#4f81bd" %)**-t (topic)**(%%) and (% style="color:#4f81bd" %)**-m (message)**(%%) support Macros. 118 118 119 - 120 120 121 121 ))) 122 122 ... ... @@ -130,7 +130,6 @@ 130 130 * HOSTNAME: Device Hostname 131 131 132 132 133 - 134 134 === 3.3.2 -m message macro === 135 135 136 136 ... ... @@ -141,7 +141,6 @@ 141 141 * JSON: Convert META to json format. 142 142 143 143 144 - 145 145 === 3.3.3 Example for Macro === 146 146 147 147 ... ... @@ -167,7 +167,6 @@ 167 167 ))) 168 168 169 169 170 - 171 171 == 3.4 Modify the MQTT to support more options == 172 172 173 173 ... ... @@ -295,10 +295,8 @@ 295 295 ))) 296 296 297 297 298 - 299 299 = 4. Example to communicate to a simple MQTT server = 300 300 301 - 302 302 == 4.1 Overview == 303 303 304 304 ... ... @@ -305,7 +305,6 @@ 305 305 This section is an example to show how to set up LG01-N to communicate with a MQTT server. The MQTT server is a simple utility set up in a local PC. Note: User can set up same server via [[this instruction>>url:http://www.steves-internet-guide.com/install-mosquitto-broker/]]. 306 306 307 307 308 - 309 309 == 4.2 Simulate via MQTT.fx utility == 310 310 311 311 ... ... @@ -334,7 +334,6 @@ 334 334 Downstream: Subscribe a topic to get downstream 335 335 336 336 337 - 338 338 == 4.3 Simulate via Dragino Command Line == 339 339 340 340 ... ... @@ -356,7 +356,6 @@ 356 356 mosquitto_pub 357 357 358 358 359 - 360 360 (% style="color:blue" %)**For Downstream** 361 361 362 362 Use [[mosquitto_sub>>url:https://mosquitto.org/man/mosquitto_sub-1.html]] to subscribe the change on the topic. ... ... @@ -366,7 +366,6 @@ 366 366 mosquitto_sub 367 367 368 368 369 - 370 370 == 4.4 Configure Dragino UI for MQTT connection == 371 371 372 372 ... ... @@ -390,7 +390,6 @@ 390 390 forward to MQTT 391 391 392 392 393 - 394 394 === 4.4.1 Configure the MQTT Client for Upstream === 395 395 396 396 ... ... @@ -411,7 +411,6 @@ 411 411 MQTT Publish configure 412 412 413 413 414 - 415 415 [[image:image-20220527135929-13.png]] 416 416 417 417 MQTT Channel settings ... ... @@ -440,7 +440,6 @@ 440 440 MQTT Publish 441 441 442 442 443 - 444 444 === 4.4.2 Configure the MQTT Client for Downstream === 445 445 446 446 ... ... @@ -504,13 +504,11 @@ 504 504 * Downstream: Listening broadcast message from gateway, and print it in console. 505 505 * The LoRa parameter settings in Arduino should match the LoRa settings in gateway, as below: 506 506 507 - 508 508 [[image:image-20220527140354-18.png]] 509 509 510 510 LoRa Parameter should match 511 511 512 512 513 - 514 514 Below is the test result after the Arduino Sketch is running. 515 515 516 516 [[image:image-20220527140459-19.png]] ... ... @@ -518,13 +518,11 @@ 518 518 Upstream Data Flow 519 519 520 520 521 - 522 522 [[image:image-20220527140542-20.png]] 523 523 524 524 Downstream Data Flow 525 525 526 526 527 - 528 528 === 4.5.2 Use LoRaWAN Protocol for communication ~-~- For LG308/LPS8/DLOS8 === 529 529 530 530 ... ... @@ -561,44 +561,36 @@ 561 561 [[image:image-20220613191345-4.png]] 562 562 563 563 564 - 565 565 (% style="color:blue" %)**Step 4**(%%): Map the Device Address to Remote ID in MQTT server. 566 566 567 567 [[image:image-20220613190635-2.png]] 568 568 569 569 570 - 571 571 (% style="color:blue" %)**Step 5: Upstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server 572 572 573 573 [[image:image-20220527141843-24.png]] 574 574 575 575 576 - 577 - 578 578 [[image:image-20220527141933-25.png]] 579 579 580 580 Choose ASCII Format 581 581 582 582 583 - 584 584 [[image:image-20220527142028-26.png]] 585 585 586 586 LHT65 Decoder 587 587 588 588 589 - 590 590 (% style="color:blue" %)**Step 6: Set up subscribe**(%%)**:** Subscribe a topci for downstream. 591 591 592 592 [[image:image-20220613191426-5.png]] 593 593 594 594 595 - 596 596 (% style="color:blue" %)**Step 7: Downstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server. 597 597 598 598 [[image:image-20220527142239-28.png]] 599 599 600 600 601 - 602 602 === 4.5.3 MQTT Downstream format === 603 603 604 604 ... ... @@ -627,7 +627,6 @@ 627 627 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]] 628 628 629 629 630 - 631 631 = 5. How to Debug = 632 632 633 633 ... ... @@ -634,7 +634,6 @@ 634 634 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. 635 635 636 636 637 - 638 638 = 6. How to ask for Support = 639 639 640 640