AdvancedClimateSystems / uModbus

Python implementation of the Modbus protocol.
Mozilla Public License 2.0
211 stars 81 forks source link

Read Multiple Hosts #107

Open shnabin opened 3 years ago

shnabin commented 3 years ago

Hi,

I need help with the following 2 points.

  1. Is it possible to connect to multiple hosts in one instance, (Ex: Server IP : 192.168.1.1 , Client IP : 192.168.1.2, 192.168.1.3, etc), If its possible kindly provide an example.
  2. From point 1, once I read the data from multiple clients, can I act as modbus server/gateway and give the data to other devices.
    Ex: 192.168.1.2 (host/client) --> (server) 192.168.1.1 (client/host) --> 192.168.10.2. If its possible kindly provide an example.

Appreciate your help. Thank you !!

OrangeTux commented 3 years ago

1) Yes. Multiple clients can connect to the same server. Just copy the `sample client to all your hosts and run them. 2) Yes, that is also possible.

jaapz commented 3 years ago
  1. is possible but you'll have to write some "glue code" yourself. you can set up a umodbus server that handles reads and writes and proxies those to another umodbus client instance

Currently we don't have example code for this but if you understand how the server and client work, that should be relatively trivial to implement.