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)
Details
- Page properties
-
- Content
-
... ... @@ -382,8 +382,6 @@ 382 382 ))) 383 383 ))) 384 384 385 - 386 - 387 387 === 3.3.2 Configure sensors === 388 388 389 389 ((( ... ... @@ -474,209 +474,117 @@ 474 474 After we got the valid value from each RS485 commands, we need to combine them together with the command **AT+DATAUP**. 475 475 ))) 476 476 477 -((( 478 478 **Examples:** 479 -))) 480 480 481 -((( 482 482 Below are examples for the how above AT Commands works. 483 -))) 484 484 485 -((( 486 486 **AT+COMMANDx : **This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is: 487 -))) 488 488 489 489 (% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %) 490 490 |(% style="width:498px" %)((( 491 -((( 492 492 **AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m** 493 -))) 494 494 495 -((( 496 496 **xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent** 497 -))) 498 498 499 -((( 500 500 **m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command** 501 501 ))) 502 -))) 503 503 504 -((( 505 505 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 -))) 507 507 508 -((( 509 509 In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same. 510 -))) 511 511 512 -((( 513 513 **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx. 514 -))) 515 515 516 516 (% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %) 517 517 |(% style="width:577px" %)((( 518 -((( 519 519 **AT+SEARCHx=aa,xx xx xx xx xx** 520 -))) 521 521 522 -* (((523 -** aa:1:prefix matchmode;2:prefix and suffixmatch mode**500 +* **aa: 1: prefix match mode; 2: prefix and suffix match mode** 501 +* **xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix** 524 524 ))) 525 -* ((( 526 -**xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix** 527 -))) 528 -))) 529 529 530 -((( 531 531 **Examples:** 532 -))) 533 533 534 -((( 535 535 1)For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 536 -))) 537 537 538 -((( 539 539 If we set AT+SEARCH1=1,1E 56 34. (max 5 bytes for prefix) 540 -))) 541 541 542 -((( 543 543 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 -))) 545 545 546 -((( 547 547 [[image:1653271044481-711.png]] 548 -))) 549 549 550 -((( 551 551 2)For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 552 -))) 553 553 554 -((( 555 555 If we set AT+SEARCH1=2, 1E 56 34+31 00 49 556 -))) 557 557 558 -((( 559 559 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 -))) 561 561 562 -((( 563 563 [[image:1653271276735-972.png]] 564 -))) 565 565 566 -((( 567 567 **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes. 568 -))) 569 569 570 570 (% style="background-color:#4f81bd; color:white; width:510px" %) 571 571 |(% style="width:726px" %)((( 572 -((( 573 573 **AT+DATACUTx=a,b,c** 574 -))) 575 575 576 -* ((( 577 -**a: length for the return of AT+COMMAND** 528 +* **a: length for the return of AT+COMMAND** 529 +* **b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.** 530 +* **c: define the position for valid value. ** 578 578 ))) 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 -))) 586 586 587 -((( 588 588 **Examples:** 589 -))) 590 590 591 -* ((( 592 -Grab bytes: 593 -))) 535 +* Grab bytes: 594 594 595 -((( 596 596 [[image:1653271581490-837.png||height="313" width="722"]] 597 -))) 598 598 599 -((( 600 - 601 -))) 602 602 603 -* ((( 604 -Grab a section. 605 -))) 540 +* Grab a section. 606 606 607 -((( 608 608 [[image:1653271648378-342.png||height="326" width="720"]] 609 -))) 610 610 611 -((( 612 - 613 -))) 614 614 615 -* ((( 616 -Grab different sections. 617 -))) 545 +* Grab different sections. 618 618 619 -((( 620 620 [[image:1653271657255-576.png||height="305" width="730"]] 621 -))) 622 622 623 623 ((( 624 -((( 625 625 (% style="color:red" %)**Note:** 626 626 ))) 627 -))) 628 628 629 629 ((( 630 -((( 631 631 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. 632 632 ))) 633 -))) 634 634 635 635 ((( 636 -((( 637 637 **Example:** 638 638 ))) 639 -))) 640 640 641 641 ((( 642 -((( 643 643 (% style="color:red" %)AT+COMMAND1=11 01 1E D0,0 644 644 ))) 645 -))) 646 646 647 647 ((( 648 -((( 649 649 (% style="color:red" %)AT+SEARCH1=1,1E 56 34 650 650 ))) 651 -))) 652 652 653 653 ((( 654 -((( 655 655 (% style="color:red" %)AT+DATACUT1=0,2,1~~5 656 656 ))) 657 -))) 658 658 659 659 ((( 660 -((( 661 661 (% style="color:red" %)Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 662 662 ))) 663 -))) 664 664 665 665 ((( 666 -((( 667 667 (% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49 668 668 ))) 669 -))) 670 670 671 671 ((( 672 -((( 673 673 (% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36 674 674 ))) 675 -))) 676 676 677 -((( 678 678 [[image:1653271763403-806.png]] 679 -))) 680 680 681 681 682 682 === 3.3.4 Compose the uplink payload ===