Milesight LoRaWAN controllers support the function that Modbus RS485 bridge LoRaWAN, which can transparent Modbus RTU commands and send Modbus reply originally back to network server. This article describes how to use Modbus RS485 bridge LoRaWAN.
- Milesight LoRaWAN Controller: UC50X Series/UC11XX/UC11-N1
- Milesight LoRaWAN Gateway: work as network server
- RS485 terminal device
- Connect RS485 terminal device to LoRaWAN Controller.
Connect Milesight controller to LoRaWAN network server. If you use Milesight gateway embedded network server, please refer to this article: How to Connect LoRaWAN Node/Sensor to Milesight Gateway.
Go to General -> Serial enable serial via Toolbox, set RS485(Modbus Master) as interface type, enable Modbus RS485 bridge LoRaWAN feature and define a transfer port, select from 2-84,86-223. In this example we configure the port as 123.
Login gateway’s Web GUI, go to Network Server -> Packets -> Send Data To Device, fill in the controller Device EUI and port 123, send the Modbus RTU read/write command to it, In this example we send 010300000001840A as read command to read humidity value of RS485 terminal devices, then controller will transparent this command to RS485 terminal devices.
If device type is Class C, the controller will receive downlink messages right away;
if device type is Class A, the downlink message will wait in queue (grey) until there is uplink from controller.
Go to Network Server -> Packets -> Network Server, you will see Modbus RTU reply immediately.