Modbus-IoT (Modbus over MQTT)

Modbus?? old school protocol (more than 40th years).

when Modbus created, it was created for Serial communication via RS485. after year by year, technology was changing and ethernet / TCP widely used in PLC and industrial control system, then Modbus move their medium to Ethernet and wrap their message in TCP (encapsulated) over ethernet.

Now, when everything going to the cloud or  RTU/PLC are not in the same place with SCADA and it only have internet connection, it will be hard and expensive for Modbus to keep exist in Internet area. because we need at least public IP for each device, or creating VPN.

but with MQTT the message can be send over the broker (on the cloud), so it will be exiting if modbus can be sent through MQTT.

if you’ve heard about Node-red this is cool IoT tools/platform built in NodeJS.

I’m using Node-red to make it’s encapsulation, and Modscan as Modbus Master (or SCADA), and Modsim as Modbus Slave (or  PLC)

in this case I make 2 pipe Connection Topic, 1 for requesting Message, and the other for respond.

Modbus Request -> TCP -> MQTT Publish (topic 1) -> MQTT Broker -> MQTT Subscribe (topic 1) -> TCP -> Modbus request

then reply to other pipe

Modbus Response -> TCP -> MQTT Publish (topic 2) -> MQTT Broker -> MQTT Subscribe (topic 2) -> TCP -> Modbus Response


Leave a Reply

Your email address will not be published. Required fields are marked *