User Manual
www.dragino.com
RS485 to LoRaWAN Converter User Manual 11 / 29
3.3 Configure Commands to read data
There are plenty of RS485 devices in the market and each device has different command to read
the valid data. To support these devices in flexible, RS485-LN supports flexible command set.
User can use AT Commands to configure what commands RS485-LN should send for each
sampling and how to handle the output from RS485 devices.
The AT Commands include:
AT Commands
Description
Example
AT+BAUDR
Set the baud rate to communicate with RS485
device. Default Value is: 9600.
AT+BAUDR=9600
Options:
(1200,2400,4800,14400,19200,115200)
AT+CFGDEV
This command is used to configure the RS485
devices; they won’t be used during sampling.
AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,m
m: 0: no CRC, 1: add CRC-16/MODBUS in the
end of this command
AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx
xx xx,m
AT+COMMAND1
This command will be sent to RS485 devices
during each sampling.
AT+COMMAND1=xx xx xx xx xx xx xx xx xx xx xx
xx,m
m: 0: no CRC, 1: add CRC-16/MODBUS in the
end of this command
AT+DATACUT1
Get valid data from COMMAND1 return
AT+DATACUT1=a,b,c:
a: total length of return string.
b: start position for valid string.
c: stop position of valid string.
If return1 is:
01 02 01 20 a0 00
AT+DATACUT1=6,4,4 will get the 4
th
byte, which is 0x20
AT+COMMAND2
This command will be sent to RS485 devices
during each sampling.
AT+COMMAND2=xx xx xx xx xx xx xx xx xx xx xx
xx,m
m: 0: no CRC, 1: add CRC-16/MODBUS in the
end of this command
AT+DATACUT2
Get valid data from COMMAND2 return
AT+DATACUT2=a,b,c:
a: total length of return string.
b: start position for valid string.
c: stop position of valid string.
If return2 is:
01 01 01 00 a0 00
AT+DATACUT2=6,4,4 will get the 4
th
byte, which is 0x20
AT+DATAUP
Connect the result of Command1 and Command2:
AT+DATAUP=x[:pre[:suf]], y[:pre[:suf]]
x,y:valid payload from command x,y
pre: Add prefix