Modbus RTU transparent proxy

Does anyone here have an example, or can put me in touch with someone, with a working example of Modbus RTU transparent proxy using RPi and Node-Red? I'd like to monitor RS485 metering data. Increased latency will not be a problem. TIA

Node-Red v3.0.2 nodejs 12.22.12~dfsg-1~deb11u4

Sorry so why do you need a Proxy ? You can get a USB-RS485 adapter or a Modbus TCP/RTU box to enable a Pi to talk to RS485 based devices.

Craig

Need to inject master requests into an existing Modbus serial channel. This needs to be transparent to the existing master and slaves.

So need to copy all master requests from one channel to another, then pass the slave responses back the other way. Sometimes make additional, small requests of the slaves meanwhile buffering original master requests to avoid collisions.

I hope that makes sense.

Yes that does - so you want more of a man in the middle approach

  1. Modbus is an open bus so you can infact attach to it and just listen to all messages.
  2. Injection is harder as you can only have a single modbus master

What many people do (for various reasons - but usually - (where my interest is) to intercept and emulate Grid energy meter readers for Solar installs - is to outfit a Rpi with dual RS485 bus links.

They can act as the master on one bus (such as the one asking for data from the slave) and listen for requests as the emulated slave on the other bus.

This is easily done in Python - just do a search for MITM modbus/RS485 and you should be able to get there quite easily - especially with AI to do most of the coding for you

I also believe that Waveshare makes a device that allows multiple modbus masters - but have not had experience with that.

I have a device called the IONINJA that lets you sit on the bus and intercept and decode all requests - which is useful if you are trying to emulate a device.

Craig