<
From version < 31.2 >
edited by Xiaoling
on 2022/05/23 09:47
To version < 35.2 >
edited by Xiaoling
on 2022/06/02 15:44
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -18,26 +18,30 @@
18 18  
19 19  (((
20 20  (((
21 -The Dragino RS485-LN is a RS485 to LoRaWAN Converter. It converts the RS485 signal into LoRaWAN wireless signal which simplify the IoT installation and reduce the installation/maintaining cost.
21 +The Dragino RS485-LN is a (% style="color:blue" %)**RS485 to LoRaWAN Converter**(%%). It converts the RS485 signal into LoRaWAN wireless signal which simplify the IoT installation and reduce the installation/maintaining cost.
22 22  )))
23 23  
24 24  (((
25 -RS485-LN allows user to monitor / control RS485 devices and reach extremely long ranges. It provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption. It targets professional wireless sensor network applications such as irrigation systems, smart metering, smart cities, smartphone detection, building automation, and so on.
25 +RS485-LN allows user to (% style="color:blue" %)**monitor / control RS485 devices**(%%) and reach extremely long ranges. It provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption. It targets professional wireless sensor network applications such as irrigation systems, smart metering, smart cities, smartphone detection, building automation, and so on.
26 26  )))
27 27  
28 28  (((
29 -For data uplink, RS485-LN sends user-defined commands to RS485 devices and gets the return from the RS485 devices. RS485-LN will process these returns according to user-define rules to get the final payload and upload to LoRaWAN server.
29 +(% style="color:blue" %)**For data uplink**(%%), RS485-LN sends user-defined commands to RS485 devices and gets the return from the RS485 devices. RS485-LN will process these returns according to user-define rules to get the final payload and upload to LoRaWAN server.
30 30  )))
31 31  
32 32  (((
33 -For data downlink, RS485-LN runs in LoRaWAN Class C. When there downlink commands from LoRaWAN server, RS485-LN will forward the commands from LoRaWAN server to RS485 devices.
33 +(% style="color:blue" %)**For data downlink**(%%), RS485-LN runs in LoRaWAN Class C. When there downlink commands from LoRaWAN server, RS485-LN will forward the commands from LoRaWAN server to RS485 devices.
34 +
35 +(% style="color:blue" %)**Demo Dashboard for RS485-LN**(%%) connect to two energy meters: [[https:~~/~~/app.datacake.de/dashboard/d/58844a26-378d-4c5a-aaf5-b5b5b153447a>>url:https://app.datacake.de/dashboard/d/58844a26-378d-4c5a-aaf5-b5b5b153447a]]
34 34  )))
35 35  )))
36 36  
37 37  [[image:1653267211009-519.png||height="419" width="724"]]
38 38  
41 +
39 39  == 1.2 Specifications ==
40 40  
44 +
41 41  **Hardware System:**
42 42  
43 43  * STM32L072CZT6 MCU
... ... @@ -44,8 +44,6 @@
44 44  * SX1276/78 Wireless Chip 
45 45  * Power Consumption (exclude RS485 device):
46 46  ** Idle: 32mA@12v
47 -
48 -*
49 49  ** 20dB Transmit: 65mA@12v
50 50  
51 51  **Interface for Model:**
... ... @@ -74,6 +74,8 @@
74 74  * Automatic RF Sense and CAD with ultra-fast AFC.
75 75  * Packet engine up to 256 bytes with CRC.
76 76  
79 +
80 +
77 77  == 1.3 Features ==
78 78  
79 79  * LoRaWAN Class A & Class C protocol (default Class C)
... ... @@ -85,6 +85,8 @@
85 85  * Support Modbus protocol
86 86  * Support Interrupt uplink (Since hardware version v1.2)
87 87  
92 +
93 +
88 88  == 1.4 Applications ==
89 89  
90 90  * Smart Buildings & Home Automation
... ... @@ -94,10 +94,13 @@
94 94  * Smart Cities
95 95  * Smart Factory
96 96  
103 +
104 +
97 97  == 1.5 Firmware Change log ==
98 98  
99 99  [[RS485-LN Image files – Download link and Change log>>url:http://www.dragino.com/downloads/index.php?dir=RS485-LN/]]
100 100  
109 +
101 101  == 1.6 Hardware Change log ==
102 102  
103 103  (((
... ... @@ -105,6 +105,8 @@
105 105  v1.2: Add External Interrupt Pin.
106 106  
107 107  v1.0: Release
117 +
118 +
108 108  )))
109 109  )))
110 110  
... ... @@ -121,6 +121,8 @@
121 121  )))
122 122  
123 123  [[image:1653268091319-405.png]]
135 +
136 +
124 124  )))
125 125  
126 126  = 3. Operation Mode =
... ... @@ -129,6 +129,8 @@
129 129  
130 130  (((
131 131  The RS485-LN is configured as LoRaWAN OTAA Class C mode by default. It has OTAA keys to join network. To connect a local LoRaWAN network, user just need to input the OTAA keys in the network server and power on the RS485-LN. It will auto join the network via OTAA.
145 +
146 +
132 132  )))
133 133  
134 134  == 3.2 Example to join LoRaWAN network ==
... ... @@ -137,10 +137,15 @@
137 137  
138 138  [[image:1653268155545-638.png||height="334" width="724"]]
139 139  
155 +
140 140  (((
157 +(((
141 141  The RS485-LN in this example connected to two RS485 devices for demonstration, user can connect to other RS485 devices via the same method. The connection is as below:
159 +)))
142 142  
161 +(((
143 143  485A+ and 485B- of the sensor are connected to RS485A and RA485B of RS485-LN respectively.
163 +)))
144 144  
145 145  [[image:1653268227651-549.png||height="592" width="720"]]
146 146  
... ... @@ -192,6 +192,7 @@
192 192  
193 193  [[image:1652953568895-172.png||height="232" width="724"]]
194 194  
215 +
195 195  == 3.3 Configure Commands to read data ==
196 196  
197 197  (((
... ... @@ -201,6 +201,8 @@
201 201  
202 202  (((
203 203  (% style="color:red" %)Note: below description and commands are for firmware version >v1.1, if you have firmware version v1.0. Please check the [[user manual v1.0>>url:http://www.dragino.com/downloads/index.php?dir=RS485-LN/&file=RS485-LN_UserManual_v1.0.1.pdf]] or upgrade the firmware to v1.1
225 +
226 +
204 204  )))
205 205  )))
206 206  
... ... @@ -208,19 +208,19 @@
208 208  
209 209  To use RS485-LN to read data from RS485 sensors, connect the RS485-LN A/B traces to the sensors. And user need to make sure RS485-LN use the match UART setting to access the sensors. The related commands for UART settings are:
210 210  
211 -(% border="1" style="background-color:#ffffcc; color:green; width:795px" %)
212 -|(((
234 +(% border="1" style="background-color:#ffffcc; color:green; width:782px" %)
235 +|(% style="width:128px" %)(((
213 213  **AT Commands**
214 -)))|(% style="width:285px" %)(((
237 +)))|(% style="width:305px" %)(((
215 215  **Description**
216 -)))|(% style="width:347px" %)(((
239 +)))|(% style="width:346px" %)(((
217 217  **Example**
218 218  )))
219 -|(((
242 +|(% style="width:128px" %)(((
220 220  AT+BAUDR
221 -)))|(% style="width:285px" %)(((
244 +)))|(% style="width:305px" %)(((
222 222  Set the baud rate (for RS485 connection). Default Value is: 9600.
223 -)))|(% style="width:347px" %)(((
246 +)))|(% style="width:346px" %)(((
224 224  (((
225 225  AT+BAUDR=9600
226 226  )))
... ... @@ -229,11 +229,11 @@
229 229  Options: (1200,2400,4800,14400,19200,115200)
230 230  )))
231 231  )))
232 -|(((
255 +|(% style="width:128px" %)(((
233 233  AT+PARITY
234 -)))|(% style="width:285px" %)(((
257 +)))|(% style="width:305px" %)(((
235 235  Set UART parity (for RS485 connection)
236 -)))|(% style="width:347px" %)(((
259 +)))|(% style="width:346px" %)(((
237 237  (((
238 238  AT+PARITY=0
239 239  )))
... ... @@ -242,9 +242,9 @@
242 242  Option: 0: no parity, 1: odd parity, 2: even parity
243 243  )))
244 244  )))
245 -|(((
268 +|(% style="width:128px" %)(((
246 246  AT+STOPBIT
247 -)))|(% style="width:285px" %)(((
270 +)))|(% style="width:305px" %)(((
248 248  (((
249 249  Set serial stopbit (for RS485 connection)
250 250  )))
... ... @@ -252,7 +252,7 @@
252 252  (((
253 253  
254 254  )))
255 -)))|(% style="width:347px" %)(((
278 +)))|(% style="width:346px" %)(((
256 256  (((
257 257  AT+STOPBIT=0 for 1bit
258 258  )))
... ... @@ -266,6 +266,8 @@
266 266  )))
267 267  )))
268 268  
292 +
293 +
269 269  === 3.3.2 Configure sensors ===
270 270  
271 271  (((
... ... @@ -284,80 +284,41 @@
284 284  mm: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command
285 285  )))|(% style="width:256px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m
286 286  
287 -=== 3.3.3 Configure read commands for each sampling ===
288 288  
289 -(((
290 -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.
291 -)))
292 292  
293 -(((
294 -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.
295 -)))
314 +=== 3.3.3 Configure read commands for each sampling ===
296 296  
297 297  (((
317 +During each sampling, we need confirm what commands we need to send to the RS485 sensors to read data. After the RS485 sensors send back the value, it normally include some bytes and we only need a few from them for a shorten payload.
318 +
298 298  To save the LoRaWAN network bandwidth, we might need to read data from different sensors and combine their valid value into a short payload.
299 -)))
300 300  
301 -(((
302 302  This section describes how to achieve above goals.
303 -)))
304 304  
305 -(((
306 -During each sampling, the RS485-BL can support 15 commands to read sensors. And combine the return to one or several uplink payloads.
307 -)))
323 +During each sampling, the RS485-LN can support 15 commands to read sensors. And combine the return to one or several uplink payloads.
308 308  
309 -(((
310 -**Command from RS485-BL to Sensor:**
311 -)))
312 312  
313 -(((
314 -RS485-BL can send out pre-set max 15 strings via **AT+COMMAD1**, **ATCOMMAND2**,…, to **AT+COMMANDF** . All commands are of same grammar.
315 -)))
326 +**Each RS485 commands include two parts:**
316 316  
317 -(((
318 -**Handle return from sensors to RS485-BL**:
319 -)))
328 +~1. What commands RS485-LN will send to the RS485 sensors. There are total 15 commands from **AT+COMMAD1**, **ATCOMMAND2**,…, to **AT+COMMANDF**. All commands are of same grammar.
320 320  
321 -(((
322 -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**
323 -)))
330 +2. How to get wanted value the from RS485 sensors returns from by 1). There are total 15 AT Commands to handle the return, commands are **AT+DATACUT1**,**AT+DATACUT2**,…, **AT+DATACUTF** corresponding to the commands from 1). All commands are of same grammar.
324 324  
325 -* (((
326 -**AT+DATACUT**
327 -)))
332 +3. 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
328 328  
329 -(((
330 -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.
331 -)))
334 +**AT+CMDDL1=1000** to send the open time to 1000ms
332 332  
333 -* (((
334 -**AT+SEARCH**
335 -)))
336 336  
337 -(((
338 -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.
339 -)))
340 -
341 -(((
342 -**Define wait timeout:**
343 -)))
344 -
345 -(((
346 -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
347 -)))
348 -
349 -(((
350 350  After we got the valid value from each RS485 commands, we need to combine them together with the command **AT+DATAUP**.
351 -)))
352 352  
353 -**Examples:**
354 354  
355 355  Below are examples for the how above AT Commands works.
356 356  
357 -**AT+COMMANDx : **This command will be sent to RS485/TTL devices during each sampling, Max command length is 14 bytes. The grammar is:
358 358  
359 -(% border="1" class="table-bordered" %)
360 -|(((
343 +**AT+COMMANDx : **This command will be sent to RS485 devices during each sampling, Max command length is 14 bytes. The grammar is:
344 +
345 +(% border="1" style="background-color:#4bacc6; color:white; width:499px" %)
346 +|(% style="width:496px" %)(((
361 361  **AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m**
362 362  
363 363  **xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent**
... ... @@ -365,90 +365,40 @@
365 365  **m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command**
366 366  )))
367 367  
368 -(((
369 369  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.
370 -)))
371 371  
372 -(((
373 -In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same.
374 -)))
356 +In the RS485-LN, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same.
375 375  
376 -(((
377 -**AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx.
378 -)))
379 379  
380 -(% border="1" class="table-bordered" %)
381 -|(((
382 -**AT+SEARCHx=aa,xx xx xx xx xx**
383 -
384 -* **aa: 1: prefix match mode; 2: prefix and suffix match mode**
385 -* **xx xx xx xx xx: match string. Max 5 bytes for prefix and 5 bytes for suffix**
386 -
387 -
388 -)))
389 -
390 -**Examples:**
391 -
392 -~1. For a return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
393 -
394 -If we set AT+SEARCH1=1,1E 56 34.      (max 5 bytes for prefix)
395 -
396 -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**
397 -
398 -[[image:1653269403619-508.png]]
399 -
400 -2. For a return string from AT+COMMAND1:  16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
401 -
402 -If we set AT+SEARCH1=2, 1E 56 34+31 00 49
403 -
404 -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**
405 -
406 -[[image:1653269438444-278.png]]
407 -
408 408  **AT+DATACUTx : **This command defines how to handle the return from AT+COMMANDx, max return length is 45 bytes.
409 409  
410 -|(((
361 +(% border="1" style="background-color:#4bacc6; color:white; width:725px" %)
362 +|(% style="width:722px" %)(((
411 411  **AT+DATACUTx=a,b,c**
412 412  
413 413  * **a: length for the return of AT+COMMAND**
414 414  * **b:1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.**
415 -* **c: define the position for valid value.  **
367 +* **c: define the position for valid value. **
416 416  )))
417 417  
418 -Examples:
419 419  
371 +**Examples:**
372 +
420 420  * Grab bytes:
421 421  
422 -[[image:1653269551753-223.png||height="311" width="717"]]
375 +[[image:image-20220602153621-1.png]]
423 423  
377 +
424 424  * Grab a section.
425 425  
426 -[[image:1653269568276-930.png||height="325" width="718"]]
380 +[[image:image-20220602153621-2.png]]
427 427  
382 +
428 428  * Grab different sections.
429 429  
430 -[[image:1653269593172-426.png||height="303" width="725"]]
385 +[[image:image-20220602153621-3.png]]
386 +)))
431 431  
432 -(% style="color:red" %)**Note:**
433 -
434 -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.
435 -
436 -Example:
437 -
438 -(% style="color:red" %)AT+COMMAND1=11 01 1E D0,0
439 -
440 -(% style="color:red" %)AT+SEARCH1=1,1E 56 34
441 -
442 -(% style="color:red" %)AT+DATACUT1=0,2,1~~5
443 -
444 -(% style="color:red" %)Return string from AT+COMMAND1: 16 0c 1e 56 34 2e 30 58 5f 36 41 30 31 00 49
445 -
446 -(% style="color:red" %)String after SEARCH command: 2e 30 58 5f 36 41 30 31 00 49
447 -
448 -(% style="color:red" %)Valid payload after DataCUT command: 2e 30 58 5f 36
449 -
450 -[[image:1653269618463-608.png]]
451 -
452 452  === 3.3.4 Compose the uplink payload ===
453 453  
454 454  (((
... ... @@ -517,12 +517,8 @@
517 517  
518 518   ~* For all other bands: max 51 bytes for each uplink  ( so 51 -5 = 46 max valid date).
519 519  
456 +=== 3.3.5 Uplink on demand ===
520 520  
521 -
522 -1.
523 -11.
524 -111. Uplink on demand
525 -
526 526  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.
527 527  
528 528  Downlink control command:
image-20220602153621-1.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +23.4 KB
Content
image-20220602153621-2.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +22.2 KB
Content
image-20220602153621-3.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +22.3 KB
Content
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0