Changes for page RS485-BL – Waterproof RS485 to LoRaWAN Converter
Last modified by Xiaoling on 2025/04/23 15:57
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 1 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -501,102 +501,182 @@ 501 501 ))) 502 502 ))) 503 503 504 +((( 504 504 For example, if we have a RS485 sensor. The command to get sensor value is: 01 03 0B B8 00 02 46 0A. Where 01 03 0B B8 00 02 is the Modbus command to read the register 0B B8 where stored the sensor value. The 46 0A is the CRC-16/MODBUS which calculate manually. 506 +))) 505 505 508 +((( 506 506 In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same. 510 +))) 507 507 512 +((( 508 508 **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx. 514 +))) 509 509 510 510 (% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %) 511 511 |(% style="width:577px" %)((( 518 +((( 512 512 **AT+SEARCHx=aa,xx xx xx xx xx** 520 +))) 513 513 514 -* **aa: 1: prefix match mode; 2: prefix and suffix match mode**515 -* *xxxxxxxx xx:matchstring. Max 5 bytesforprefix and5 bytesfor suffix**522 +* ((( 523 +**aa: 1: prefix match mode; 2: prefix and suffix match mode** 516 516 ))) 525 +* ((( 526 +**xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix** 527 +))) 528 +))) 517 517 530 +((( 518 518 **Examples:** 532 +))) 519 519 534 +((( 520 520 1)For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 536 +))) 521 521 538 +((( 522 522 If we set AT+SEARCH1=1,1E 56 34. (max 5 bytes for prefix) 540 +))) 523 523 542 +((( 524 524 The valid data will be all bytes after 1E 56 34 , so it is (% style="background-color:yellow" %)**2e 30 58 5f 36 41 30 31 00 49** 544 +))) 525 525 546 +((( 526 526 [[image:1653271044481-711.png]] 548 +))) 527 527 550 +((( 528 528 2)For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 552 +))) 529 529 554 +((( 530 530 If we set AT+SEARCH1=2, 1E 56 34+31 00 49 556 +))) 531 531 558 +((( 532 532 Device will search the bytes between 1E 56 34 and 31 00 49. So it is(% style="background-color:yellow" %) **2e 30 58 5f 36 41 30** 560 +))) 533 533 562 +((( 534 534 [[image:1653271276735-972.png]] 564 +))) 535 535 566 +((( 536 536 **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes. 568 +))) 537 537 538 538 (% style="background-color:#4f81bd; color:white; width:510px" %) 539 539 |(% style="width:726px" %)((( 572 +((( 540 540 **AT+DATACUTx=a,b,c** 574 +))) 541 541 542 -* **a: length for the return of AT+COMMAND** 543 -* **b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.** 544 -* **c: define the position for valid value. ** 576 +* ((( 577 +**a: length for the return of AT+COMMAND** 545 545 ))) 579 +* ((( 580 +**b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.** 581 +))) 582 +* ((( 583 +**c: define the position for valid value. ** 584 +))) 585 +))) 546 546 587 +((( 547 547 **Examples:** 589 +))) 548 548 549 -* Grab bytes: 591 +* ((( 592 +Grab bytes: 593 +))) 550 550 595 +((( 551 551 [[image:1653271581490-837.png||height="313" width="722"]] 597 +))) 552 552 599 +((( 600 + 601 +))) 553 553 554 -* Grab a section. 603 +* ((( 604 +Grab a section. 605 +))) 555 555 607 +((( 556 556 [[image:1653271648378-342.png||height="326" width="720"]] 609 +))) 557 557 611 +((( 612 + 613 +))) 558 558 559 -* Grab different sections. 615 +* ((( 616 +Grab different sections. 617 +))) 560 560 619 +((( 561 561 [[image:1653271657255-576.png||height="305" width="730"]] 621 +))) 562 562 563 563 ((( 624 +((( 564 564 (% style="color:red" %)**Note:** 565 565 ))) 627 +))) 566 566 567 567 ((( 630 +((( 568 568 AT+SEARCHx and AT+DATACUTx can be used together, if both commands are set, RS485-BL will first process AT+SEARCHx on the return string and get a temporary string, and then process AT+DATACUTx on this temporary string to get the final payload. In this case, AT+DATACUTx need to set to format AT+DATACUTx=0,xx,xx where the return bytes set to 0. 569 569 ))) 633 +))) 570 570 571 571 ((( 636 +((( 572 572 **Example:** 573 573 ))) 639 +))) 574 574 575 575 ((( 642 +((( 576 576 (% style="color:red" %)AT+COMMAND1=11 01 1E D0,0 577 577 ))) 645 +))) 578 578 579 579 ((( 648 +((( 580 580 (% style="color:red" %)AT+SEARCH1=1,1E 56 34 581 581 ))) 651 +))) 582 582 583 583 ((( 654 +((( 584 584 (% style="color:red" %)AT+DATACUT1=0,2,1~~5 585 585 ))) 657 +))) 586 586 587 587 ((( 660 +((( 588 588 (% style="color:red" %)Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 589 589 ))) 663 +))) 590 590 591 591 ((( 666 +((( 592 592 (% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49 593 593 ))) 669 +))) 594 594 595 595 ((( 672 +((( 596 596 (% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36 597 597 ))) 675 +))) 598 598 677 +((( 599 599 [[image:1653271763403-806.png]] 679 +))) 600 600 601 601 602 602 === 3.3.4 Compose the uplink payload === ... ... @@ -743,26 +743,8 @@ 743 743 744 744 == 3.4 Uplink Payload == 745 745 746 -(% border="1" style="background-color:#4f81bd; color:white; width:850px" %) 747 -|**Size(bytes)**|(% style="width:130px" %)**2**|(% style="width:93px" %)**1**|(% style="width:509px" %)**Length depends on the return from the commands** 748 -|Value|(% style="width:130px" %)((( 749 -((( 750 -Battery(mV) 751 -))) 826 +[[image:image-20220606105412-1.png]] 752 752 753 -((( 754 -& 755 -))) 756 - 757 -((( 758 -Interrupt _Flag 759 -))) 760 -)))|(% style="width:93px" %)((( 761 -PAYLOAD_VER 762 - 763 - 764 -)))|(% style="width:509px" %)If the valid payload is too long and exceed the maximum support payload length in server, server will show payload not provided in the LoRaWAN server. 765 - 766 766 Below is the decoder for the first 3 bytes. The rest bytes are dynamic depends on different RS485 sensors. 767 767 768 768 (((
- image-20220606105412-1.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +13.9 KB - Content