Changes for page RS485-LN – RS485 to LoRaWAN Converter User Manual
Last modified by Karry Zhuang on 2025/03/06 16:34
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 2 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -RS485- BL –WaterproofRS485 to LoRaWAN Converter1 +RS485-LN – RS485 to LoRaWAN Converter - Content
-
... ... @@ -1,12 +1,11 @@ 1 1 (% style="text-align:center" %) 2 -[[image:165294 7681187-144.png||height="385" width="385"]]2 +[[image:1653266934636-343.png||height="385" width="385"]] 3 3 4 4 5 5 6 +**RS485-LN – RS485 to LoRaWAN Converter User Manual** 6 6 7 -**RS485-BL – Waterproof RS485 to LoRaWAN Converter User Manual** 8 8 9 - 10 10 **Table of Contents:** 11 11 12 12 ... ... @@ -60,7 +60,7 @@ 60 60 * Power Consumption (exclude RS485 device): 61 61 ** Idle: 6uA@3.3v 62 62 63 -* 62 +* 64 64 ** 20dB Transmit: 130mA@3.3v 65 65 66 66 **Interface for Model:** ... ... @@ -167,19 +167,31 @@ 167 167 168 168 [[image:1652953414711-647.png||height="337" width="723"]] 169 169 169 +((( 170 170 The RS485-BL in this example connected to two RS485 devices for demonstration, user can connect to other RS485 devices via the same method. 171 +))) 171 171 173 +((( 172 172 The LG308 is already set to connect to [[TTN V3 network >>url:https://www.thethingsnetwork.org/]]. So what we need to now is only configure the TTN V3: 175 +))) 173 173 177 +((( 174 174 **Step 1**: Create a device in TTN V3 with the OTAA keys from RS485-BL. 179 +))) 175 175 181 +((( 176 176 Each RS485-BL is shipped with a sticker with unique device EUI: 183 +))) 177 177 178 178 [[image:1652953462722-299.png]] 179 179 187 +((( 180 180 User can enter this key in their LoRaWAN Server portal. Below is TTN V3 screen shot: 189 +))) 181 181 191 +((( 182 182 Add APP EUI in the application. 193 +))) 183 183 184 184 185 185 ... ... @@ -207,142 +207,185 @@ 207 207 208 208 [[image:1652953568895-172.png||height="232" width="724"]] 209 209 221 +== 3.3 Configure Commands to read data == 210 210 211 - 212 - 213 -1. 214 -11. Configure Commands to read data 215 - 223 +((( 216 216 There are plenty of RS485 and TTL level devices in the market and each device has different command to read the valid data. To support these devices in flexible, RS485-BL supports flexible command set. User can use [[AT Commands or LoRaWAN Downlink>>path:#AT_COMMAND]] Command to configure how RS485-BL should read the sensor and how to handle the return from RS485 or TTL sensors. 225 +))) 217 217 227 +=== 3.3.1 onfigure UART settings for RS485 or TTL communication === 218 218 219 -1. 220 -11. 221 -111. Configure UART settings for RS485 or TTL communication 222 - 223 223 RS485-BL can connect to either RS485 sensors or TTL sensor. User need to specify what type of sensor need to connect. 224 224 225 -1. RS485-MODBUS mode: 231 +**~1. RS485-MODBUS mode:** 226 226 227 227 AT+MOD=1 ~/~/ Support RS485-MODBUS type sensors. User can connect multiply RS485 , Modbus sensors to the A / B pins. 228 228 235 +**2. TTL mode:** 229 229 230 -1. TTL mode: 231 - 232 232 AT+MOD=2 ~/~/ Support TTL Level sensors, User can connect one TTL Sensor to the TXD/RXD/GND pins. 233 233 234 - 235 235 RS485-BL default UART settings is **9600, no parity, stop bit 1**. If the sensor has a different settings, user can change the RS485-BL setting to match. 236 236 237 - 238 -|**AT Commands**|**Description**|**Example** 239 -|AT+BAUDR|Set the baud rate (for RS485 connection). Default Value is: 9600.|((( 241 +(% border="1" style="background-color:#ffffcc; color:green; width:795px" %) 242 +|((( 243 +**AT Commands** 244 +)))|(% style="width:285px" %)((( 245 +**Description** 246 +)))|(% style="width:347px" %)((( 247 +**Example** 248 +))) 249 +|((( 250 +AT+BAUDR 251 +)))|(% style="width:285px" %)((( 252 +Set the baud rate (for RS485 connection). Default Value is: 9600. 253 +)))|(% style="width:347px" %)((( 254 +((( 240 240 AT+BAUDR=9600 256 +))) 241 241 258 +((( 242 242 Options: (1200,2400,4800,14400,19200,115200) 243 243 ))) 244 -|AT+PARITY|((( 261 +))) 262 +|((( 263 +AT+PARITY 264 +)))|(% style="width:285px" %)((( 265 +((( 245 245 Set UART parity (for RS485 connection) 267 +))) 246 246 269 +((( 247 247 Default Value is: no parity. 248 -)))|((( 271 +))) 272 +)))|(% style="width:347px" %)((( 273 +((( 249 249 AT+PARITY=0 275 +))) 250 250 277 +((( 251 251 Option: 0: no parity, 1: odd parity, 2: even parity 252 252 ))) 253 -|AT+STOPBIT|((( 280 +))) 281 +|((( 282 +AT+STOPBIT 283 +)))|(% style="width:285px" %)((( 284 +((( 254 254 Set serial stopbit (for RS485 connection) 286 +))) 255 255 288 +((( 256 256 Default Value is: 1bit. 257 -)))|((( 290 +))) 291 +)))|(% style="width:347px" %)((( 292 +((( 258 258 AT+STOPBIT=0 for 1bit 294 +))) 259 259 296 +((( 260 260 AT+STOPBIT=1 for 1.5 bit 298 +))) 261 261 300 +((( 262 262 AT+STOPBIT=2 for 2 bits 263 263 ))) 303 +))) 264 264 305 +=== 3.3.2 Configure sensors === 265 265 307 +((( 308 +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**. 309 +))) 266 266 311 +((( 312 +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. 313 +))) 267 267 268 -1. 269 -11. 270 -111. Configure sensors 271 - 272 -Some sensors might need to configure before normal operation. User can configure such sensor via PC or through RS485-BL AT Commands AT+CFGDEV. 273 - 274 - 275 -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. 276 - 277 -|**AT Commands**|**Description**|**Example** 278 -|AT+CFGDEV|((( 315 +(% border="1" style="background-color:#ffffcc; color:green; width:806px" %) 316 +|**AT Commands**|(% style="width:418px" %)**Description**|(% style="width:256px" %)**Example** 317 +|AT+CFGDEV|(% style="width:418px" %)((( 279 279 This command is used to configure the RS485/TTL devices; they won’t be used during sampling. 280 280 281 -AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx, m320 +AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx, 282 282 283 -m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command 284 -)))|AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m 322 +mm: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command 323 +)))|(% style="width:256px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m 285 285 286 286 Detail of AT+CFGDEV command see [[AT+CFGDEV detail>>path:#AT_CFGDEV]]. 287 287 327 +=== 3.3.3 Configure read commands for each sampling === 288 288 289 - 290 - 291 - 292 -1. 293 -11. 294 -111. Configure read commands for each sampling 295 - 329 +((( 296 296 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. 331 +))) 297 297 298 - 333 +((( 299 299 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. 335 +))) 300 300 301 - 337 +((( 302 302 To save the LoRaWAN network bandwidth, we might need to read data from different sensors and combine their valid value into a short payload. 339 +))) 303 303 304 - 341 +((( 305 305 This section describes how to achieve above goals. 343 +))) 306 306 307 - 345 +((( 308 308 During each sampling, the RS485-BL can support 15 commands to read sensors. And combine the return to one or several uplink payloads. 347 +))) 309 309 310 - 349 +((( 311 311 **Command from RS485-BL to Sensor:** 351 +))) 312 312 353 +((( 313 313 RS485-BL can send out pre-set max 15 strings via **AT+COMMAD1**, **ATCOMMAND2**,…, to **AT+COMMANDF** . All commands are of same grammar. 355 +))) 314 314 315 - 357 +((( 316 316 **Handle return from sensors to RS485-BL**: 359 +))) 317 317 361 +((( 318 318 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** 363 +))) 319 319 365 +* ((( 366 +**AT+DATACUT** 367 +))) 320 320 321 -* **AT+DATACUT** 322 - 369 +((( 323 323 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. 371 +))) 324 324 373 +* ((( 374 +**AT+SEARCH** 375 +))) 325 325 326 -* **AT+SEARCH** 327 - 377 +((( 328 328 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. 379 +))) 329 329 330 - 381 +((( 331 331 **Define wait timeout:** 383 +))) 332 332 385 +((( 333 333 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 387 +))) 334 334 335 - 389 +((( 336 336 After we got the valid value from each RS485 commands, we need to combine them together with the command **AT+DATAUP**. 391 +))) 337 337 338 - 339 339 **Examples:** 340 340 341 341 Below are examples for the how above AT Commands works. 342 342 343 - 344 344 **AT+COMMANDx : **This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is: 345 345 399 +(% border="1" class="table-bordered" %) 346 346 |((( 347 347 **AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m** 348 348 ... ... @@ -355,9 +355,9 @@ 355 355 356 356 In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same. 357 357 358 - 359 359 **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx. 360 360 414 +(% border="1" class="table-bordered" %) 361 361 |((( 362 362 **AT+SEARCHx=aa,xx xx xx xx xx** 363 363 ... ... @@ -375,7 +375,7 @@ 375 375 376 376 The valid data will be all bytes after 1E 56 34 , so it is 2e 30 58 5f 36 41 30 31 00 49 377 377 378 -[[image: file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image013.png]]432 +[[image:1652954654347-831.png]] 379 379 380 380 381 381 1. For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49 ... ... @@ -436,7 +436,7 @@ 436 436 437 437 438 438 1. 439 -11. 493 +11. 440 440 111. Compose the uplink payload 441 441 442 442 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.** ... ... @@ -500,8 +500,8 @@ 500 500 501 501 502 502 503 -1. 504 -11. 557 +1. 558 +11. 505 505 111. Uplink on demand 506 506 507 507 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. ... ... @@ -514,8 +514,8 @@ 514 514 515 515 516 516 517 -1. 518 -11. 571 +1. 572 +11. 519 519 111. Uplink on Interrupt 520 520 521 521 Put the interrupt sensor between 3.3v_out and GPIO ext.[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image022.png]] ... ... @@ -529,7 +529,7 @@ 529 529 AT+INTMOD=3 Interrupt trigger by rising edge. 530 530 531 531 532 -1. 586 +1. 533 533 11. Uplink Payload 534 534 535 535 |**Size(bytes)**|**2**|**1**|**Length depends on the return from the commands** ... ... @@ -591,15 +591,15 @@ 591 591 592 592 * **Sensor Related Commands**: These commands are special designed for RS485-BL. User can see these commands below: 593 593 594 -1. 595 -11. 648 +1. 649 +11. 596 596 111. Common Commands: 597 597 598 598 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]] 599 599 600 600 601 -1. 602 -11. 655 +1. 656 +11. 603 603 111. Sensor related commands: 604 604 605 605 ==== Choose Device Type (RS485 or TTL) ==== ... ... @@ -905,13 +905,13 @@ 905 905 906 906 907 907 908 -1. 962 +1. 909 909 11. Buttons 910 910 911 911 |**Button**|**Feature** 912 912 |**RST**|Reboot RS485-BL 913 913 914 -1. 968 +1. 915 915 11. +3V3 Output 916 916 917 917 RS485-BL has a Controllable +3V3 output, user can use this output to power external sensor. ... ... @@ -929,7 +929,7 @@ 929 929 By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time 930 930 931 931 932 -1. 986 +1. 933 933 11. +5V Output 934 934 935 935 RS485-BL has a Controllable +5V output, user can use this output to power external sensor. ... ... @@ -949,13 +949,13 @@ 949 949 950 950 951 951 952 -1. 1006 +1. 953 953 11. LEDs 954 954 955 955 |**LEDs**|**Feature** 956 956 |**LED1**|Blink when device transmit a packet. 957 957 958 -1. 1012 +1. 959 959 11. Switch Jumper 960 960 961 961 |**Switch Jumper**|**Feature** ... ... @@ -1001,7 +1001,7 @@ 1001 1001 1002 1002 1003 1003 1004 -1. 1058 +1. 1005 1005 11. Common AT Command Sequence 1006 1006 111. Multi-channel ABP mode (Use with SX1301/LG308) 1007 1007 ... ... @@ -1020,8 +1020,8 @@ 1020 1020 1021 1021 ATZ 1022 1022 1023 -1. 1024 -11. 1077 +1. 1078 +11. 1025 1025 111. Single-channel ABP mode (Use with LG01/LG02) 1026 1026 1027 1027 AT+FDR Reset Parameters to Factory Default, Keys Reserve ... ... @@ -1096,7 +1096,7 @@ 1096 1096 [[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]] 1097 1097 1098 1098 1099 -1. 1153 +1. 1100 1100 11. How to change the LoRa Frequency Bands/Region? 1101 1101 1102 1102 User can follow the introduction for [[how to upgrade image>>path:#upgrade_image]]. When download the images, choose the required image file for download. ... ... @@ -1103,7 +1103,7 @@ 1103 1103 1104 1104 1105 1105 1106 -1. 1160 +1. 1107 1107 11. How many RS485-Slave can RS485-BL connects? 1108 1108 1109 1109 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]]. ... ... @@ -1120,7 +1120,7 @@ 1120 1120 1121 1121 1122 1122 1123 -1. 1177 +1. 1124 1124 11. Why I can’t join TTN V3 in US915 /AU915 bands? 1125 1125 1126 1126 It might about the channels mapping. Please see for detail.
- 1652954654347-831.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +138.7 KB - Content
- 1653266934636-343.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +176.5 KB - Content