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
-
... ... @@ -24,7 +24,6 @@ 24 24 25 25 26 26 27 - 28 28 = 2. Firmware Change Log for MQTT feature = 29 29 30 30 ... ... @@ -37,7 +37,6 @@ 37 37 38 38 39 39 40 - 41 41 = 3. MQTT forward operating principle = 42 42 43 43 ... ... @@ -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 ... ... @@ -349,7 +349,7 @@ 349 349 mosquitto_sub 350 350 351 351 352 -== 4.4 356 +== 4.4 Configure Dragino UI for MQTT connection == 353 353 354 354 This chapter are step by step to show to configure the Dragino Menu for MQTT auto connection. 355 355 ... ... @@ -357,7 +357,7 @@ 357 357 Go to (% style="color:#4f81bd" %)**Dragino Menu ~-~-> MQTT Client** 358 358 ))) 359 359 360 -[[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"]] 361 361 362 362 go to mqtt configure menu 363 363 ... ... @@ -371,28 +371,24 @@ 371 371 forward to MQTT 372 372 373 373 378 +=== 4.4.1 Configure the MQTT Client for Upstream === 374 374 375 - === 4.4.1 Configure theMQTT Clientfor Upstream===380 +Below screenshot is same as the publish command: 376 376 377 - 378 -**Below screenshot is same as the publish command:** 379 - 380 380 (% class="box" %) 381 381 ((( 382 - **mosquitto_pub -h 192.168.199.148 -p 1883 -i dragino-1b7060 -t CLIENTID/CHANNEL/data -m DATA384 +mosquitto_pub -h 192.168.199.148 -p 1883 -i dragino-1b7060 -t CLIENTID/CHANNEL/data -m DATA 383 383 ~/~/where the CLIENTID, CHANNEL & DATA are macro. represent for 384 384 ~/~/CLIENTID: dragino-1b7060 385 385 ~/~/CHANNEL: Remote ID in Channel settings; here is 78901 or 567456 386 -~/~/DATA: The data stores in /var/iot/channels/ **388 +~/~/DATA: The data stores in /var/iot/channels/ 387 387 ))) 388 388 389 - 390 390 [[image:image-20220527135828-12.png]] 391 391 392 392 MQTT Publish configure 393 393 394 394 395 - 396 396 [[image:image-20220527135929-13.png]] 397 397 398 398 MQTT Channel settings ... ... @@ -421,10 +421,8 @@ 421 421 MQTT Publish 422 422 423 423 424 +=== 4.4.2 Configure the MQTT Client for Downstream === 424 424 425 -=== 4.4.2 Configure the MQTT Client for Downstream === 426 - 427 - 428 428 Below screen shot equal to this subscribe command: 429 429 430 430 (% class="box" %) ... ... @@ -453,15 +453,13 @@ 453 453 downstream simulation 454 454 455 455 456 -== 4.5 454 +== 4.5 Add LoRa support to communicate with remote sensor == 457 457 458 - 459 459 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. 460 460 461 461 462 -=== 4.5.1 459 +=== 4.5.1 Use LoRa Raw protocol for communication ~-~- For LG01/LG02 === 463 463 464 - 465 465 ((( 466 466 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. 467 467 ))) ... ... @@ -472,8 +472,6 @@ 472 472 473 473 ((( 474 474 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. 475 - 476 - 477 477 ))) 478 478 479 479 ((( ... ... @@ -503,10 +503,8 @@ 503 503 Downstream Data Flow 504 504 505 505 500 +=== 4.5.2 Use LoRaWAN Protocol for communication ~-~- For LG308/LPS8/DLOS8 === 506 506 507 -=== 4.5.2 Use LoRaWAN Protocol for communication ~-~- For LG308/LPS8/DLOS8 === 508 - 509 - 510 510 ((( 511 511 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. 512 512 ))) ... ... @@ -513,17 +513,15 @@ 513 513 514 514 ((( 515 515 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. 516 - 517 - 518 518 (% style="color:#4f81bd" %)**Video Instruction**(%%): (% style="color:blue" %)[[https:~~/~~/youtu.be/qJTY441-t90>>url:https://youtu.be/qJTY441-t90]] 519 519 ))) 520 520 521 521 ((( 522 -(% style="color:b lued" %)**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. 523 523 ))) 524 524 525 525 ((( 526 -(% style="color:b lue" %)**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. 527 527 ))) 528 528 529 529 [[image:image-20220527141235-21.png]] ... ... @@ -533,7 +533,7 @@ 533 533 534 534 ((( 535 535 ((( 536 -(% style="color:b lue" %)**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. 537 537 ))) 538 538 ))) 539 539 ... ... @@ -541,13 +541,13 @@ 541 541 542 542 543 543 544 -(% style="color:b lue" %)**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. 545 545 546 546 [[image:image-20220613190635-2.png]] 547 547 548 548 549 549 550 -(% style="color:b lue" %)**Step 5: Upstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server540 +(% style="color:#4f81bd" %)**Step 5: Upstream**(%%): Save the change, we can see the log info via "sytem log", End Node and MQTT Server 551 551 552 552 [[image:image-20220527141843-24.png]] 553 553 ... ... @@ -566,19 +566,19 @@ 566 566 567 567 568 568 569 -(% style="color:b lue" %)**Step 6: Set up subscribe**(%%)**:** Subscribe a topci for downstream.559 +(% style="color:#4f81bd" %)**Step 6: Set up subscribe**(%%)**:** Subscribe a topci for downstream. 570 570 571 571 [[image:image-20220613191426-5.png]] 572 572 573 573 574 574 575 -(% style="color:b lue" %)**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. 576 576 577 577 [[image:image-20220527142239-28.png]] 578 578 579 579 580 580 581 -=== 4.5.3MQTT Downstream format ===571 +=== MQTT Downstream format === 582 582 583 583 584 584 mosquitto_pub -h $server_address -p $server_port -t $Client_ID -m "**dev_addr,imme/time,txt/hex,payload**" ... ... @@ -585,7 +585,7 @@ 585 585 586 586 (% class="box infomessage" %) 587 587 ((( 588 - **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" 589 589 ))) 590 590 591 591 mosquitto_pub -h $server_address -p $server_port -t $Client_ID -m "**dev_addr,imme/time,txt/hex,payload,txpw,txbw,SF,frequency,rxwindow**" ... ... @@ -592,7 +592,7 @@ 592 592 593 593 (% class="box infomessage" %) 594 594 ((( 595 - **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"**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" 596 596 ))) 597 597 598 598 Or use [[MQTT.fx>>https://mqttfx.jensd.de/index.php/download]] ... ... @@ -599,23 +599,17 @@ 599 599 600 600 [[image:image-20220613192816-6.png||height="440" width="1056"]] 601 601 602 - 603 603 (% 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"]]** 604 604 605 - 606 606 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]] 607 607 596 += 5. How to Debug = 608 608 609 - 610 -= 5. How to Debug = 611 - 612 - 613 613 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. 614 614 615 615 616 -= 6. 601 += 6. How to ask for Support = 617 617 618 - 619 619 If a user still not have trouble making it works. please send a mail to support@dragino.com with the below info: 620 620 621 621 * Detail of your LoRaWAN end node.