Logic Machine Forum
Is it possible to sniff Modbus RTU line using LM? - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Is it possible to sniff Modbus RTU line using LM? (/showthread.php?tid=5053)



Is it possible to sniff Modbus RTU line using LM? - fleeceable - 24.10.2023

I have project where is installed six Solis 100K-5G inverters and one Solis EPM (Export Power Manager). Inverters are slave and EPM is master what polls information from inverters.
Since Solis EPM does not have Modbus slave functionality it's not possible to integrate it to third party controllers.

If we start to communicate directly with inverters (while EPM is also master), there will be collision and probably a lot of errors/problems.
If we remove EPM then it's not possible to send information to Solis Cloud and customer + service partners don't see information about this plant.

Now my idea is to connect LM into inverter Modbus RTU line and just listen + parse traffic. Is it possible to archive?

So LogicMachine is transparent device on that line.
I'm gonna add picture to show my idea.


RE: Is it possible to sniff Modbus RTU line using LM? - admin - 25.10.2023

Lua Modbus library has receive() function that returns a single Modbus data package. Then you will have to parse the response manually to get actual data out of it.
Universal Modbus slave example has some code that you can reuse: https://forum.logicmachine.net/showthread.php?tid=4288


RE: Is it possible to sniff Modbus RTU line using LM? - fleeceable - 25.10.2023

Thanks for reply.
Gonna try to play with code to create "modbus monitor script" but probably found a better solution. I'm gonna post device here so maybe it helps someone else as well if you need two masters to communicate with one/multible slaves.
https://shop.marcomweb.it/en/shop-online/fieldbus/modbus-tcp-rtu/tsh-735-cr-isolated-shared-serial-port-with-a-poe-port-e-3-porte-rs-485-dettagli.html

Main advantages with this device is that you can control polling interval and update data as you need.