Description

Milesight LoRaWAN controllers support the function that Modbus RS485 bridge LoRaWAN, which can work as a relay to set up communication between the server and RS485 Modbus devices. Milesight LoRaWAN controller supports two pass-through modes for this feature:

Active Pass-through: the network server can send any command to the RS485 device and the RS485 device can only react according to server commands.

Two-way Pass-through: not only can network server send any command to the RS485 device, but also the RS485 device supports transmitting the data to the network server actively.

Note: 

1) When Two-way Pass-through is enabled, Modbus channels can’t be used and the corresponding IF-THEN command will not work.

2) Only UC100 and UC300 supports this mode now.


This article will take active-passthrough to describe how to use Modbus RS485 bridge LoRaWAN.


Requirement


  • Milesight LoRaWAN Controller: UC50X Series/UC11XX/UC11-N1
  • Milesight LoRaWAN Gateway: work as network server
  • RS485 terminal device


Configuration

  1. Connect RS485 terminal device to LoRaWAN Controller.
  2. 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.
  3. Set interface type as RS485(Modbus Master) , enable Modbus RS485 bridge LoRaWAN feature and define a transfer port selecting from 2-84,86-223. In this example we configure the port as 123. (The mode is fixed as Active Pass-through if there is not Pass-through Mode option)
  4. 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. Command description: 

    Server ID (slave ID)

    Function Code

    Starting Address (High)

    Starting Address (Low)

    Quantity of Register (High)

    Quantity of Register (Low)

    CRC

    01

    03

    00

    00

    00

    01

    840A


Note: 

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.

5. Go to Network Server > Packets > Network Server, you will see Modbus RTU reply from RS485 terminal device.

Reply description:

Server ID 

(slave ID)

Function Code

Data Length

Data

CRC

01

03

02=2 Bytes

0237

F8F2



                                                                              ----END- --