<
From version < 15.6 >
edited by Xiaoling
on 2022/05/19 17:59
To version < 15.2 >
edited by Xiaoling
on 2022/05/19 17:47
>
Change comment: There is no comment for this version

Summary

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:**
... ... @@ -167,31 +167,19 @@
167 167  
168 168  [[image:1652953414711-647.png||height="337" width="723"]]
169 169  
170 -(((
171 171  The RS485-BL in this example connected to two RS485 devices for demonstration, user can connect to other RS485 devices via the same method.
172 -)))
173 173  
174 -(((
175 175  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:
176 -)))
177 177  
178 -(((
179 179  **Step 1**: Create a device in TTN V3 with the OTAA keys from RS485-BL.
180 -)))
181 181  
182 -(((
183 183  Each RS485-BL is shipped with a sticker with unique device EUI:
184 -)))
185 185  
186 186  [[image:1652953462722-299.png]]
187 187  
188 -(((
189 189  User can enter this key in their LoRaWAN Server portal. Below is TTN V3 screen shot:
190 -)))
191 191  
192 -(((
193 193  Add APP EUI in the application.
194 -)))
195 195  
196 196  
197 197  
... ... @@ -219,182 +219,140 @@
219 219  
220 220  [[image:1652953568895-172.png||height="232" width="724"]]
221 221  
222 -== 3.3 Configure Commands to read data ==
223 223  
224 -(((
211 +
212 +
213 +1.
214 +11. Configure Commands to read data
215 +
225 225  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.
226 -)))
227 227  
228 -=== 3.3.1 onfigure UART settings for RS485 or TTL communication ===
229 229  
219 +1.
220 +11.
221 +111. Configure UART settings for RS485 or TTL communication
222 +
230 230  RS485-BL can connect to either RS485 sensors or TTL sensor. User need to specify what type of sensor need to connect.
231 231  
232 -**~1. RS485-MODBUS mode:**
225 +1. RS485-MODBUS mode:
233 233  
234 234  AT+MOD=1 ~/~/ Support RS485-MODBUS type sensors. User can connect multiply RS485 , Modbus sensors to the A / B pins.
235 235  
236 -**2. TTL mode:**
237 237  
230 +1. TTL mode:
231 +
238 238  AT+MOD=2 ~/~/ Support TTL Level sensors, User can connect one TTL Sensor to the TXD/RXD/GND pins.
239 239  
234 +
240 240  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.
241 241  
242 -(% border="1" style="background-color:#ffffcc; color:green; width:795px" %)
243 -|(((
244 -**AT Commands**
245 -)))|(% style="width:285px" %)(((
246 -**Description**
247 -)))|(% style="width:347px" %)(((
248 -**Example**
249 -)))
250 -|(((
251 -AT+BAUDR
252 -)))|(% style="width:285px" %)(((
253 -Set the baud rate (for RS485 connection). Default Value is: 9600.
254 -)))|(% style="width:347px" %)(((
255 -(((
237 +
238 +|**AT Commands**|**Description**|**Example**
239 +|AT+BAUDR|Set the baud rate (for RS485 connection). Default Value is: 9600.|(((
256 256  AT+BAUDR=9600
257 -)))
258 258  
259 -(((
260 260  Options: (1200,2400,4800,14400,19200,115200)
261 261  )))
262 -)))
263 -|(((
264 -AT+PARITY
265 -)))|(% style="width:285px" %)(((
266 -(((
244 +|AT+PARITY|(((
267 267  Set UART parity (for RS485 connection)
268 -)))
269 269  
270 -(((
271 271  Default Value is: no parity.
272 -)))
273 -)))|(% style="width:347px" %)(((
274 -(((
248 +)))|(((
275 275  AT+PARITY=0
276 -)))
277 277  
278 -(((
279 279  Option: 0: no parity, 1: odd parity, 2: even parity
280 280  )))
281 -)))
282 -|(((
283 -AT+STOPBIT
284 -)))|(% style="width:285px" %)(((
285 -(((
253 +|AT+STOPBIT|(((
286 286  Set serial stopbit (for RS485 connection)
287 -)))
288 288  
289 -(((
290 290  Default Value is: 1bit.
291 -)))
292 -)))|(% style="width:347px" %)(((
293 -(((
257 +)))|(((
294 294  AT+STOPBIT=0 for 1bit
295 -)))
296 296  
297 -(((
298 298  AT+STOPBIT=1 for 1.5 bit
299 -)))
300 300  
301 -(((
302 302  AT+STOPBIT=2 for 2 bits
303 303  )))
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" %)(((
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|(((
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,
281 +AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m
322 322  
323 -mm: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command
324 -)))|(% style="width:256px" %)AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m
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
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 -(((
289 +
290 +
291 +
292 +1.
293 +11.
294 +111. Configure read commands for each sampling
295 +
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 -(((
298 +
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 -(((
301 +
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 -(((
304 +
343 343  This section describes how to achieve above goals.
344 -)))
345 345  
346 -(((
307 +
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 -(((
310 +
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 -(((
315 +
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 -(((
321 +* **AT+DATACUT**
322 +
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 -(((
326 +* **AT+SEARCH**
327 +
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 -(((
330 +
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 -(((
335 +
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  
338 +
394 394  **Examples:**
395 395  
396 396  Below are examples for the how above AT Commands works.
397 397  
343 +
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 400  |(((
... ... @@ -409,6 +409,7 @@
409 409  
410 410  In the RS485-BL, we should use this command AT+COMMAND1=01 03 0B B8 00 02,1 for the same.
411 411  
358 +
412 412  **AT+SEARCHx**: This command defines how to handle the return from AT+COMMANDx.
413 413  
414 414  |(((
... ... @@ -489,7 +489,7 @@
489 489  
490 490  
491 491  1.
492 -11.
439 +11.
493 493  111. Compose the uplink payload
494 494  
495 495  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.**
... ... @@ -553,8 +553,8 @@
553 553  
554 554  
555 555  
556 -1.
557 -11.
503 +1.
504 +11.
558 558  111. Uplink on demand
559 559  
560 560  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.
... ... @@ -567,8 +567,8 @@
567 567  
568 568  
569 569  
570 -1.
571 -11.
517 +1.
518 +11.
572 572  111. Uplink on Interrupt
573 573  
574 574  Put the interrupt sensor between 3.3v_out and GPIO ext.[[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image022.png]]
... ... @@ -582,7 +582,7 @@
582 582  AT+INTMOD=3  Interrupt trigger by rising edge.
583 583  
584 584  
585 -1.
532 +1.
586 586  11. Uplink Payload
587 587  
588 588  |**Size(bytes)**|**2**|**1**|**Length depends on the return from the commands**
... ... @@ -644,15 +644,15 @@
644 644  
645 645  * **Sensor Related Commands**: These commands are special designed for RS485-BL.  User can see these commands below:
646 646  
647 -1.
648 -11.
594 +1.
595 +11.
649 649  111. Common Commands:
650 650  
651 651  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]]
652 652  
653 653  
654 -1.
655 -11.
601 +1.
602 +11.
656 656  111. Sensor related commands:
657 657  
658 658  ==== Choose Device Type (RS485 or TTL) ====
... ... @@ -958,13 +958,13 @@
958 958  
959 959  
960 960  
961 -1.
908 +1.
962 962  11. Buttons
963 963  
964 964  |**Button**|**Feature**
965 965  |**RST**|Reboot RS485-BL
966 966  
967 -1.
914 +1.
968 968  11. +3V3 Output
969 969  
970 970  RS485-BL has a Controllable +3V3 output, user can use this output to power external sensor.
... ... @@ -982,7 +982,7 @@
982 982  By default, the AT+3V3T=0. This is a special case, means the +3V3 output is always on at any time
983 983  
984 984  
985 -1.
932 +1.
986 986  11. +5V Output
987 987  
988 988  RS485-BL has a Controllable +5V output, user can use this output to power external sensor.
... ... @@ -1002,13 +1002,13 @@
1002 1002  
1003 1003  
1004 1004  
1005 -1.
952 +1.
1006 1006  11. LEDs
1007 1007  
1008 1008  |**LEDs**|**Feature**
1009 1009  |**LED1**|Blink when device transmit a packet.
1010 1010  
1011 -1.
958 +1.
1012 1012  11. Switch Jumper
1013 1013  
1014 1014  |**Switch Jumper**|**Feature**
... ... @@ -1054,7 +1054,7 @@
1054 1054  
1055 1055  
1056 1056  
1057 -1.
1004 +1.
1058 1058  11. Common AT Command Sequence
1059 1059  111. Multi-channel ABP mode (Use with SX1301/LG308)
1060 1060  
... ... @@ -1073,8 +1073,8 @@
1073 1073  
1074 1074  ATZ
1075 1075  
1076 -1.
1077 -11.
1023 +1.
1024 +11.
1078 1078  111. Single-channel ABP mode (Use with LG01/LG02)
1079 1079  
1080 1080  AT+FDR   Reset Parameters to Factory Default, Keys Reserve
... ... @@ -1149,7 +1149,7 @@
1149 1149  [[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]]
1150 1150  
1151 1151  
1152 -1.
1099 +1.
1153 1153  11. How to change the LoRa Frequency Bands/Region?
1154 1154  
1155 1155  User can follow the introduction for [[how to upgrade image>>path:#upgrade_image]]. When download the images, choose the required image file for download.
... ... @@ -1156,7 +1156,7 @@
1156 1156  
1157 1157  
1158 1158  
1159 -1.
1106 +1.
1160 1160  11. How many RS485-Slave can RS485-BL connects?
1161 1161  
1162 1162  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]].
... ... @@ -1173,7 +1173,7 @@
1173 1173  
1174 1174  
1175 1175  
1176 -1.
1123 +1.
1177 1177  11. Why I can’t join TTN V3 in US915 /AU915 bands?
1178 1178  
1179 1179  It might about the channels mapping. Please see for detail.
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0