Last modified by Xiaoling on 2025/04/23 15:57

From version 40.47
edited by Xiaoling
on 2022/06/06 10:32
Change comment: There is no comment for this version
To version 41.3
edited by Xiaoling
on 2022/06/06 10:54
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -394,19 +394,20 @@
394 394  When user issue an (% style="color:#4f81bd" %)**AT+CFGDEV**(%%) command, Each (% style="color:#4f81bd" %)**AT+CFGDEV**(%%) equals to send a command to the RS485 or TTL sensors. This command will only run when user input it and won’t run during each sampling.
395 395  )))
396 396  
397 -(% border="1" style="background-color:#ffffcc; color:green; width:806px" %)
398 -|**AT Commands**|(% style="width:418px" %)**Description**|(% style="width:256px" %)**Example**
399 -|AT+CFGDEV|(% style="width:418px" %)(((
397 +(% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:510px" %)
398 +|=(% style="width: 120px;" %)**AT Commands**|=(% style="width: 190px;" %)**Description**|=(% style="width: 190px;" %)**Example**
399 +|AT+CFGDEV|(% style="width:120px" %)(((
400 400  This command is used to configure the RS485/TTL devices; they won’t be used during sampling.
401 401  
402 402  AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,
403 403  
404 404  mm: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command
405 -)))|(% style="width:256px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m
405 +)))|(% style="width:190px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m
406 406  
407 407  Detail of AT+CFGDEV command see [[AT+CFGDEV detail>>||anchor="HRS485DebugCommand28AT2BCFGDEV29"]].
408 408  
409 409  
410 +
410 410  === 3.3.3 Configure read commands for each sampling ===
411 411  
412 412  (((
... ... @@ -473,117 +473,209 @@
473 473  After we got the valid value from each RS485 commands, we need to combine them together with the command **AT+DATAUP**.
474 474  )))
475 475  
477 +(((
476 476  **Examples:**
479 +)))
477 477  
481 +(((
478 478  Below are examples for the how above AT Commands works.
483 +)))
479 479  
485 +(((
480 480  **AT+COMMANDx : **This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is:
487 +)))
481 481  
482 -(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:501px" %)
489 +(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %)
483 483  |(% style="width:498px" %)(((
491 +(((
484 484  **AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m**
493 +)))
485 485  
495 +(((
486 486  **xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent**
497 +)))
487 487  
499 +(((
488 488  **m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command**
489 489  )))
502 +)))
490 490  
504 +(((
491 491  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 +)))
492 492  
508 +(((
493 493  In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same.
510 +)))
494 494  
512 +(((
495 495  **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx.
514 +)))
496 496  
497 -(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:580px" %)
516 +(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %)
498 498  |(% style="width:577px" %)(((
518 +(((
499 499  **AT+SEARCHx=aa,xx xx xx xx xx**
520 +)))
500 500  
501 -* **aa: 1: prefix match mode; 2: prefix and suffix match mode**
502 -* **xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix**
522 +* (((
523 +**aa: 1: prefix match mode; 2: prefix and suffix match mode**
503 503  )))
525 +* (((
526 +**xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix**
527 +)))
528 +)))
504 504  
530 +(((
505 505  **Examples:**
532 +)))
506 506  
534 +(((
507 507  1)For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
536 +)))
508 508  
538 +(((
509 509  If we set AT+SEARCH1=1,1E 56 34.      (max 5 bytes for prefix)
540 +)))
510 510  
542 +(((
511 511  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 +)))
512 512  
546 +(((
513 513  [[image:1653271044481-711.png]]
548 +)))
514 514  
550 +(((
515 515  2)For a return string from AT+COMMAND1:  16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
552 +)))
516 516  
554 +(((
517 517  If we set AT+SEARCH1=2, 1E 56 34+31 00 49
556 +)))
518 518  
558 +(((
519 519  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 +)))
520 520  
562 +(((
521 521  [[image:1653271276735-972.png]]
564 +)))
522 522  
566 +(((
523 523  **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes.
568 +)))
524 524  
525 -(% style="background-color:#4f81bd; color:white; width:729px" %)
570 +(% style="background-color:#4f81bd; color:white; width:510px" %)
526 526  |(% style="width:726px" %)(((
572 +(((
527 527  **AT+DATACUTx=a,b,c**
574 +)))
528 528  
529 -* **a: length for the return of AT+COMMAND**
530 -* **b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.**
531 -* **c: define the position for valid value.  **
576 +* (((
577 +**a: length for the return of AT+COMMAND**
532 532  )))
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 +)))
533 533  
587 +(((
534 534  **Examples:**
589 +)))
535 535  
536 -* Grab bytes:
591 +* (((
592 +Grab bytes:
593 +)))
537 537  
595 +(((
538 538  [[image:1653271581490-837.png||height="313" width="722"]]
597 +)))
539 539  
599 +(((
600 +
601 +)))
540 540  
541 -* Grab a section.
603 +* (((
604 +Grab a section.
605 +)))
542 542  
607 +(((
543 543  [[image:1653271648378-342.png||height="326" width="720"]]
609 +)))
544 544  
611 +(((
612 +
613 +)))
545 545  
546 -* Grab different sections.
615 +* (((
616 +Grab different sections.
617 +)))
547 547  
619 +(((
548 548  [[image:1653271657255-576.png||height="305" width="730"]]
621 +)))
549 549  
550 550  (((
624 +(((
551 551  (% style="color:red" %)**Note:**
552 552  )))
627 +)))
553 553  
554 554  (((
630 +(((
555 555  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.
556 556  )))
633 +)))
557 557  
558 558  (((
636 +(((
559 559  **Example:**
560 560  )))
639 +)))
561 561  
562 562  (((
642 +(((
563 563  (% style="color:red" %)AT+COMMAND1=11 01 1E D0,0
564 564  )))
645 +)))
565 565  
566 566  (((
648 +(((
567 567  (% style="color:red" %)AT+SEARCH1=1,1E 56 34
568 568  )))
651 +)))
569 569  
570 570  (((
654 +(((
571 571  (% style="color:red" %)AT+DATACUT1=0,2,1~~5
572 572  )))
657 +)))
573 573  
574 574  (((
660 +(((
575 575  (% style="color:red" %)Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
576 576  )))
663 +)))
577 577  
578 578  (((
666 +(((
579 579  (% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49
580 580  )))
669 +)))
581 581  
582 582  (((
672 +(((
583 583  (% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36
584 584  )))
675 +)))
585 585  
677 +(((
586 586  [[image:1653271763403-806.png]]
679 +)))
587 587  
588 588  
589 589  === 3.3.4 Compose the uplink payload ===
... ... @@ -590,10 +590,14 @@
590 590  
591 591  (((
592 592  Through AT+COMMANDx and AT+DATACUTx we got valid value from each RS485 commands, Assume these valid value are RETURN1, RETURN2, .., to RETURNx. The next step is how to compose the LoRa Uplink Payload by these RETURNs. The command is **AT+DATAUP.**
686 +
687 +
593 593  )))
594 594  
595 595  (((
596 596  (% style="color:#037691" %)**Examples: AT+DATAUP=0**
692 +
693 +
597 597  )))
598 598  
599 599  (((
... ... @@ -726,26 +726,8 @@
726 726  
727 727  == 3.4 Uplink Payload ==
728 728  
729 -(% border="1" style="background-color:#4f81bd; color:white; width:850px" %)
730 -|**Size(bytes)**|(% style="width:130px" %)**2**|(% style="width:93px" %)**1**|(% style="width:509px" %)**Length depends on the return from the commands**
731 -|Value|(% style="width:130px" %)(((
732 -(((
733 -Battery(mV)
734 -)))
826 +[[image:image-20220606105412-1.png]]
735 735  
736 -(((
737 -&
738 -)))
739 -
740 -(((
741 -Interrupt _Flag
742 -)))
743 -)))|(% style="width:93px" %)(((
744 -PAYLOAD_VER
745 -
746 -
747 -)))|(% 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.
748 -
749 749  Below is the decoder for the first 3 bytes. The rest bytes are dynamic depends on different RS485 sensors.
750 750  
751 751  (((
image-20220606105412-1.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +13.9 KB
Content