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

From version 40.46
edited by Xiaoling
on 2022/06/06 10:31
Change comment: There is no comment for this version
To version 40.55
edited by Xiaoling
on 2022/06/06 10:52
Change comment: There is no comment for this version

Summary

Details

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