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
-
... ... @@ -283,7 +283,7 @@ 283 283 ))) 284 284 285 285 (% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:510px" %) 286 -|=(% style="width: 12 5px;" %)(((286 +|=(% style="width: 120px;" %)((( 287 287 ((( 288 288 **AT Commands** 289 289 ))) ... ... @@ -296,7 +296,7 @@ 296 296 **Example** 297 297 ))) 298 298 ))) 299 -|(% style="width:12 5px" %)(((299 +|(% style="width:120px" %)((( 300 300 ((( 301 301 AT+BAUDR 302 302 ))) ... ... @@ -317,7 +317,7 @@ 317 317 ))) 318 318 ))) 319 319 ))) 320 -|(% style="width:12 5px" %)(((320 +|(% style="width:120px" %)((( 321 321 ((( 322 322 AT+PARITY 323 323 ))) ... ... @@ -346,7 +346,7 @@ 346 346 ))) 347 347 ))) 348 348 ))) 349 -|(% style="width:12 5px" %)(((349 +|(% style="width:120px" %)((( 350 350 ((( 351 351 AT+STOPBIT 352 352 ))) ... ... @@ -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,m405 +)))|(% 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,213 @@ 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:50 1px" %)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 +((( 513 + 514 +))) 515 + 516 +((( 493 493 **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx. 518 +))) 494 494 495 -(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:5 80px" %)520 +(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %) 496 496 |(% style="width:577px" %)((( 522 +((( 497 497 **AT+SEARCHx=aa,xx xx xx xx xx** 524 +))) 498 498 499 -* **aa: 1: prefix match mode; 2: prefix and suffix match mode**500 -* *xxxxxxxx xx:matchstring. Max 5 bytesforprefix and5 bytesfor suffix**526 +* ((( 527 +**aa: 1: prefix match mode; 2: prefix and suffix match mode** 501 501 ))) 529 +* ((( 530 +**xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix** 531 +))) 532 +))) 502 502 534 +((( 503 503 **Examples:** 536 +))) 504 504 538 +((( 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 540 +))) 506 506 542 +((( 507 507 If we set AT+SEARCH1=1,1E 56 34. (max 5 bytes for prefix) 544 +))) 508 508 546 +((( 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** 548 +))) 510 510 550 +((( 511 511 [[image:1653271044481-711.png]] 552 +))) 512 512 554 +((( 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 556 +))) 514 514 558 +((( 515 515 If we set AT+SEARCH1=2, 1E 56 34+31 00 49 560 +))) 516 516 562 +((( 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** 564 +))) 518 518 566 +((( 519 519 [[image:1653271276735-972.png]] 568 +))) 520 520 570 +((( 521 521 **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes. 572 +))) 522 522 523 -(% style="background-color:#4f81bd; color:white; width: 729px" %)574 +(% style="background-color:#4f81bd; color:white; width:510px" %) 524 524 |(% style="width:726px" %)((( 576 +((( 525 525 **AT+DATACUTx=a,b,c** 578 +))) 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. ** 580 +* ((( 581 +**a: length for the return of AT+COMMAND** 530 530 ))) 583 +* ((( 584 +**b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.** 585 +))) 586 +* ((( 587 +**c: define the position for valid value. ** 588 +))) 589 +))) 531 531 591 +((( 532 532 **Examples:** 593 +))) 533 533 534 -* Grab bytes: 595 +* ((( 596 +Grab bytes: 597 +))) 535 535 599 +((( 536 536 [[image:1653271581490-837.png||height="313" width="722"]] 601 +))) 537 537 603 +((( 604 + 605 +))) 538 538 539 -* Grab a section. 607 +* ((( 608 +Grab a section. 609 +))) 540 540 611 +((( 541 541 [[image:1653271648378-342.png||height="326" width="720"]] 613 +))) 542 542 615 +((( 616 + 617 +))) 543 543 544 -* Grab different sections. 619 +* ((( 620 +Grab different sections. 621 +))) 545 545 623 +((( 546 546 [[image:1653271657255-576.png||height="305" width="730"]] 625 +))) 547 547 548 548 ((( 628 +((( 549 549 (% style="color:red" %)**Note:** 550 550 ))) 631 +))) 551 551 552 552 ((( 634 +((( 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 ))) 637 +))) 555 555 556 556 ((( 640 +((( 557 557 **Example:** 558 558 ))) 643 +))) 559 559 560 560 ((( 646 +((( 561 561 (% style="color:red" %)AT+COMMAND1=11 01 1E D0,0 562 562 ))) 649 +))) 563 563 564 564 ((( 652 +((( 565 565 (% style="color:red" %)AT+SEARCH1=1,1E 56 34 566 566 ))) 655 +))) 567 567 568 568 ((( 658 +((( 569 569 (% style="color:red" %)AT+DATACUT1=0,2,1~~5 570 570 ))) 661 +))) 571 571 572 572 ((( 664 +((( 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 ))) 667 +))) 575 575 576 576 ((( 670 +((( 577 577 (% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49 578 578 ))) 673 +))) 579 579 580 580 ((( 676 +((( 581 581 (% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36 582 582 ))) 679 +))) 583 583 681 +((( 584 584 [[image:1653271763403-806.png]] 683 +))) 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.** 690 + 691 + 591 591 ))) 592 592 593 593 ((( 594 594 (% style="color:#037691" %)**Examples: AT+DATAUP=0** 696 + 697 + 595 595 ))) 596 596 597 597 ((( ... ... @@ -724,26 +724,8 @@ 724 724 725 725 == 3.4 Uplink Payload == 726 726 727 -(% border="1" style="background-color:#4f81bd; color:white; width:850px" %) 728 -|**Size(bytes)**|(% style="width:130px" %)**2**|(% style="width:93px" %)**1**|(% style="width:509px" %)**Length depends on the return from the commands** 729 -|Value|(% style="width:130px" %)((( 730 -((( 731 -Battery(mV) 732 -))) 830 +[[image:image-20220606105412-1.png]] 733 733 734 -((( 735 -& 736 -))) 737 - 738 -((( 739 -Interrupt _Flag 740 -))) 741 -)))|(% style="width:93px" %)((( 742 -PAYLOAD_VER 743 - 744 - 745 -)))|(% 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. 746 - 747 747 Below is the decoder for the first 3 bytes. The rest bytes are dynamic depends on different RS485 sensors. 748 748 749 749 ((( ... ... @@ -801,14 +801,24 @@ 801 801 802 802 == 3.5 Configure RS485-BL via AT or Downlink == 803 803 889 +((( 804 804 User can configure RS485-BL via AT Commands or LoRaWAN Downlink Commands 891 +))) 805 805 893 +((( 806 806 There are two kinds of Commands: 895 +))) 807 807 808 -* (% style="color:#4f81bd" %)**Common Commands**(%%): They should be available for each sensor, such as: change uplink interval, reset device. For firmware v1.3, user can find what common commands it supports: [[AT Commands and Downlink Command>>doc:Main.End Device AT Commands and Downlink Command.WebHome]] 897 +* ((( 898 +(% style="color:#4f81bd" %)**Common Commands**(%%): They should be available for each sensor, such as: change uplink interval, reset device. For firmware v1.3, user can find what common commands it supports: [[AT Commands and Downlink Command>>doc:Main.End Device AT Commands and Downlink Command.WebHome]] 899 +))) 809 809 810 -* (% style="color:#4f81bd" %)**Sensor Related Commands**(%%): These commands are special designed for RS485-BL. User can see these commands below: 901 +* ((( 902 +(% style="color:#4f81bd" %)**Sensor Related Commands**(%%): These commands are special designed for RS485-BL. User can see these commands below: 903 +))) 811 811 905 + 906 + 812 812 === 3.5.1 Common Commands: === 813 813 814 814 They should be available for each of Dragino Sensors, such as: change uplink interval, reset device. For firmware v1.3, user can find what common commands it supports: [[End Device AT Commands and Downlink Command>>doc:Main.End Device AT Commands and Downlink Command.WebHome]] ... ... @@ -817,6 +817,7 @@ 817 817 === 3.5.2 Sensor related commands: === 818 818 819 819 915 + 820 820 ==== **Choose Device Type (RS485 or TTL)** ==== 821 821 822 822 RS485-BL can connect to either RS485 sensors or TTL sensor. User need to specify what type of sensor need to connect. ... ... @@ -840,6 +840,7 @@ 840 840 841 841 842 842 939 + 843 843 ==== **RS485 Debug Command (AT+CFGDEV)** ==== 844 844 845 845 This command is used to configure the RS485 or TTL sensors; they won’t be used during sampling. ... ... @@ -879,7 +879,9 @@ 879 879 880 880 (% style="color:#037691" %)**A8 01 06 0A 05 00 04 00 00 00**(%%): to deactivate the RS485 Alarm 881 881 979 +((( 882 882 A8 is type code and 01 means add CRC-16/MODBUS at the end, the 3^^rd^^ byte is 06, means the next 6 bytes are the command to be sent to the RS485 network, the final byte 00 means this command don’t need to acquire output. 981 +))) 883 883 884 884 885 885 **Example 2:** ... ... @@ -891,6 +891,7 @@ 891 891 892 892 893 893 993 + 894 894 ==== **Set Payload version** ==== 895 895 896 896 This is the first byte of the uplink payload. RS485-BL can connect to different sensors. User can set the PAYVER field to tell server how to decode the current payload. ... ... @@ -911,6 +911,7 @@ 911 911 912 912 913 913 1014 + 914 914 ==== **Set RS485 Sampling Commands** ==== 915 915 916 916 AT+COMMANDx, AT+DATACUTx and AT+SEARCHx ... ... @@ -972,6 +972,7 @@ 972 972 973 973 974 974 1076 + 975 975 ==== **Fast command to handle MODBUS device** ==== 976 976 977 977 AT+MBFUN is valid since v1.3 firmware version. The command is for fast configure to read Modbus devices. It is only valid for the devices which follow the [[MODBUS-RTU protocol>>url:https://www.modbustools.com/modbus.html]]. ... ... @@ -1005,6 +1005,7 @@ 1005 1005 1006 1006 1007 1007 1110 + 1008 1008 ==== **RS485 command timeout** ==== 1009 1009 1010 1010 Some Modbus device has slow action to send replies. This command is used to configure the RS485-BL to use longer time to wait for their action. ... ... @@ -1036,6 +1036,7 @@ 1036 1036 1037 1037 1038 1038 1142 + 1039 1039 ==== **Uplink payload mode** ==== 1040 1040 1041 1041 Define to use one uplink or multiple uplinks for the sampling. ... ... @@ -1082,7 +1082,9 @@ 1082 1082 1083 1083 * **AT Command:** 1084 1084 1189 +((( 1085 1085 (% style="color:#037691" %)**AT+CMDEAR=mm,nn** (%%) mm: start position of erase ,nn: stop position of erase Etc. AT+CMDEAR=1,10 means erase AT+COMMAND1/AT+DATACUT1 to AT+COMMAND10/AT+DATACUT10 1191 +))) 1086 1086 1087 1087 Example screen shot after clear all RS485 commands. 1088 1088 ... ... @@ -1098,6 +1098,7 @@ 1098 1098 1099 1099 1100 1100 1207 + 1101 1101 ==== **Set Serial Communication Parameters** ==== 1102 1102 1103 1103 Set the Rs485 serial communication parameters: ... ... @@ -1141,6 +1141,7 @@ 1141 1141 1142 1142 1143 1143 1251 + 1144 1144 ==== **Control output power duration** ==== 1145 1145 1146 1146 User can set the output power duration before each sampling. ... ... @@ -1164,42 +1164,80 @@ 1164 1164 1165 1165 == 3.6 Buttons == 1166 1166 1167 -(% border="1" style="background-color:#ffffcc; color:green; width:233px" %) 1275 +(% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:233px" %) 1168 1168 |=(% style="width: 89px;" %)**Button**|=(% style="width: 141px;" %)**Feature** 1169 1169 |(% style="width:89px" %)**RST**|(% style="width:141px" %)Reboot RS485-BL 1170 1170 1279 + 1280 + 1171 1171 == 3.7 +3V3 Output == 1172 1172 1283 +((( 1173 1173 RS485-BL has a Controllable +3V3 output, user can use this output to power external sensor. 1285 +))) 1174 1174 1287 +((( 1175 1175 The +3V3 output will be valid for every sampling. RS485-BL will enable +3V3 output before all sampling and disable the +3V3 after all sampling. 1289 +))) 1176 1176 1291 +((( 1177 1177 The +3V3 output time can be controlled by AT Command. 1293 +))) 1178 1178 1295 +((( 1296 + 1297 +))) 1179 1179 1299 +((( 1180 1180 (% style="color:#037691" %)**AT+3V3T=1000** 1301 +))) 1181 1181 1303 +((( 1304 + 1305 +))) 1182 1182 1307 +((( 1183 1183 Means set +3v3 valid time to have 1000ms. So, the real +3v3 output will actually have 1000ms + sampling time for other sensors. 1309 +))) 1184 1184 1311 +((( 1185 1185 By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time 1313 +))) 1186 1186 1187 1187 1188 1188 == 3.8 +5V Output == 1189 1189 1318 +((( 1190 1190 RS485-BL has a Controllable +5V output, user can use this output to power external sensor. 1320 +))) 1191 1191 1322 +((( 1192 1192 The +5V output will be valid for every sampling. RS485-BL will enable +5V output before all sampling and disable the +5v after all sampling. 1324 +))) 1193 1193 1326 +((( 1194 1194 The 5V output time can be controlled by AT Command. 1328 +))) 1195 1195 1330 +((( 1331 + 1332 +))) 1196 1196 1334 +((( 1197 1197 (% style="color:#037691" %)**AT+5VT=1000** 1336 +))) 1198 1198 1338 +((( 1339 + 1340 +))) 1199 1199 1342 +((( 1200 1200 Means set 5V valid time to have 1000ms. So, the real 5V output will actually have 1000ms + sampling time for other sensors. 1344 +))) 1201 1201 1346 +((( 1202 1202 By default, the AT+5VT=0. If the external sensor which require 5v and require more time to get stable state, user can use this command to increase the power ON duration for this sensor. 1348 +))) 1203 1203 1204 1204 1205 1205 == 3.9 LEDs == ... ... @@ -1208,6 +1208,8 @@ 1208 1208 |=**LEDs**|=(% style="width: 274px;" %)**Feature** 1209 1209 |**LED1**|(% style="width:274px" %)Blink when device transmit a packet. 1210 1210 1357 + 1358 + 1211 1211 == 3.10 Switch Jumper == 1212 1212 1213 1213 (% border="1" style="background-color:#ffffcc; color:green; width:515px" %)
- image-20220606105412-1.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +13.9 KB - Content