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, 0 added, 9 removed)
Details
- Page properties
-
- Content
-
... ... @@ -60,7 +60,7 @@ 60 60 * Power Consumption (exclude RS485 device): 61 61 ** Idle: 6uA@3.3v 62 62 63 -* 63 +* 64 64 ** 20dB Transmit: 130mA@3.3v 65 65 66 66 **Interface for Model:** ... ... @@ -303,102 +303,88 @@ 303 303 ))) 304 304 ))) 305 305 306 -=== 3.3.2 Configure sensors === 307 307 308 -((( 309 -Some sensors might need to configure before normal operation. User can configure such sensor via PC or through RS485-BL AT Commands (% style="color:#4f81bd" %)**AT+CFGDEV**. 310 -))) 311 311 312 -((( 313 -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. 314 -))) 315 315 316 -(% border="1" style="background-color:#ffffcc; color:green; width:806px" %) 317 -|**AT Commands**|(% style="width:418px" %)**Description**|(% style="width:256px" %)**Example** 318 -|AT+CFGDEV|(% style="width:418px" %)((( 309 +1. 310 +11. 311 +111. Configure sensors 312 + 313 +Some sensors might need to configure before normal operation. User can configure such sensor via PC or through RS485-BL AT Commands AT+CFGDEV. 314 + 315 + 316 +When user issue an AT+CFGDEV command, Each 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. 317 + 318 +|**AT Commands**|**Description**|**Example** 319 +|AT+CFGDEV|((( 319 319 This command is used to configure the RS485/TTL devices; they won’t be used during sampling. 320 320 321 -AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx, 322 +AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m 322 322 323 -m m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command324 -)))| (% style="width:256px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m324 +m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command 325 +)))|AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m 325 325 326 326 Detail of AT+CFGDEV command see [[AT+CFGDEV detail>>path:#AT_CFGDEV]]. 327 327 328 -=== 3.3.3 Configure read commands for each sampling === 329 329 330 -((( 330 + 331 + 332 + 333 +1. 334 +11. 335 +111. Configure read commands for each sampling 336 + 331 331 RS485-BL is a battery powered device; it will sleep most of time. And wake up on each period and read RS485 / TTL sensor data and uplink. 332 -))) 333 333 334 - (((339 + 335 335 During each sampling, we need to confirm what commands we need to send to the sensors to read data. After the RS485/TTL sensors send back the value, it normally includes some bytes and we only need a few from them for a shorten payload. 336 -))) 337 337 338 - (((342 + 339 339 To save the LoRaWAN network bandwidth, we might need to read data from different sensors and combine their valid value into a short payload. 340 -))) 341 341 342 - (((345 + 343 343 This section describes how to achieve above goals. 344 -))) 345 345 346 - (((348 + 347 347 During each sampling, the RS485-BL can support 15 commands to read sensors. And combine the return to one or several uplink payloads. 348 -))) 349 349 350 - (((351 + 351 351 **Command from RS485-BL to Sensor:** 352 -))) 353 353 354 -((( 355 355 RS485-BL can send out pre-set max 15 strings via **AT+COMMAD1**, **ATCOMMAND2**,…, to **AT+COMMANDF** . All commands are of same grammar. 356 -))) 357 357 358 - (((356 + 359 359 **Handle return from sensors to RS485-BL**: 360 -))) 361 361 362 -((( 363 363 After RS485-BL send out a string to sensor, RS485-BL will wait for the return from RS485 or TTL sensor. And user can specify how to handle the return, by **AT+DATACUT or AT+SEARCH commands** 364 -))) 365 365 366 -* ((( 367 -**AT+DATACUT** 368 -))) 369 369 370 -((( 362 +* **AT+DATACUT** 363 + 371 371 When the return value from sensor have fix length and we know which position the valid value we should get, we can use AT+DATACUT command. 372 -))) 373 373 374 -* ((( 375 -**AT+SEARCH** 376 -))) 377 377 378 -((( 367 +* **AT+SEARCH** 368 + 379 379 When the return value from sensor is dynamic length and we are not sure which bytes the valid data is, instead, we know what value the valid value following. We can use AT+SEARCH to search the valid value in the return string. 380 -))) 381 381 382 - (((371 + 383 383 **Define wait timeout:** 384 -))) 385 385 386 -((( 387 387 Some RS485 device might has longer delay on reply, so user can use AT+CMDDL to set the timeout for getting reply after the RS485 command is sent. For example, AT+CMDDL1=1000 to send the open time to 1000ms 388 -))) 389 389 390 - (((376 + 391 391 After we got the valid value from each RS485 commands, we need to combine them together with the command **AT+DATAUP**. 392 -))) 393 393 379 + 394 394 **Examples:** 395 395 396 396 Below are examples for the how above AT Commands works. 397 397 384 + 398 398 **AT+COMMANDx : **This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is: 399 399 400 -(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:501px" %) 401 -|(% style="width:498px" %)((( 387 +|((( 402 402 **AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m** 403 403 404 404 **xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent** ... ... @@ -410,38 +410,41 @@ 410 410 411 411 In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same. 412 412 399 + 413 413 **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx. 414 414 415 -(% border="1" class="table-bordered" style="background-color:#4f81bd; color:white; width:580px" %) 416 -|(% style="width:577px" %)((( 402 +|((( 417 417 **AT+SEARCHx=aa,xx xx xx xx xx** 418 418 419 419 * **aa: 1: prefix match mode; 2: prefix and suffix match mode** 420 420 * **xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix** 407 + 408 + 421 421 ))) 422 422 423 - **Examples:**411 +Examples: 424 424 425 425 1. For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 426 426 427 427 If we set AT+SEARCH1=1,1E 56 34. (max 5 bytes for prefix) 428 428 429 -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**417 +The valid data will be all bytes after 1E 56 34 , so it is 2e 30 58 5f 36 41 30 31 00 49 430 430 431 -[[image: 1653271044481-711.png]]419 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image013.png]] 432 432 421 + 433 433 1. For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 434 434 435 435 If we set AT+SEARCH1=2, 1E 56 34+31 00 49 436 436 437 -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**426 +Device will search the bytes between 1E 56 34 and 31 00 49. So it is 2e 30 58 5f 36 41 30 438 438 439 -[[image: 1653271276735-972.png]]428 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image014.png]] 440 440 430 + 441 441 **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes. 442 442 443 -(% style="background-color:#4f81bd; color:white; width:729px" %) 444 -|(% style="width:726px" %)((( 433 +|((( 445 445 **AT+DATACUTx=a,b,c** 446 446 447 447 * **a: length for the return of AT+COMMAND** ... ... @@ -453,123 +453,85 @@ 453 453 454 454 * Grab bytes: 455 455 456 -[[image: 1653271581490-837.png||height="313" width="722"]]445 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image015.png]] 457 457 458 458 * Grab a section. 459 459 460 -[[image: 1653271648378-342.png||height="326" width="720"]]449 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image016.png]] 461 461 462 462 * Grab different sections. 463 463 464 -[[image: 1653271657255-576.png||height="305" width="730"]]453 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image017.png]] 465 465 466 -((( 467 -(% style="color:red" %)**Note:** 468 -))) 469 469 470 -((( 456 +Note: 457 + 471 471 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. 472 -))) 473 473 474 -((( 475 -**Example:** 476 -))) 460 +Example: 477 477 478 -((( 479 -(% style="color:red" %)AT+COMMAND1=11 01 1E D0,0 480 -))) 462 +AT+COMMAND1=11 01 1E D0,0 481 481 482 -((( 483 -(% style="color:red" %)AT+SEARCH1=1,1E 56 34 484 -))) 464 +AT+SEARCH1=1,1E 56 34 485 485 486 -((( 487 -(% style="color:red" %)AT+DATACUT1=0,2,1~~5 488 -))) 466 +AT+DATACUT1=0,2,1~~5 489 489 490 -((( 491 -(% style="color:red" %)Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 492 -))) 468 +Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 493 493 494 -((( 495 -(% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49 496 -))) 470 +String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49 497 497 498 -((( 499 -(% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36 500 -))) 472 +Valid payload after DataCUT command: 2e 30 58 5f 36 501 501 502 -[[image: 1653271763403-806.png]]474 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image018.png]] 503 503 504 -=== 3.3.4 Compose the uplink payload === 505 505 506 -((( 477 + 478 + 479 +1. 480 +11. 481 +111. Compose the uplink payload 482 + 507 507 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.** 508 -))) 509 509 510 -((( 511 -(% style="color:#4f81bd" %)**Examples: AT+DATAUP=0** 512 -))) 513 513 514 -((( 515 -Compose the uplink payload with value returns in sequence and send with (% style="color:red" %)**A SIGNLE UPLINK**. 516 -))) 486 +**Examples: AT+DATAUP=0** 517 517 518 -((( 488 +Compose the uplink payload with value returns in sequence and send with **A SIGNLE UPLINK**. 489 + 519 519 Final Payload is 520 -))) 521 521 522 -((( 523 -(% style="color:#4f81bd" %)Battery Info+PAYVER + VALID Value from RETURN1 + Valid Value from RETURN2 + … + RETURNx 524 -))) 492 +Battery Info+PAYVER + VALID Value from RETURN1 + Valid Value from RETURN2 + … + RETURNx 525 525 526 -((( 527 527 Where PAYVER is defined by AT+PAYVER, below is an example screen shot. 528 -))) 529 529 530 -[[image: 1653272787040-634.png||height="515" width="719"]]496 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image019.png]] 531 531 532 -((( 533 -(% style="color:#4f81bd" %)**Examples: AT+DATAUP=1** 534 -))) 535 535 536 -((( 537 -Compose the uplink payload with value returns in sequence and send with (% style="color:red" %)**Multiply UPLINKs**. 538 -))) 539 539 540 -((( 500 +**Examples: AT+DATAUP=1** 501 + 502 +Compose the uplink payload with value returns in sequence and send with **Multiply UPLINKs**. 503 + 541 541 Final Payload is 542 -))) 543 543 544 -((( 545 -(% style="color:#4f81bd" %)Battery Info+PAYVER + PAYLOAD COUNT + PAYLOAD# + DATA 546 -))) 506 +Battery Info+PAYVER + PAYLOAD COUNT + PAYLOAD# + DATA 547 547 548 -1. ((( 549 -Battery Info (2 bytes): Battery voltage 550 -))) 551 -1. ((( 552 -PAYVER (1 byte): Defined by AT+PAYVER 553 -))) 554 -1. ((( 555 -PAYLOAD COUNT (1 byte): Total how many uplinks of this sampling. 556 -))) 557 -1. ((( 558 -PAYLOAD# (1 byte): Number of this uplink. (from 0,1,2,3…,to PAYLOAD COUNT) 559 -))) 560 -1. ((( 561 -DATA: Valid value: max 6 bytes(US915 version here, Notice*!) for each uplink so each uplink <= 11 bytes. For the last uplink, DATA will might less than 6 bytes 562 -))) 508 +1. Battery Info (2 bytes): Battery voltage 509 +1. PAYVER (1 byte): Defined by AT+PAYVER 510 +1. PAYLOAD COUNT (1 byte): Total how many uplinks of this sampling. 511 +1. PAYLOAD# (1 byte): Number of this uplink. (from 0,1,2,3…,to PAYLOAD COUNT) 512 +1. DATA: Valid value: max 6 bytes(US915 version here, [[Notice*!>>path:#max_byte]]) for each uplink so each uplink <= 11 bytes. For the last uplink, DATA will might less than 6 bytes 563 563 564 -[[image: 1653272817147-600.png||height="437" width="717"]]514 +[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image020.png]] 565 565 516 + 566 566 So totally there will be 3 uplinks for this sampling, each uplink includes 6 bytes DATA 567 567 568 -DATA1=RETURN1 Valid Value = ~(% style="background-color:#4f81bd;color:white" %)(% style="display:none" %) (%%)20 20 0a 33 90 41519 +DATA1=RETURN1 Valid Value = 20 20 0a 33 90 41 569 569 570 -DATA2=1^^st^^ ~~ 6^^th^^ byte of Valid value of RETURN10= ~(% style="background-color:#4f81bd;color:white" %)(% style="display:none" %) (%%)02 aa 05 81 0a 20521 +DATA2=1^^st^^ ~~ 6^^th^^ byte of Valid value of RETURN10= 02 aa 05 81 0a 20 571 571 572 -DATA3=7^^th^^ ~~ 11^^th^^ bytes of Valid value of RETURN10 = ~(%style="background-color:#4f81bd;color:white" %)(% style="display:none" %) (%%)20 20 20 2d 30523 +DATA3=7^^th^^ ~~ 11^^th^^ bytes of Valid value of RETURN10 = 20 20 20 2d 30 573 573 574 574 575 575 ... ... @@ -590,8 +590,8 @@ 590 590 591 591 592 592 593 -1. 594 -11. 544 +1. 545 +11. 595 595 111. Uplink on demand 596 596 597 597 Except uplink periodically, RS485-BL is able to uplink on demand. The server sends downlink command to RS485-BL and RS485 will uplink data base on the command. ... ... @@ -604,8 +604,8 @@ 604 604 605 605 606 606 607 -1. 608 -11. 558 +1. 559 +11. 609 609 111. Uplink on Interrupt 610 610 611 611 Put the interrupt sensor between 3.3v_out and GPIO ext.[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image022.png]] ... ... @@ -619,7 +619,7 @@ 619 619 AT+INTMOD=3 Interrupt trigger by rising edge. 620 620 621 621 622 -1. 573 +1. 623 623 11. Uplink Payload 624 624 625 625 |**Size(bytes)**|**2**|**1**|**Length depends on the return from the commands** ... ... @@ -681,15 +681,15 @@ 681 681 682 682 * **Sensor Related Commands**: These commands are special designed for RS485-BL. User can see these commands below: 683 683 684 -1. 685 -11. 635 +1. 636 +11. 686 686 111. Common Commands: 687 687 688 688 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: [[http:~~/~~/wiki.dragino.com/index.php?title=End_Device_AT_Commands_and_Downlink_Commands>>url:http://wiki.dragino.com/index.php?title=End_Device_AT_Commands_and_Downlink_Commands]] 689 689 690 690 691 -1. 692 -11. 642 +1. 643 +11. 693 693 111. Sensor related commands: 694 694 695 695 ==== Choose Device Type (RS485 or TTL) ==== ... ... @@ -995,13 +995,13 @@ 995 995 996 996 997 997 998 -1. 949 +1. 999 999 11. Buttons 1000 1000 1001 1001 |**Button**|**Feature** 1002 1002 |**RST**|Reboot RS485-BL 1003 1003 1004 -1. 955 +1. 1005 1005 11. +3V3 Output 1006 1006 1007 1007 RS485-BL has a Controllable +3V3 output, user can use this output to power external sensor. ... ... @@ -1019,7 +1019,7 @@ 1019 1019 By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time 1020 1020 1021 1021 1022 -1. 973 +1. 1023 1023 11. +5V Output 1024 1024 1025 1025 RS485-BL has a Controllable +5V output, user can use this output to power external sensor. ... ... @@ -1039,13 +1039,13 @@ 1039 1039 1040 1040 1041 1041 1042 -1. 993 +1. 1043 1043 11. LEDs 1044 1044 1045 1045 |**LEDs**|**Feature** 1046 1046 |**LED1**|Blink when device transmit a packet. 1047 1047 1048 -1. 999 +1. 1049 1049 11. Switch Jumper 1050 1050 1051 1051 |**Switch Jumper**|**Feature** ... ... @@ -1091,7 +1091,7 @@ 1091 1091 1092 1092 1093 1093 1094 -1. 1045 +1. 1095 1095 11. Common AT Command Sequence 1096 1096 111. Multi-channel ABP mode (Use with SX1301/LG308) 1097 1097 ... ... @@ -1110,8 +1110,8 @@ 1110 1110 1111 1111 ATZ 1112 1112 1113 -1. 1114 -11. 1064 +1. 1065 +11. 1115 1115 111. Single-channel ABP mode (Use with LG01/LG02) 1116 1116 1117 1117 AT+FDR Reset Parameters to Factory Default, Keys Reserve ... ... @@ -1186,7 +1186,7 @@ 1186 1186 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image035.png]] [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image036.png]] 1187 1187 1188 1188 1189 -1. 1140 +1. 1190 1190 11. How to change the LoRa Frequency Bands/Region? 1191 1191 1192 1192 User can follow the introduction for [[how to upgrade image>>path:#upgrade_image]]. When download the images, choose the required image file for download. ... ... @@ -1193,7 +1193,7 @@ 1193 1193 1194 1194 1195 1195 1196 -1. 1147 +1. 1197 1197 11. How many RS485-Slave can RS485-BL connects? 1198 1198 1199 1199 The RS485-BL can support max 32 RS485 devices. Each uplink command of RS485-BL can support max 16 different RS485 command. So RS485-BL can support max 16 RS485 devices pre-program in the device for uplink. For other devices no pre-program, user can use the [[downlink message (type code 0xA8) to poll their info>>path:#downlink_A8]]. ... ... @@ -1210,7 +1210,7 @@ 1210 1210 1211 1211 1212 1212 1213 -1. 1164 +1. 1214 1214 11. Why I can’t join TTN V3 in US915 /AU915 bands? 1215 1215 1216 1216 It might about the channels mapping. Please see for detail.
- 1652954654347-831.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -138.7 KB - Content
- 1653271044481-711.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -27.8 KB - Content
- 1653271276735-972.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -26.6 KB - Content
- 1653271581490-837.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -138.7 KB - Content
- 1653271648378-342.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -131.4 KB - Content
- 1653271657255-576.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -142.6 KB - Content
- 1653271763403-806.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -27.7 KB - Content
- 1653272787040-634.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -294.0 KB - Content
- 1653272817147-600.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -143.3 KB - Content