Modbus is a de facto standard, truly open and the most widely used network protocol in the industrial manufacturing environment.-ref Modbus Faqs
Because of its popularity there is a growing requirement for reading data and controlling Modbus devices over TCP/IP networks using MQTT.
The aim of this project is to create a node-red dashboard to send and receive data to modbus devices.
The project is based on real flows that I have developed for electricity monitoring.
I will be using a modbus simulator to simulate a modbus TCP/IP device and the modbus node-red nodes.
You will need to install the modbus nodes by going to menu > manage Pallete and search for node-red-contrib-modbus and install .
There are 13 nodes that are installed and appear under their own category in the node palette.
You will also need a modbus device.
I will use the modbus simulator available for free here.
You should also have a basic knowledge of modbus.
I didn’t know anything about it when I started with my first project and so I had to do a lot of research.
I created a page of my notes along with useful links to resources that I found useful. See Modbus working notes
The following three videos
Introduce you to the Modbus Nodes
Show you how to Convert various modbus payloads into Integers,floats etc.
The final video show you how to send and receive data from MQTT to Modbus.