User Manual for LoRaWAN End Nodes - RS485-LN – RS485 to LoRaWAN Converter User Manual
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
LoRaWAN Downlink Command to configure what commands RS485-LN should send for each sampling and how to
handle the return from RS485 devices.
Note: below description and commands are for firmware version >v1.1, if you have firmware version v1.0. Please
check the
or upgrade the firmware to v1.1
3.3.1 onfigure UART settings for RS485 or TTL communication
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:
AT Commands
Description
Example
AT+BAUDR
Set the baud rate (for RS485 connection). Default
Value is: 9600.
AT+BAUDR=9600
Options: (1200,2400,4800,14400,19200,115200)
AT+PARITY
Set UART parity (for RS485 connection)
AT+PARITY=0
Option: 0: no parity, 1: odd parity, 2: even parity
AT+STOPBIT
Set serial stopbit (for RS485 connection)
AT+STOPBIT=0 for 1bit
AT+STOPBIT=1 for 1.5 bit
AT+STOPBIT=2 for 2 bits
3.3.2 Configure sensors
Some sensors might need to configure before normal operation. User can configure such sensor via PC and
RS485 adapter or through RS485-LN AT Commands
AT+CFGDEV
. Each
AT+CFGDEV
equals to send a RS485
command to sensors. This command will only run when user input it and won’t run during each sampling.
AT Commands
Description
Example
AT+CFGDEV
This command is used to configure the RS485/
TTL devices; they won’t be used during sampling.
AT+CFGDEV=xx xx xx xx xx xx xx xx xx xx xx xx,
mm: 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
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.
Page 16 / 38 - last modified by Bei Jinggeng on 2022/07/08 16:50