User's Manual

www.dragino.com
RS485 to LoRaWAN Converter User Manual 16 / 30
3.3.3 Configure read commands for each sampling
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.
To save the LoRaWAN network bandwidth, we might need to read data from different sensors
and combine their valid value into a short payload.
This section describes how to achieve above goals.
During each sampling, the RS485-LN can support 15 commands to read sensors. And combine the
return to one or several uplink payloads.
Each RS485 commands include two parts:
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.
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.
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
AT+CMDDL1=1000 to send the open time to 1000ms
After we got the valid value from each RS485 commands, we need to combine them together
with the command AT+DATAUP.
Below are examples for the how above AT Commands works.
AT+COMMANDx : This command will be sent to RS485 devices during each sampling, Max
command length is 14 bytes. The grammar is:
AT+COMMANDx=xx xx xx xx xx xx xx xx xx xx xx xx,m
xx xx xx xx xx xx xx xx xx xx xx xx: The RS485 command to be sent
m: 0: no CRC, 1: add CRC-16/MODBUS in the end of this command
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.