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

From version 40.54
edited by Xiaoling
on 2022/06/06 10:51
Change comment: There is no comment for this version
To version 41.29
edited by Xiaoling
on 2022/06/06 11:12
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -501,102 +501,186 @@
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 +(((
513 +
514 +)))
515 +
516 +(((
508 508  **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx.
518 +)))
509 509  
510 510  (% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:500px" %)
511 511  |(% style="width:577px" %)(((
522 +(((
512 512  **AT+SEARCHx=aa,xx xx xx xx xx**
524 +)))
513 513  
514 -* **aa: 1: prefix match mode; 2: prefix and suffix match mode**
515 -* **xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix**
526 +* (((
527 +**aa: 1: prefix match mode; 2: prefix and suffix match mode**
516 516  )))
529 +* (((
530 +**xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix**
531 +)))
532 +)))
517 517  
534 +(((
518 518  **Examples:**
536 +)))
519 519  
538 +(((
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
540 +)))
521 521  
542 +(((
522 522  If we set AT+SEARCH1=1,1E 56 34.      (max 5 bytes for prefix)
544 +)))
523 523  
546 +(((
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**
548 +)))
525 525  
550 +(((
526 526  [[image:1653271044481-711.png]]
552 +)))
527 527  
554 +(((
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
556 +)))
529 529  
558 +(((
530 530  If we set AT+SEARCH1=2, 1E 56 34+31 00 49
560 +)))
531 531  
562 +(((
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**
564 +)))
533 533  
566 +(((
534 534  [[image:1653271276735-972.png]]
568 +)))
535 535  
570 +(((
536 536  **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes.
572 +)))
537 537  
538 538  (% style="background-color:#4f81bd; color:white; width:510px" %)
539 539  |(% style="width:726px" %)(((
576 +(((
540 540  **AT+DATACUTx=a,b,c**
578 +)))
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.  **
580 +* (((
581 +**a: length for the return of AT+COMMAND**
545 545  )))
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 +)))
546 546  
591 +(((
547 547  **Examples:**
593 +)))
548 548  
549 -* Grab bytes:
595 +* (((
596 +Grab bytes:
597 +)))
550 550  
599 +(((
551 551  [[image:1653271581490-837.png||height="313" width="722"]]
601 +)))
552 552  
603 +(((
604 +
605 +)))
553 553  
554 -* Grab a section.
607 +* (((
608 +Grab a section.
609 +)))
555 555  
611 +(((
556 556  [[image:1653271648378-342.png||height="326" width="720"]]
613 +)))
557 557  
615 +(((
616 +
617 +)))
558 558  
559 -* Grab different sections.
619 +* (((
620 +Grab different sections.
621 +)))
560 560  
623 +(((
561 561  [[image:1653271657255-576.png||height="305" width="730"]]
625 +)))
562 562  
563 563  (((
628 +(((
564 564  (% style="color:red" %)**Note:**
565 565  )))
631 +)))
566 566  
567 567  (((
634 +(((
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  )))
637 +)))
570 570  
571 571  (((
640 +(((
572 572  **Example:**
573 573  )))
643 +)))
574 574  
575 575  (((
646 +(((
576 576  (% style="color:red" %)AT+COMMAND1=11 01 1E D0,0
577 577  )))
649 +)))
578 578  
579 579  (((
652 +(((
580 580  (% style="color:red" %)AT+SEARCH1=1,1E 56 34
581 581  )))
655 +)))
582 582  
583 583  (((
658 +(((
584 584  (% style="color:red" %)AT+DATACUT1=0,2,1~~5
585 585  )))
661 +)))
586 586  
587 587  (((
664 +(((
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  )))
667 +)))
590 590  
591 591  (((
670 +(((
592 592  (% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49
593 593  )))
673 +)))
594 594  
595 595  (((
676 +(((
596 596  (% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36
597 597  )))
679 +)))
598 598  
681 +(((
599 599  [[image:1653271763403-806.png]]
683 +)))
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 -)))
830 +[[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  (((
... ... @@ -820,14 +820,24 @@
820 820  
821 821  == 3.5 Configure RS485-BL via AT or Downlink ==
822 822  
889 +(((
823 823  User can configure RS485-BL via AT Commands or LoRaWAN Downlink Commands
891 +)))
824 824  
893 +(((
825 825  There are two kinds of Commands:
895 +)))
826 826  
827 -* (% 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 +)))
828 828  
829 -* (% 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 +)))
830 830  
905 +
906 +
831 831  === 3.5.1 Common Commands: ===
832 832  
833 833  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]]
... ... @@ -836,6 +836,7 @@
836 836  === 3.5.2 Sensor related commands: ===
837 837  
838 838  
915 +
839 839  ==== **Choose Device Type (RS485 or TTL)** ====
840 840  
841 841  RS485-BL can connect to either RS485 sensors or TTL sensor. User need to specify what type of sensor need to connect.
... ... @@ -859,6 +859,7 @@
859 859  
860 860  
861 861  
939 +
862 862  ==== **RS485 Debug Command (AT+CFGDEV)** ====
863 863  
864 864  This command is used to configure the RS485 or TTL sensors; they won’t be used during sampling.
... ... @@ -898,7 +898,9 @@
898 898  
899 899  (% style="color:#037691" %)**A8 01 06 0A 05 00 04 00 00 00**(%%): to deactivate the RS485 Alarm
900 900  
979 +(((
901 901  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 +)))
902 902  
903 903  
904 904  **Example 2:**
... ... @@ -910,6 +910,7 @@
910 910  
911 911  
912 912  
993 +
913 913  ==== **Set Payload version** ====
914 914  
915 915  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.
... ... @@ -930,6 +930,7 @@
930 930  
931 931  
932 932  
1014 +
933 933  ==== **Set RS485 Sampling Commands** ====
934 934  
935 935  AT+COMMANDx, AT+DATACUTx and AT+SEARCHx
... ... @@ -991,6 +991,7 @@
991 991  
992 992  
993 993  
1076 +
994 994  ==== **Fast command to handle MODBUS device** ====
995 995  
996 996  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]].
... ... @@ -1024,6 +1024,7 @@
1024 1024  
1025 1025  
1026 1026  
1110 +
1027 1027  ==== **RS485 command timeout** ====
1028 1028  
1029 1029  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.
... ... @@ -1055,6 +1055,7 @@
1055 1055  
1056 1056  
1057 1057  
1142 +
1058 1058  ==== **Uplink payload mode** ====
1059 1059  
1060 1060  Define to use one uplink or multiple uplinks for the sampling.
... ... @@ -1101,7 +1101,9 @@
1101 1101  
1102 1102  * **AT Command:**
1103 1103  
1189 +(((
1104 1104  (% 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 +)))
1105 1105  
1106 1106  Example screen shot after clear all RS485 commands. 
1107 1107  
... ... @@ -1117,6 +1117,7 @@
1117 1117  
1118 1118  
1119 1119  
1207 +
1120 1120  ==== **Set Serial Communication Parameters** ====
1121 1121  
1122 1122  Set the Rs485 serial communication parameters:
... ... @@ -1160,6 +1160,7 @@
1160 1160  
1161 1161  
1162 1162  
1251 +
1163 1163  ==== **Control output power duration** ====
1164 1164  
1165 1165  User can set the output power duration before each sampling.
... ... @@ -1183,44 +1183,83 @@
1183 1183  
1184 1184  == 3.6 Buttons ==
1185 1185  
1186 -(% border="1" style="background-color:#ffffcc; color:green; width:233px" %)
1275 +(% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:233px" %)
1187 1187  |=(% style="width: 89px;" %)**Button**|=(% style="width: 141px;" %)**Feature**
1188 1188  |(% style="width:89px" %)**RST**|(% style="width:141px" %)Reboot RS485-BL
1189 1189  
1279 +
1280 +
1190 1190  == 3.7 +3V3 Output ==
1191 1191  
1283 +(((
1192 1192  RS485-BL has a Controllable +3V3 output, user can use this output to power external sensor.
1285 +)))
1193 1193  
1287 +(((
1194 1194  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 +)))
1195 1195  
1291 +(((
1196 1196  The +3V3 output time can be controlled by AT Command.
1293 +)))
1197 1197  
1295 +(((
1296 +
1297 +)))
1198 1198  
1299 +(((
1199 1199  (% style="color:#037691" %)**AT+3V3T=1000**
1301 +)))
1200 1200  
1303 +(((
1304 +
1305 +)))
1201 1201  
1307 +(((
1202 1202  Means set +3v3 valid time to have 1000ms. So, the real +3v3 output will actually have 1000ms + sampling time for other sensors.
1309 +)))
1203 1203  
1311 +(((
1204 1204  By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time
1313 +)))
1205 1205  
1206 1206  
1207 1207  == 3.8 +5V Output ==
1208 1208  
1318 +(((
1209 1209  RS485-BL has a Controllable +5V output, user can use this output to power external sensor.
1320 +)))
1210 1210  
1322 +(((
1211 1211  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 +)))
1212 1212  
1326 +(((
1213 1213  The 5V output time can be controlled by AT Command.
1328 +)))
1214 1214  
1330 +(((
1331 +
1332 +)))
1215 1215  
1334 +(((
1216 1216  (% style="color:#037691" %)**AT+5VT=1000**
1336 +)))
1217 1217  
1338 +(((
1339 +
1340 +)))
1218 1218  
1342 +(((
1219 1219  Means set 5V valid time to have 1000ms. So, the real 5V output will actually have 1000ms + sampling time for other sensors.
1344 +)))
1220 1220  
1346 +(((
1221 1221  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 +)))
1222 1222  
1223 1223  
1351 +
1224 1224  == 3.9 LEDs ==
1225 1225  
1226 1226  (% border="1" style="background-color:#ffffcc; color:green; width:332px" %)
... ... @@ -1227,6 +1227,8 @@
1227 1227  |=**LEDs**|=(% style="width: 274px;" %)**Feature**
1228 1228  |**LED1**|(% style="width:274px" %)Blink when device transmit a packet.
1229 1229  
1358 +
1359 +
1230 1230  == 3.10 Switch Jumper ==
1231 1231  
1232 1232  (% border="1" style="background-color:#ffffcc; color:green; width:515px" %)
... ... @@ -1242,9 +1242,13 @@
1242 1242  3.3v position: set to compatible with 3.3v I/O.,
1243 1243  )))
1244 1244  
1375 +(((
1245 1245  **+3.3V**: is always ON
1377 +)))
1246 1246  
1379 +(((
1247 1247  **+5V**: Only open before every sampling. The time is by default, it is AT+5VT=0.  Max open time. 5000 ms.
1381 +)))
1248 1248  
1249 1249  
1250 1250  = 4. Case Study =
... ... @@ -1256,17 +1256,23 @@
1256 1256  
1257 1257  == 5.1 Access AT Command ==
1258 1258  
1393 +(((
1259 1259  RS485-BL supports AT Command set. User can use a USB to TTL adapter plus the 3.5mm Program Cable to connect to RS485-BL to use AT command, as below.
1395 +)))
1260 1260  
1261 1261  [[image:1654135840598-282.png]]
1262 1262  
1263 1263  
1400 +(((
1264 1264  In PC, User needs to set (% style="color:blue" %)**serial tool**(%%)(such as [[putty>>url:https://www.chiark.greenend.org.uk/~~sgtatham/putty/latest.html]], SecureCRT) baud rate to (% style="color:green" %)**9600**(%%) to access to access serial console of RS485-BL. The default password is 123456. Below is the output for reference:
1402 +)))
1265 1265  
1266 1266  [[image:1654136105500-922.png]]
1267 1267  
1268 1268  
1407 +(((
1269 1269  More detail AT Command manual can be found at [[AT Command Manual>>||anchor="H3.5ConfigureRS485-BLviaATorDownlink"]]
1409 +)))
1270 1270  
1271 1271  
1272 1272  == 5.2 Common AT Command Sequence ==
... ... @@ -1291,7 +1291,9 @@
1291 1291  )))
1292 1292  
1293 1293  
1434 +(((
1294 1294  If device already joined network:
1436 +)))
1295 1295  
1296 1296  (% class="box infomessage" %)
1297 1297  (((
... ... @@ -1330,10 +1330,12 @@
1330 1330  
1331 1331  (% style="color:red" %)**Note:**
1332 1332  
1475 +(((
1333 1333  (% style="color:red" %)1. Make sure the device is set to ABP mode in the IoT Server.
1334 1334  2. Make sure the LG01/02 gateway RX frequency is exactly the same as AT+CHS setting.
1335 1335  3. Make sure SF / bandwidth setting in LG01/LG02 match the settings of AT+DR. refer [[this link>>url:http://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/&file=LoRaWAN%201.0.3%20Regional%20Parameters.xlsx]] to see what DR means.
1336 1336  4. The command AT+RX2FQ and AT+RX2DR is to let downlink work. to set the correct parameters, user can check the actually downlink parameters to be used. As below. Which shows the RX2FQ should use 868400000 and RX2DR should be 5
1480 +)))
1337 1337  
1338 1338  [[image:1654136435598-589.png]]
1339 1339  
... ... @@ -1342,13 +1342,23 @@
1342 1342  
1343 1343  == 6.1 How to upgrade the image? ==
1344 1344  
1489 +(((
1345 1345  The RS485-BL LoRaWAN Controller is shipped with a 3.5mm cable, the cable is used to upload image to RS485-BL to:
1491 +)))
1346 1346  
1347 -* Support new features
1348 -* For bug fix
1349 -* Change LoRaWAN bands.
1493 +* (((
1494 +Support new features
1495 +)))
1496 +* (((
1497 +For bug fix
1498 +)))
1499 +* (((
1500 +Change LoRaWAN bands.
1501 +)))
1350 1350  
1503 +(((
1351 1351  Below shows the hardware connection for how to upload an image to RS485-BL:
1505 +)))
1352 1352  
1353 1353  [[image:1654136646995-976.png]]
1354 1354  
image-20220606105412-1.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +13.9 KB
Content