Giter VIP home page Giter VIP logo

modbus-proxy's Introduction

ModBus TCP proxy

ModBus proxy Python Versions Pypi status License CI

Many modbus devices support only one or very few clients. This proxy acts as a bridge between the client and the modbus device. It can be seen as a layer 7 reverse proxy. This allows multiple clients to communicate with the same modbus device.

When multiple clients are connected, cross messages are avoided by serializing communication on a first come first served REQ/REP basis.

Installation

From within your favorite python 3 environment type:

$ pip install modbus-proxy

Note: On some systems pip points to a python 2 installation. You might need to use pip3 command instead.

Additionally, if you want logging configuration:

  • YAML: pip install modbus-proxy[yaml] (see below)
  • TOML: pip install modbus-proxy[toml] (see below)

Running the server

First, you will need write a configuration file where you specify for each modbus device you which to control:

  • modbus connection (the modbus device url)
  • listen interface (to which url your clients should connect)

Configuration files can be written in YAML (.yml or .yaml) or TOML (.toml).

Suppose you have a PLC modbus device listening on plc1.acme.org:502 and you want your clients to connect to your machine on port 9000. A YAML configuration would look like this:

devices:
- modbus:
    url: plc1.acme.org:502     # device url (mandatory)
    timeout: 10                # communication timeout (s) (optional, default: 10)
    connection_time: 0.1       # delay after connection (s) (optional, default: 0)
  listen:
    bind: 0:9000               # listening address (mandatory)

Assuming you saved this file as modbus-config.yml, start the server with:

$ modbus-proxy -c ./modbus-config.yml

Now, instead of connecting your client(s) to plc1.acme.org:502 you just need to tell them to connect to *machine*:9000 (where machine is the host where modbus-proxy is running).

Note that the server is capable of handling multiple modbus devices. Here is a configuration example for 2 devices:

devices:
- modbus:
    url: plc1.acme.org:502
  listen:
    bind: 0:9000
- modbus:
    url: plc2.acme.org:502
  listen:
    bind: 0:9001

If you have a single modbus device, you can avoid writting a configuration file by providing all arguments in the command line:

modbus-proxy -b tcp://0:9000 --modbus tcp://plc1.acme.org:502

(hint: run modbus-proxy --help to see all available options)

Running the examples

To run the examples you will need to have umodbus installed (do it with pip install umodbus).

Start the simple_tcp_server.py (this will simulate an actual modbus hardware):

$ python examples/simple_tcp_server.py -b :5020

You can run the example client just to be sure direct communication works:

$ python examples/simple_tcp_client.py -a 0:5020
holding registers: [1, 2, 3, 4]

Now for the real test:

Start a modbus-proxy bridge server with:

$ modbus-proxy -b tcp://:9000 --modbus tcp://:5020

Finally run a the example client but now address the proxy instead of the server (notice we are now using port 9000 and not 5020):

$ python examples/simple_tcp_client.py -a 0:9000
holding registers: [1, 2, 3, 4]

Running as a Service

  1. move the config file to a location you can remember, for example: to /usr/lib/mproxy-conf.yaml
  2. go to /etc/systemd/system/
  3. use nano or any other text editor of your choice to create a service file mproxy.service
  4. the file should contain the following information:
[Unit]
Description=Modbus-Proxy
After=network.target

[Service]
Type=simple
Restart=always
ExecStart = modbus-proxy -c ./usr/lib/mproxy-conf.yaml

[Install]
WantedBy=multi-user.target
  1. run systemctl daemon-reload
  2. systemctl enable mproxy.service
  3. systemctl start mproxy.service

The file names given here are examples, you can choose other names, if you wish.

Docker

This project ships with a basic Dockerfile which you can use as a base to launch modbus-proxy inside a docker container.

First, build the docker image with:

$ docker build -t modbus-proxy .

To bridge a single modbus device without needing a configuration file is straight forward:

$ docker run -d -p 5020:502 modbus-proxy -b tcp://0:502 --modbus tcp://plc1.acme.org:502

Now you should be able to access your modbus device through the modbus-proxy by connecting your client(s) to <your-hostname/ip>:5020.

If, instead, you want to use a configuration file, you must mount the file so it is visible by the container.

Assuming you have prepared a conf.yml in the current directory:

devices:
- modbus:
    url: plc1.acme.org:502
  listen:
    bind: 0:502

Here is an example of how to run the container:

docker run -p 5020:502 -v $PWD/conf.yml:/src/conf.yml modbus-proxy -c /src/conf.yml

Note that for each modbus device you add in the configuration file you need to publish the corresponding bind port on the host (-p <host port>:<container port> argument).

Logging configuration

Logging configuration can be added to the configuration file by adding a new logging keyword.

The logging configuration will be passed to logging.config.dictConfig() so the file contents must obey the Configuration dictionary schema.

Here is a YAML example:

devices:
- modbus:
    url: plc1.acme.org:502
  listen:
    bind: 0:9000
logging:
  version: 1
  formatters:
    standard:
      format: "%(asctime)s %(levelname)8s %(name)s: %(message)s"
  handlers:
    console:
      class: logging.StreamHandler
      formatter: standard
  root:
    handlers: ['console']
    level: DEBUG

--log-config-file (deprecated)

Logging configuration file.

If a relative path is given, it is relative to the current working directory.

If a .conf or .ini file is given, it is passed directly to logging.config.fileConfig() so the file contents must obey the Configuration file format.

A simple logging configuration (also available at log.conf) which mimics the default configuration looks like this:

[formatters]
keys=standard

[handlers]
keys=console

[loggers]
keys=root

[formatter_standard]
format=%(asctime)s %(levelname)8s %(name)s: %(message)s

[handler_console]
class=StreamHandler
formatter=standard

[logger_root]
level=INFO
handlers=console

A more verbose example logging with a rotating file handler: log-verbose.conf

The same example above (also available at log.yml) can be achieved in YAML with:

version: 1
formatters:
  standard:
    format: "%(asctime)s %(levelname)8s %(name)s: %(message)s"
handlers:
  console:
    class: logging.StreamHandler
    formatter: standard
root:
  handlers: ['console']
  level: DEBUG

Credits

Development Lead

Contributors

None yet. Why not be the first?

modbus-proxy's People

Contributors

christophcaina avatar dwrobel avatar tiagocoutinho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modbus-proxy's Issues

OSError: [Errno 24] Too many open files

  • ModBus TCP proxy version: 0.6.8
  • Python version: 3.10.8
  • Operating System: FedoraServer 36

Description

Here is my configuration:

# cat /etc/modbus-proxy.yaml 
devices:
- modbus:
    url: 192.168.160.202:502
    timeout: 10
    connection_time: 1.0
  listen:
    bind: 0:5502

- modbus:
    url: 192.168.160.57:502
    timeout: 10
    connection_time: 0.0
  listen:
    bind: 0:5503

There is a device A behind 192.168.160.202:502 which is powered on and responses to the requests while the 192.168.160.57:502 is connected to the https://github.com/arendst/Tasmota which works as a Modbus TCP to RTU converter. There are two devices B and C connected to the serial port of Tasmota and B is powered on while C is not (it's intentional).

There are three Modbus to MQTT clients: M1, M2 and M3 which in a loop asks every 5 seconds for a data from devices A, B and C. It is expected that client which connects to device C will observe permanent connection error while it's not expected that it will leak resources (sockets).

What I Did

# systemctl status  modbus-proxy.service
● modbus-proxy.service - ModBus TCP proxy
     Loaded: loaded (/usr/lib/systemd/system/modbus-proxy.service; enabled; vendor preset: disabled)
     Active: active (running) since Sun 2022-11-27 00:56:13 CET; 2 weeks 4 days ago
       Docs: https://github.com/tiagocoutinho/modbus-proxy
   Main PID: 797 (modbus-proxy)
      Tasks: 3 (limit: 9114)
     Memory: 33.8M
        CPU: 1w 13h 30min 7.744s
     CGroup: /system.slice/modbus-proxy.service
             └─ 797 /usr/bin/python3 -s /usr/bin/modbus-proxy --config-file /etc/modbus-proxy.yaml

Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]:   File "/usr/lib64/python3.10/socket.py", line 293, in accept
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: OSError: [Errno 24] Too many open files
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: 2022-12-15 11:09:20,161    ERROR asyncio: socket.accept() out of system resource
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: socket: <asyncio.TransportSocket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 5502)>
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: Traceback (most recent call last):
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]:   File "/usr/lib64/python3.10/asyncio/selector_events.py", line 159, in _accept_connection
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]:   File "/usr/lib64/python3.10/socket.py", line 293, in accept
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: OSError: [Errno 24] Too many open files
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: 2022-12-15 11:09:20,162    ERROR asyncio: socket.accept() out of system resource
Dec 15 11:09:20 localhost.localdomain modbus-proxy[797]: socket: <asyncio.TransportSocket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 5502)>
# lsof -n -i -P | grep 797 | grep CLOSE_WAIT | head -n 8
modbus-pr    797       root    8u  IPv4 5846232      0t0  TCP 192.168.160.160:5503->192.168.160.160:48876 (CLOSE_WAIT)
modbus-pr    797       root    9u  IPv4 5842665      0t0  TCP 192.168.160.160:5503->192.168.160.160:34496 (CLOSE_WAIT)
modbus-pr    797       root   10u  IPv4 5854117      0t0  TCP 192.168.160.160:5503->192.168.160.160:48014 (CLOSE_WAIT)
modbus-pr    797       root   11u  IPv4 5832205      0t0  TCP 192.168.160.160:5503->192.168.160.160:44668 (CLOSE_WAIT)
modbus-pr    797       root   12u  IPv4 5838077      0t0  TCP 192.168.160.160:5503->192.168.160.160:54076 (CLOSE_WAIT)
modbus-pr    797       root   13u  IPv4 5849528      0t0  TCP 192.168.160.160:5503->192.168.160.160:56412 (CLOSE_WAIT)
modbus-pr    797       root   14u  IPv4 5850827      0t0  TCP 192.168.160.160:5503->192.168.160.160:38014 (CLOSE_WAIT)
modbus-pr    797       root   15u  IPv4 5860437      0t0  TCP 192.168.160.160:5503->192.168.160.160:44496 (CLOSE_WAIT)

Crashing very often

  • ModBus TCP proxy version: latest
  • Python version: 3.5.3
  • Operating System: Debian 9.13

Description

It crashing very often. Now I made a script to start it again, so you can see how often starting it again because of crash:
2021-12-08 20:21:16,260 INFO modbus-proxy: Starting...
2021-12-09 04:02:58,291 INFO modbus-proxy: Starting...
2021-12-09 11:22:36,333 INFO modbus-proxy: Starting...
2021-12-09 11:23:09,014 INFO modbus-proxy: Starting...
2021-12-09 11:23:43,948 INFO modbus-proxy: Starting...
2021-12-09 11:23:53,006 INFO modbus-proxy: Starting...
2021-12-09 11:24:32,073 INFO modbus-proxy: Starting...
2021-12-09 11:25:01,598 INFO modbus-proxy: Starting...
2021-12-09 11:26:02,074 INFO modbus-proxy: Starting...
2021-12-09 11:26:10,315 INFO modbus-proxy: Starting...
2021-12-09 11:26:19,340 INFO modbus-proxy: Starting...
2021-12-09 11:27:28,007 INFO modbus-proxy: Starting...
2021-12-09 11:28:02,084 INFO modbus-proxy: Starting...
2021-12-09 11:28:36,598 INFO modbus-proxy: Starting...
2021-12-09 11:28:45,659 INFO modbus-proxy: Starting...
2021-12-09 11:29:32,091 INFO modbus-proxy: Starting...
2021-12-09 11:29:54,347 INFO modbus-proxy: Starting...
2021-12-09 11:31:02,118 INFO modbus-proxy: Starting...
2021-12-09 11:31:08,986 INFO modbus-proxy: Starting...
2021-12-09 11:32:17,690 INFO modbus-proxy: Starting...
2021-12-09 11:32:26,692 INFO modbus-proxy: Starting...
2021-12-09 11:32:29,820 INFO modbus-proxy: Starting...
2021-12-09 11:33:32,377 INFO modbus-proxy: Starting...
2021-12-09 11:34:02,104 INFO modbus-proxy: Starting...
2021-12-09 11:34:40,983 INFO modbus-proxy: Starting...
2021-12-09 11:34:50,063 INFO modbus-proxy: Starting...
2021-12-09 11:35:32,090 INFO modbus-proxy: Starting...
2021-12-09 11:35:58,748 INFO modbus-proxy: Starting...
2021-12-09 11:37:02,109 INFO modbus-proxy: Starting...
2021-12-09 11:37:05,172 INFO modbus-proxy: Starting...
2021-12-09 11:37:13,413 INFO modbus-proxy: Starting...
2021-12-09 11:38:22,082 INFO modbus-proxy: Starting...
2021-12-09 11:38:31,046 INFO modbus-proxy: Starting...
2021-12-09 11:39:36,747 INFO modbus-proxy: Starting...
2021-12-09 11:40:02,162 INFO modbus-proxy: Starting...
2021-12-09 11:40:45,386 INFO modbus-proxy: Starting...
2021-12-09 11:40:54,435 INFO modbus-proxy: Starting...
2021-12-09 11:41:32,117 INFO modbus-proxy: Starting...
2021-12-09 11:42:03,054 INFO modbus-proxy: Starting...
2021-12-09 11:43:02,114 INFO modbus-proxy: Starting...
2021-12-09 11:43:11,722 INFO modbus-proxy: Starting...
2021-12-09 11:43:20,764 INFO modbus-proxy: Starting...
2021-12-09 11:44:29,422 INFO modbus-proxy: Starting...
2021-12-09 11:45:38,015 INFO modbus-proxy: Starting...
2021-12-09 11:45:47,085 INFO modbus-proxy: Starting...
2021-12-09 11:46:02,148 INFO modbus-proxy: Starting...
2021-12-09 11:46:55,756 INFO modbus-proxy: Starting...
2021-12-09 11:47:32,133 INFO modbus-proxy: Starting...
2021-12-09 11:48:04,427 INFO modbus-proxy: Starting...
2021-12-09 11:48:13,454 INFO modbus-proxy: Starting...
2021-12-09 11:49:02,196 INFO modbus-proxy: Starting...
2021-12-09 11:49:22,140 INFO modbus-proxy: Starting...
2021-12-09 11:50:30,799 INFO modbus-proxy: Starting...
2021-12-09 11:50:39,766 INFO modbus-proxy: Starting...
2021-12-09 11:51:48,471 INFO modbus-proxy: Starting...
2021-12-09 11:52:02,148 INFO modbus-proxy: Starting...
2021-12-09 11:52:57,093 INFO modbus-proxy: Starting...
2021-12-09 11:53:06,117 INFO modbus-proxy: Starting...
2021-12-09 11:53:32,206 INFO modbus-proxy: Starting...
2021-12-09 11:54:14,733 INFO modbus-proxy: Starting...
2021-12-09 11:55:02,164 INFO modbus-proxy: Starting...
2021-12-09 11:55:23,488 INFO modbus-proxy: Starting...
2021-12-09 11:55:32,483 INFO modbus-proxy: Starting...
2021-12-09 11:56:32,122 INFO modbus-proxy: Starting...
2021-12-09 11:56:41,110 INFO modbus-proxy: Starting...
2021-12-09 11:57:49,733 INFO modbus-proxy: Starting...
2021-12-09 11:57:58,758 INFO modbus-proxy: Starting...
2021-12-09 11:58:32,156 INFO modbus-proxy: Starting...
2021-12-09 11:59:07,435 INFO modbus-proxy: Starting...
2021-12-09 12:00:02,185 INFO modbus-proxy: Starting...
2021-12-09 12:00:16,113 INFO modbus-proxy: Starting...
2021-12-09 12:00:25,125 INFO modbus-proxy: Starting...
2021-12-09 12:01:32,162 INFO modbus-proxy: Starting...
2021-12-09 12:01:39,774 INFO modbus-proxy: Starting...
2021-12-09 12:02:45,445 INFO modbus-proxy: Starting...
2021-12-09 12:03:02,144 INFO modbus-proxy: Starting...
2021-12-09 12:03:54,121 INFO modbus-proxy: Starting...
2021-12-09 12:04:03,164 INFO modbus-proxy: Starting...
2021-12-09 12:04:32,154 INFO modbus-proxy: Starting...
2021-12-09 12:05:11,819 INFO modbus-proxy: Starting...
2021-12-09 12:06:02,214 INFO modbus-proxy: Starting...
2021-12-09 12:06:20,492 INFO modbus-proxy: Starting...
2021-12-09 12:06:29,524 INFO modbus-proxy: Starting...
2021-12-09 12:07:32,177 INFO modbus-proxy: Starting...
2021-12-09 12:07:35,298 INFO modbus-proxy: Starting...
2021-12-09 12:07:44,161 INFO modbus-proxy: Starting...
2021-12-09 12:08:49,830 INFO modbus-proxy: Starting...
2021-12-09 12:09:02,218 INFO modbus-proxy: Starting...
2021-12-09 12:09:58,500 INFO modbus-proxy: Starting...
2021-12-09 12:10:07,478 INFO modbus-proxy: Starting...
2021-12-09 12:10:32,196 INFO modbus-proxy: Starting...
2021-12-09 12:11:16,172 INFO modbus-proxy: Starting...
2021-12-09 12:12:02,179 INFO modbus-proxy: Starting...
2021-12-09 12:12:24,808 INFO modbus-proxy: Starting...
2021-12-09 12:12:33,774 INFO modbus-proxy: Starting...
2021-12-09 12:13:32,180 INFO modbus-proxy: Starting...
2021-12-09 12:13:42,512 INFO modbus-proxy: Starting...
2021-12-09 12:14:51,124 INFO modbus-proxy: Starting...
2021-12-09 12:15:00,206 INFO modbus-proxy: Starting...
2021-12-09 12:16:08,865 INFO modbus-proxy: Starting...
2021-12-09 12:16:32,203 INFO modbus-proxy: Starting...
2021-12-09 12:17:17,522 INFO modbus-proxy: Starting...
2021-12-09 12:17:26,523 INFO modbus-proxy: Starting...
2021-12-09 12:18:02,176 INFO modbus-proxy: Starting...
2021-12-09 12:18:35,207 INFO modbus-proxy: Starting...
2021-12-09 12:19:32,222 INFO modbus-proxy: Starting...
2021-12-09 12:19:43,851 INFO modbus-proxy: Starting...
2021-12-09 12:19:52,828 INFO modbus-proxy: Starting...
2021-12-09 12:21:01,567 INFO modbus-proxy: Starting...
2021-12-09 12:22:10,245 INFO modbus-proxy: Starting...
2021-12-09 12:22:19,267 INFO modbus-proxy: Starting...
2021-12-09 12:22:32,184 INFO modbus-proxy: Starting...
2021-12-09 12:23:27,883 INFO modbus-proxy: Starting...
2021-12-09 12:24:02,198 INFO modbus-proxy: Starting...
2021-12-09 12:24:36,555 INFO modbus-proxy: Starting...
2021-12-09 12:24:45,609 INFO modbus-proxy: Starting...
2021-12-09 12:25:32,180 INFO modbus-proxy: Starting...
2021-12-09 12:25:54,219 INFO modbus-proxy: Starting...
2021-12-09 12:27:02,271 INFO modbus-proxy: Starting...
2021-12-09 12:27:08,868 INFO modbus-proxy: Starting...
2021-12-09 12:28:17,601 INFO modbus-proxy: Starting...
2021-12-09 12:28:26,555 INFO modbus-proxy: Starting...
2021-12-09 12:28:29,680 INFO modbus-proxy: Starting...
2021-12-09 12:29:32,224 INFO modbus-proxy: Starting...
2021-12-09 12:30:02,264 INFO modbus-proxy: Starting...
2021-12-09 12:30:40,822 INFO modbus-proxy: Starting...
2021-12-09 12:30:49,944 INFO modbus-proxy: Starting...
2021-12-09 12:31:32,258 INFO modbus-proxy: Starting...
2021-12-09 12:31:58,604 INFO modbus-proxy: Starting...
2021-12-09 12:33:02,209 INFO modbus-proxy: Starting...
2021-12-09 12:33:05,323 INFO modbus-proxy: Starting...
2021-12-09 12:33:13,265 INFO modbus-proxy: Starting...
2021-12-09 12:34:21,871 INFO modbus-proxy: Starting...
2021-12-09 12:34:30,975 INFO modbus-proxy: Starting...
2021-12-09 12:35:36,600 INFO modbus-proxy: Starting...
2021-12-09 12:36:02,273 INFO modbus-proxy: Starting...
2021-12-09 12:36:45,263 INFO modbus-proxy: Starting...
2021-12-09 12:36:54,230 INFO modbus-proxy: Starting...
2021-12-09 12:37:32,231 INFO modbus-proxy: Starting...
2021-12-09 12:38:02,973 INFO modbus-proxy: Starting...
2021-12-09 12:39:02,257 INFO modbus-proxy: Starting...
2021-12-09 12:39:11,628 INFO modbus-proxy: Starting...
2021-12-09 12:39:20,651 INFO modbus-proxy: Starting...
2021-12-09 12:40:29,347 INFO modbus-proxy: Starting...
2021-12-09 12:41:37,977 INFO modbus-proxy: Starting...
2021-12-09 12:41:46,988 INFO modbus-proxy: Starting...
2021-12-09 12:42:02,242 INFO modbus-proxy: Starting...
2021-12-09 12:42:55,628 INFO modbus-proxy: Starting...
2021-12-09 12:43:32,247 INFO modbus-proxy: Starting...
2021-12-09 12:44:04,218 INFO modbus-proxy: Starting...
2021-12-09 12:44:13,323 INFO modbus-proxy: Starting...
2021-12-09 12:45:02,281 INFO modbus-proxy: Starting...
2021-12-09 12:45:21,940 INFO modbus-proxy: Starting...
2021-12-09 12:46:30,659 INFO modbus-proxy: Starting...
2021-12-09 12:46:39,605 INFO modbus-proxy: Starting...
2021-12-09 12:47:48,326 INFO modbus-proxy: Starting...
2021-12-09 12:48:02,295 INFO modbus-proxy: Starting...
2021-12-09 12:48:56,998 INFO modbus-proxy: Starting...
2021-12-09 12:49:05,953 INFO modbus-proxy: Starting...
2021-12-09 12:49:32,262 INFO modbus-proxy: Starting...
2021-12-09 12:50:14,609 INFO modbus-proxy: Starting...
2021-12-09 12:51:02,280 INFO modbus-proxy: Starting...
2021-12-09 12:51:23,317 INFO modbus-proxy: Starting...
2021-12-09 12:51:32,288 INFO modbus-proxy: Starting...
2021-12-09 12:52:32,246 INFO modbus-proxy: Starting...
2021-12-09 12:52:40,998 INFO modbus-proxy: Starting...
2021-12-09 12:53:49,659 INFO modbus-proxy: Starting...
2021-12-09 12:53:58,645 INFO modbus-proxy: Starting...
2021-12-09 12:54:32,277 INFO modbus-proxy: Starting...
2021-12-09 12:55:07,332 INFO modbus-proxy: Starting...
2021-12-09 12:56:02,271 INFO modbus-proxy: Starting...
2021-12-09 12:56:15,961 INFO modbus-proxy: Starting...
2021-12-09 12:56:25,013 INFO modbus-proxy: Starting...
2021-12-09 12:57:32,272 INFO modbus-proxy: Starting...
2021-12-09 12:57:39,727 INFO modbus-proxy: Starting...
2021-12-09 12:58:45,359 INFO modbus-proxy: Starting...
2021-12-09 12:59:02,260 INFO modbus-proxy: Starting...
2021-12-09 12:59:53,987 INFO modbus-proxy: Starting...
2021-12-09 13:00:03,083 INFO modbus-proxy: Starting...
2021-12-09 13:00:32,285 INFO modbus-proxy: Starting...
2021-12-09 13:01:11,700 INFO modbus-proxy: Starting...
2021-12-09 13:02:02,300 INFO modbus-proxy: Starting...
2021-12-09 13:02:20,279 INFO modbus-proxy: Starting...
2021-12-09 13:02:29,409 INFO modbus-proxy: Starting...
2021-12-09 13:03:32,353 INFO modbus-proxy: Starting...
2021-12-09 13:03:35,427 INFO modbus-proxy: Starting...
2021-12-09 13:03:44,032 INFO modbus-proxy: Starting...
2021-12-09 13:04:49,676 INFO modbus-proxy: Starting...
2021-12-09 13:05:02,297 INFO modbus-proxy: Starting...
2021-12-09 13:05:58,253 INFO modbus-proxy: Starting...
2021-12-09 13:06:07,361 INFO modbus-proxy: Starting...
2021-12-09 13:06:32,284 INFO modbus-proxy: Starting...
2021-12-09 13:07:15,855 INFO modbus-proxy: Starting...
2021-12-09 13:08:02,307 INFO modbus-proxy: Starting...
2021-12-09 13:08:24,442 INFO modbus-proxy: Starting...
2021-12-09 13:08:33,455 INFO modbus-proxy: Starting...
2021-12-09 13:13:39,244 INFO modbus-proxy: Starting...
2021-12-09 13:13:59,325 INFO modbus-proxy: Starting...
2021-12-09 13:14:04,287 INFO modbus-proxy: Starting...
2021-12-09 23:09:40,330 INFO modbus-proxy: Starting...
2021-12-09 23:09:53,638 INFO modbus-proxy: Starting...
2021-12-10 09:03:11,321 INFO modbus-proxy: Starting...

192.168.1.49:1502 Is a SolarEdge inverter!

What I Did

2021-12-09 04:02:27,102 DEBUG modbus-proxy.ModBus(192.168.1.49:1502): sending b'\x02\xbd\x00\x00\x00\x06\x01\x03\x9c\x87\x00&'
2021-12-09 04:02:27,128 DEBUG modbus-proxy.ModBus(192.168.1.49:1502): received b"\x02\xbd\x00\x00\x00O\x01\x03L\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\x0f\xd9\x0f\xd1\x0f\xd9\t5\t\x12\t'\xff\xff\x00\x00\x00\x00\x13\x89\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02&\xa1\xe4\x00\x00\xff\xff\x80\x00\x00\x00\xff\xff\x00\x00\x00\x00\x80\x00\x00\x00\x80\x00\x80\x00\xff\xfe\x00\x02\x00\x00"
2021-12-09 04:02:27,129 DEBUG modbus-proxy.Client(127.0.0.1:48351): sending b"\x02\xbd\x00\x00\x00O\x01\x03L\x00\x00\x00\x00\x00\x00\x00\x00\xff\xfe\x0f\xd9\x0f\xd1\x0f\xd9\t5\t\x12\t'\xff\xff\x00\x00\x00\x00\x13\x89\xff\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02&\xa1\xe4\x00\x00\xff\xff\x80\x00\x00\x00\xff\xff\x00\x00\x00\x00\x80\x00\x00\x00\x80\x00\x80\x00\xff\xfe\x00\x02\x00\x00"
2021-12-09 04:02:57,103 DEBUG modbus-proxy.Client(127.0.0.1:48351): received b'\x02\xbe\x00\x00\x00\x06\x01\x03\x9c\x87\x00&'
2021-12-09 04:02:57,103 DEBUG modbus-proxy.ModBus(192.168.1.49:1502): sending b'\x02\xbe\x00\x00\x00\x06\x01\x03\x9c\x87\x00&'
2021-12-09 04:02:57,116 ERROR modbus-proxy.ModBus(192.168.1.49:1502): write_read error: ConnectionResetError(104, 'Connection reset by peer')
2021-12-09 04:02:57,116 INFO modbus-proxy.ModBus(192.168.1.49:1502): closing connection...
2021-12-09 04:02:57,116 INFO modbus-proxy.ModBus(192.168.1.49:1502): failed to close: ConnectionResetError(104, 'Connection reset by peer')
2021-12-09 04:02:57,117 INFO modbus-proxy.ModBus(192.168.1.49:1502): connecting to modbus...
2021-12-09 04:02:57,117 ERROR modbus-proxy.ModBus(192.168.1.49:1502): write_read error: CancelledError()
2021-12-09 04:02:57,118 INFO modbus-proxy.Client(127.0.0.1:48351): closing connection...
2021-12-09 04:02:57,118 ERROR modbus-proxy.Client(127.0.0.1:39943): reading error: CancelledError()
2021-12-09 04:02:57,118 INFO modbus-proxy.Client(127.0.0.1:39943): closing connection...
2021-12-09 04:02:57,118 INFO modbus-proxy.Client(127.0.0.1:48351): connection closed
2021-12-09 04:02:57,118 INFO modbus-proxy.Client(127.0.0.1:39943): connection closed
Traceback (most recent call last):
File "/usr/local/bin/modbus-proxy", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/modbus_proxy.py", line 343, in main
asyncio.run(run())
File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
concurrent.futures._base.CancelledError

Thanks

Alternatives to this project

The last commit for this project has been one year ago and there has been little activity in the issue tracker as well. Assuming this project is paused, it might be worth looking for alternatives.

Personally, I had good success with HAProxy. Yes, it's not as lightweight but it's rock-solid, extremely scalable, well documented, and supported.

Here's my configuration to proxy a modbus server (port mapping: 5020 -> 1502) with a maximum connection count of 1:

haproxy.cfg

global
    daemon
    maxconn 256

listen modbus-in
    mode tcp
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms
    bind *:5020
    server server1 $IP:1502 maxconn 1 check

Docker Compose

services:
  haproxy:
    image: haproxy:latest
    container_name: haproxy
    ports:
      - "5020:5020"
    volumes:
      - type: bind
        source: /my/path/haproxy.cfg
        target: /usr/local/etc/haproxy/haproxy.cfg
    restart: unless-stopped                                                                                                                                                                                                                                 

Maybe this helps someone.

Error installing modbus-proxy on Synology with docker compose file

  • ModBus TCP proxy version: latest
  • Python version:
  • Operating System: Synology DSM 7.2

Description

I want to install modbus-proxy on my Synology NAS via Docker compose File.

version: "3" services: modbus-proxy: security_opt: - seccomp=unconfined container_name: modbus-proxy image: tiagocoutinho/modbus-proxy:latest ports: - "5020:502" environment: - RUST_BACKTRACE=full volumes: - /volume2/docker/modbus_proxy/config.yml:/etc/modbus-proxy.yml restart: always

Error Message:

Container will not start and i get following error message:

thread 'main' panicked at 'called Result::unwrap()on anErr value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', /modbus-proxy-rs/src/lib.rs:181:67

Could someone help please?

Thank you :-)

Connection from HA not possible & no log output on docker console

  • ModBus TCP proxy version: latest image
  • Python version:
  • Operating System: docker 20.10.22

Description

I have a Solaredge inverter, Homeassistant and will soon be getting a wallbox. Since only one device can access the inverter via Modbus and this works successfully with Homeassistant, I wanted to connect a Modbus proxy in between in preparation for my wallbox.
In HA I have changed the port to 5020. With a port scan, I can also see that port 5020 is accessible on my Docker host system. But the integration does not work with the modbus proxy.
In addition, neither info nor debug information is displayed on the console of the container. I can't even see whether the connection is working.

What I Did

Here is my

docker-compose.yml

version: "3.9"
services:

  modbus-proxy:
    container_name: modbus-proxy
    image: tiagocoutinho/modbus-proxy:latest
    restart: unless-stopped
    ports:
      - 5020:502
    environment:
      TZ: ${TZ}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DATA}/modbus_proxy/config/modbus-proxy.yml:/etc/modbus-proxy.yml:ro

modbus-proxy.yml

devices:
- modbus:
    url: solaredge.iot:1502     # device url (mandatory)
    timeout: 10                 # communication timeout (s) (optional, default: 10)
    connection_time: 0.1        # delay after connection (s) (optional, default: 0)
  listen:
    bind: 0:502                 # listening address (mandatory)4
logging:
  version: 1
  formatters:
    standard:
      format: "%(asctime)s %(levelname)8s %(name)s: %(message)s"
  handlers:
    console:
      class: logging.StreamHandler
      formatter: standard
  root:
    handlers: ['console']
    level: DEBUG

What am I doing wrong???

Connecting to SolarEdge Inverter unstable

  • ModBus TCP proxy version: 0.2.0
  • Python version: The Docker one
  • Operating System: Derbian

Description

I have a SolarEdge inverter which only allows one connection at a time.
modbus-proxy would be the bridge between the SolarEdge inverter and a battery storage system and HomeAssistant as monitoring platform.

The SolarEdge inverter seams to have a somewhat unstable Modbus TCP implementation. If the client does something wrong or not follow the undocumented connection routines, it will stop responding. You will loose connection and you will not regain it without total restart on modbus-proxy.

So in other words. Modbus-proxy does connect to SolarEdge, it proxys data for some time, a few hours up to a day. Then it stops.
This is all you see in the trace file.

2021-01-24 20:35:27,049: INFO:modbus-proxy.Client(192.168.1.87:35476):new connection,
2021-01-24 20:35:27,049: ERROR:modbus-proxy.Client(192.168.1.87:35476):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:36:32,079: INFO:modbus-proxy.Client(192.168.1.87:35482):new connection,
2021-01-24 20:36:32,079: ERROR:modbus-proxy.Client(192.168.1.87:35482):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:37:37,097: INFO:modbus-proxy.Client(192.168.1.87:35488):new connection,
2021-01-24 20:37:37,098: ERROR:modbus-proxy.Client(192.168.1.87:35488):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:38:42,117: INFO:modbus-proxy.Client(192.168.1.87:35494):new connection,
2021-01-24 20:38:42,118: ERROR:modbus-proxy.Client(192.168.1.87:35494):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:39:47,138: INFO:modbus-proxy.Client(192.168.1.87:35500):new connection,
2021-01-24 20:39:47,139: ERROR:modbus-proxy.Client(192.168.1.87:35500):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:40:52,164: INFO:modbus-proxy.Client(192.168.1.87:35506):new connection,
2021-01-24 20:40:52,164: ERROR:modbus-proxy.Client(192.168.1.87:35506):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:41:57,191: INFO:modbus-proxy.Client(192.168.1.87:35512):new connection,
2021-01-24 20:41:57,191: ERROR:modbus-proxy.Client(192.168.1.87:35512):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:43:02,201: INFO:modbus-proxy.Client(192.168.1.87:35518):new connection,
2021-01-24 20:43:02,202: ERROR:modbus-proxy.Client(192.168.1.87:35518):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:44:07,207: INFO:modbus-proxy.Client(192.168.1.87:35524):new connection,
2021-01-24 20:44:07,207: ERROR:modbus-proxy.Client(192.168.1.87:35524):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:45:12,223: INFO:modbus-proxy.Client(192.168.1.87:35530):new connection,
2021-01-24 20:45:12,223: ERROR:modbus-proxy.Client(192.168.1.87:35530):ConnectionResetError(104, 'Connection reset by peer'),

After a reboot of the docker instance, it connects again

2021-01-24 20:45:12,223: ERROR:modbus-proxy.Client(192.168.1.87:35530):ConnectionResetError(104, 'Connection reset by peer'),
2021-01-24 20:45:52,755: INFO:modbus-proxy:Starting...,
2021-01-24 20:45:52,760: INFO:modbus-proxy:Ready!,
2021-01-24 20:46:17,242: INFO:modbus-proxy.Client(192.168.1.87:35536):new connection,
2021-01-24 20:46:17,242: INFO:modbus-proxy.modbus(192.168.1.8:1502):connecting to modbus at ('192.168.1.8', 1502)...,
2021-01-24 20:46:17,245: INFO:modbus-proxy.modbus(192.168.1.8:1502):connected!,
2021-01-24 20:46:17,507: INFO:modbus-proxy.Client(192.168.1.87:35538):new connection,
2021-01-24 20:46:17,507: INFO:modbus-proxy.Client(192.168.1.87:35536):ConnectionClosedError('Client disconnected'),
2021-01-24 20:47:22,511: INFO:modbus-proxy.Client(192.168.1.87:35544):new connection,
2021-01-24 20:47:22,672: INFO:modbus-proxy.Client(192.168.1.87:35544):ConnectionClosedError('Client disconnected'),
2021-01-24 20:48:27,676: INFO:modbus-proxy.Client(192.168.1.87:35550):new connection,
2021-01-24 20:48:27,837: INFO:modbus-proxy.Client(192.168.1.87:35550):ConnectionClosedError('Client disconnected'),

Interesting observations

The company Victron has an operating system called Venus OS. They have a feature that connects to SolarEdge inverters and retrieves the data.
It has never really worked, until they found a problem in their code and fixed it (2021 jan 21 beta release). After this fix, Venus OS and SolarEdge never drops the connection, before this fix, it dropped constantly (max an hour)

It is discussed here victronenergy/venus#760 maybe this could help.
The fix is here victronenergy/dbus-fronius@6ecc1d0 although their code is C++, but the problem seems to be the same.

Client error: RecvError(()) when connecting to modus-proxy

I try to run modbus-proxy via Docker on my Unraid server (IP address of the server is 192.168.0.1). I am using a Huawei SUN2000 10KTL inverter (IP address is 192.168.1.4). I want to connect EVCC and Home Assistant (both containers on my server) simultaneously to modbus-proxy. I mapped the container port 502 to the host port 5020.

My config.yaml:

devices:
- modbus:
    url: 192.168.1.4:502
    timeout: 10                # communication timeout (s) (optional, default: 10)
    connection_time: 2       # delay after connection (s) (optional, default: 0)
  listen:
    bind: 0:502

After starting modus-proxy I tried to connect my clients to it, but with no success. It seems that the connection from modus-proxy to the inverter is working, but for both clients I get a Client error: RecvError(()).

The log output of modus-proxy:

[2023-02-05T08:24:13Z INFO  modbus_proxy_rs] Ready to accept requests on 0:502 to 192.168.1.4:502
[2023-02-05T08:25:50Z INFO  modbus_proxy_rs] new client connection (active = 1)
[2023-02-05T08:25:51Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:25:51Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 1, 0, 0, 0, 6, 0, 3, 167, 254, 0, 1]
[2023-02-05T08:25:51Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull
[2023-02-05T08:28:51Z INFO  modbus_proxy_rs] new client connection (active = 2)
[2023-02-05T08:28:51Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:28:51Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 1, 0, 0, 0, 6, 1, 3, 167, 254, 0, 1]
[2023-02-05T08:28:51Z ERROR modbus_proxy_rs] Client error: RecvError(())
[2023-02-05T08:28:51Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull
[2023-02-05T08:31:52Z INFO  modbus_proxy_rs] new client connection (active = 3)
[2023-02-05T08:31:52Z INFO  modbus_proxy_rs] new client connection (active = 4)
[2023-02-05T08:31:52Z INFO  modbus_proxy_rs] new client connection (active = 5)
[2023-02-05T08:31:52Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:31:52Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 1, 0, 0, 0, 6, 1, 3, 125, 64, 0, 2]
[2023-02-05T08:31:52Z ERROR modbus_proxy_rs] Client error: RecvError(())
[2023-02-05T08:31:52Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull
[2023-02-05T08:35:23Z INFO  modbus_proxy_rs] Ready to accept requests on 0:502 to 192.168.1.4:502
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] new client connection (active = 1)
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] new client connection (active = 2)
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] new client connection (active = 3)
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] new client connection (active = 4)
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] new client connection (active = 5)
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:35:24Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 36, 0, 0, 0, 6, 1, 3, 144, 137, 0, 2]
[2023-02-05T08:35:24Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull
[2023-02-05T08:38:25Z INFO  modbus_proxy_rs] new client connection (active = 6)
[2023-02-05T08:38:25Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:38:25Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 37, 0, 0, 0, 6, 1, 3, 144, 140, 0, 1]
[2023-02-05T08:38:25Z ERROR modbus_proxy_rs] Client error: RecvError(())
[2023-02-05T08:38:25Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull
[2023-02-05T08:41:26Z INFO  modbus_proxy_rs] new client connection (active = 7)
[2023-02-05T08:41:26Z INFO  modbus_proxy_rs] new client connection (active = 8)
[2023-02-05T08:41:26Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:41:26Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 1, 0, 0, 0, 6, 1, 3, 167, 254, 0, 1]
[2023-02-05T08:41:26Z ERROR modbus_proxy_rs] Client error: RecvError(())
[2023-02-05T08:41:26Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull
[2023-02-05T08:44:28Z INFO  modbus_proxy_rs] modbus request 192.168.1.4:502: 12 bytes
[2023-02-05T08:44:28Z DEBUG modbus_proxy_rs] modbus request 192.168.1.4:502: [0, 38, 0, 0, 0, 6, 1, 3, 144, 249, 0, 2]
[2023-02-05T08:44:28Z ERROR modbus_proxy_rs] Client error: RecvError(())
[2023-02-05T08:44:28Z INFO  modbus_proxy_rs] modbus connection to 192.168.1.4:502 sucessfull

Any idea what I could do to solve this?

broken Dockerfile

  • Operating System: debian 10

Description

It looks like the Dockerfile tries to copy modbus_proxy.py from the root folder when its actually placed under /src, modifying the Dockerfile to copy from /src/modbus_proxy.py instead makes the build to work but other issues trying to start the container as it can not find the modbus-proxy command that is specified as entry-point

What I Did

docker build --tag modbus-proxy .
Sending build context to Docker daemon  174.1kB
Step 1/7 : FROM python:3.8-alpine
3.8-alpine: Pulling from library/python
a0d0a0d46f8b: Pull complete
c11246b421be: Pull complete
5e6f9a3065f1: Pull complete
1d7a167f2660: Pull complete
0e99e6f9c94e: Pull complete
Digest: sha256:e11bbd37d4371894e954421b85dbe8dd4eb7198d7cb4ed144ab529f19f57c3f1
Status: Downloaded newer image for python:3.8-alpine
 ---> 9e170d41f428
Step 2/7 : WORKDIR /src
 ---> Running in 7ea8ce1ab12e
Removing intermediate container 7ea8ce1ab12e
 ---> e98c23a14127
Step 3/7 : COPY *.md modbus_proxy.py setup.py *.conf ./
COPY failed: file not found in build context or excluded by .dockerignore: stat modbus_proxy.py: file does not exist

Systemd service

It would make sense to give a short description on how to setup the modbus proxy as a service (systemd)...
I don't know, if this should go to the "readme" directly, since it might be different depending on the host system... therefore, it might be something for a wiki instead?
Therefore I haven't added this to the readme and made a pr... if you want, I can add it :)

  1. I have moved the config file to /usr/lib/mproxy-conf.yaml
  2. go to /etc/systemd/system/
  3. use nano to create a service file nano mproxy.service
  4. the file should contain the following information:
[Unit]
Description=Modbus-Proxy
After=network.target

[Service]
Type=simple
Restart=always
ExecStart = modbus-proxy -c ./usr/lib/mproxy-conf.yaml

[Install]
WantedBy=multi-user.target
  1. run systemctl daemon-reload
  2. systemctl enable mproxy.service
  3. systemctl start mproxy.service

With the command systemctl status mproxy.service can you check, if the software / service was started successfully and if it is running.

Question: Forwarding slave to another with different indices

Hi

I'm wondering if it is possible to forward one slave index to another, or - in other words - to change its index? For example: ModBus server foo.com:502 has a slave on index 0, and I would like to proxy it, but forward slave 1 to foo.com:502 slave 0 instead of 0 to 0 or 1 to 1.

The reason I'm asking this is because some MODBUS/TCP servers, such as the Huawei SUN-2000L, have their slave on index 0, which - if I understood correctly - is not meant to be used as actual slave index. As a result, some software (e.g. Loxone's MODBUS support) refuses to read from it and requires a minimum slave index of 1. Meanwhile, tools such as qModMaster work fine with slave index 0 to read the necessary data. Having this support would allow me to work around this problem with quirky MODBUS implementations, and link both.

Thanks!

Wen more than one client connects pipe breaks

  • ModBus TCP proxy version: 0.2.0
  • Python version: Docker
  • Operating System: Derbian

Description

I have modbus-proxy connected to 192.168.1.8:1502
I have a computer 192.168.1.87 connecting to the docker instance of modbus-proxy
I have another docker instance (HomeAssistant) running on the same computer as modbus-proxy, connecting to modbus-proxy

modbus-proxy fails. No client can read. Pipe is broken it says

2021-01-24 22:05:02,224: INFO:modbus-proxy.Client(172.19.0.1:50580):new connection,
2021-01-24 22:05:32,262: INFO:modbus-proxy.Client(172.19.0.1:50594):new connection,
2021-01-24 22:05:36,974: INFO:modbus-proxy.Client(192.168.1.87:35978):new connection,
2021-01-24 22:06:02,425: INFO:modbus-proxy.Client(172.19.0.1:50612):new connection,
2021-01-24 22:06:02,898: INFO:modbus-proxy.Client(192.168.1.87:35984):new connection,
2021-01-24 22:06:32,513: INFO:modbus-proxy.Client(172.19.0.1:50632):new connection,
2021-01-24 22:07:02,258: INFO:modbus-proxy.Client(172.19.0.1:50580):ConnectionClosedError('Modbus disconnected'),
2021-01-24 22:07:02,258: INFO:modbus-proxy.Client(192.168.1.87:35894):ConnectionClosedError('Modbus disconnected'),
2021-01-24 22:07:02,259: INFO:modbus-proxy.Client(172.19.0.1:50594):ConnectionClosedError('Modbus disconnected'),
2021-01-24 22:07:02,261: ERROR:modbus-proxy.Client(192.168.1.87:35978):ConnectionResetError('Connection lost'),
2021-01-24 22:07:02,262: ERROR:modbus-proxy.Client(172.19.0.1:50612):BrokenPipeError(32, 'Broken pipe'),
2021-01-24 22:07:02,262: ERROR:modbus-proxy.Client(192.168.1.87:35984):BrokenPipeError(32, 'Broken pipe'),
2021-01-24 22:07:02,263: ERROR:modbus-proxy.Client(172.19.0.1:50632):BrokenPipeError(32, 'Broken pipe'),
2021-01-24 22:07:02,288: INFO:modbus-proxy.Client(172.19.0.1:50648):new connection,
2021-01-24 22:07:02,288: ERROR:modbus-proxy.Client(172.19.0.1:50648):BrokenPipeError(32, 'Broken pipe'),
2021-01-24 22:07:05,395: INFO:modbus-proxy.Client(172.19.0.1:50670):new connection,
2021-01-24 22:07:05,395: ERROR:modbus-proxy.Client(172.19.0.1:50670):BrokenPipeError(32, 'Broken pipe'),
2021-01-24 22:07:05,397: INFO:modbus-proxy.Client(172.19.0.1:50674):new connection,
2021-01-24 22:07:05,397: ERROR:modbus-proxy.Client(172.19.0.1:50674):BrokenPipeError(32, 'Broken pipe'),

Interesting observation

The interna docker ip address is shown as client ip for HomeAssistent

Thank you! - and HomeAssistant Addon

Just wanted to leave a thank you here for creating this. It was exactly what i needed. I am running homeassistant and a solaredge inverter. The Wallbox and the home assistant both want to talk to the inverter and this was impossible.
I created a homeassistant addon (https://www.home-assistant.io/addons/) for this and was asked to make it public so others can use it as well .

Its the first time for me doing something like this and i am unsure how to attribute your work. I added a Mention and the Link back to this repository - is there a more appropriate way to do it?

https://github.com/Akulatraxas/ha-modbusproxy

poor communication no matter how much clients

  • ModBus TCP proxy version: 1.0.15
  • Python version: 3.11.5
  • Operating System: Home Assistant with core-2023.10.5

Description

I need to use a modbus-proxy in order to use the evcc addon and the huawei_solar integration parallel.
I know that I configured avereything to use the modbus-proxy and not to bypass directly to the inverter.
The communication is not stable to my huawei sun2000 inverter with dongle via modbus-tcp

What I Did

Both, the addon and the integration work fine if they are the only client that communicate directly to the inverter.
Every thing is on the same RPI!!
If I trie to use modbus-proxy with one of the two clients it works for some minutes until I get an Error read:write that will sometimes recover.
With both clients, only evcc is somewhat stable, huwaei_solar is 99% out of order.
connection time 2 sec, timeout 10 sec
both modbus-proxy port and inverter port use port 502

I use two inverter in a cascade and two batteries, the trouble startet with the second inverter.

I think that the amount auf data is just to much or that for whatever reason they are somtimes not proper serialized?

Thank for helping me.

Thomas

Please make a Docker of this

I have a solaredge PV inverter that only allows one connection at a time
I have tried to make a docker, but my knowledge is not enough.

My use case is to have modbus tcp running in a docker with configurable ip and port. I have two applications that needs to read the same ip and port

PermissionError on Port 502

  • ModBus TCP proxy version: [v0.6.7]
  • Python version:
  • Operating System:

I need to start the server on port 502, because i have an device where i cant change the port.

xx@raspberrypi:~/.local/bin $ ./modbus-proxy -b tcp://0:502 --modbus tcp://192.168.0.123:1502
2024-01-01 15:48:23,252 INFO modbus-proxy: Starting...
Traceback (most recent call last):
File "/home/pi/.local/bin/./modbus-proxy", line 8, in
sys.exit(main())
File "/home/pi/.local/lib/python3.9/site-packages/modbus_proxy.py", line 343, in main
asyncio.run(run())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.9/site-packages/modbus_proxy.py", line 338, in run
await run_bridges(bridges, ready=ready)
File "/home/pi/.local/lib/python3.9/site-packages/modbus_proxy.py", line 327, in run_bridges
await start_bridges(bridges)
File "/home/pi/.local/lib/python3.9/site-packages/modbus_proxy.py", line 320, in start_bridges
await asyncio.gather(*coros)
File "/home/pi/.local/lib/python3.9/site-packages/modbus_proxy.py", line 188, in start
self.server = await asyncio.start_server(
File "/usr/lib/python3.9/asyncio/streams.py", line 94, in start_server
return await loop.create_server(factory, host, port, **kwds)
File "/usr/lib/python3.9/asyncio/base_events.py", line 1494, in create_server
raise OSError(err.errno, 'error while attempting '
PermissionError: [Errno 13] error while attempting to bind on address ('0.0.0.0', 502): permission denied

Other Question:
Modbus Slave is: 192.168.0.123:1502
Modbus Master is: 192.168.0.11 and an other one ist
Modbus Master is: 192.168.0.12

I want collect the Modbus Date vom 192.168.0.123:1502 and give it to both masters.

Can i also collect from 192.168.0.123:1502 and open two ports on the proxy

modbus-proxy -b tcp://0:502 AND tcp://0:503 --modbus tcp://192.168.0.123:1502 ????

If the Master x.x.x.12 is collect from x.x.x.1502 the other master can not collect from x.x.x.1502

Systemd service does not work as described

  • ModBus TCP proxy version: 0.6.8
  • Python version: 3.9
  • Operating System: Raspberry Pi OS Bullseye v11.5

Description

The service configuration does not work when installing modbus-proxy according to the instructions. I get an ModuleNotFoundError: No module named 'modbus_proxy'.
The reason is that modbus-proxy is installed in a local user directory, but the service is run by the user root and root does not know the local directory. I am not a python expert and I have not found a solution to adjust the environment variables so that root can handle them.

What I Did

I solved the problem by installing modbus-proxy as user root as follows:
sudo su
pip3 install modbus-proxy

Then the package will be installed in /usr/local/bin/ and /usr/local/lib/python3.9/dist-packages
Now the service can be started without error. This workaround is OK for me, but maybe there are other suggestions from python experts to make this service work.

Not possible to connect more than one client

  • ModBus TCP proxy version: 0.6.8
  • Python version: 3.9
  • Operating System: Raspberry Pi OS Bullseye v11.5

Description

Two master clients (FHEM and CCGX) are to connect with the Solaredge inverter over modbus-proxy, but only one does.
Either one or the other, but not both. One client connection results always in a ConnectionRefusedError.
I have tried different combinations of connection_time and timeout values without success.

What I Did

This is my mproxy-conf.yaml:

devices:
- modbus:
    url: 192.168.66.57:502     # solaredge inverter url (mandatory)
    timeout: 10                # communication timeout (s) (optional, default: 10)
    connection_time: 0.1       # delay after connection (s) (optional, default: 0)
  listen:
    bind: 0:9000               # listening address (for FHEM)
- modbus:
    url: 192.168.66.57:502     # solaredge inverter url
    timeout: 10
    connection_time: 0.1
  listen:
    bind: 0:502                # listening address (for CCGX, requires port 502)
logging:
  version: 1
  formatters:
    standard:
      format: "%(asctime)s %(levelname)8s %(name)s: %(message)s"
  handlers:
    console:
      class: logging.StreamHandler
      formatter: standard
  root:
    handlers: ['console']
    level: DEBUG`

Here the syslog output:

Dec 27 21:13:03 rsp2 systemd[1]: Started Modbus-Proxy.
Dec 27 21:13:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:04,113     INFO modbus-proxy: Starting...
Dec 27 21:13:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:04,121     INFO modbus-proxy.ModBus(192.168.66.57:502): Ready to accept requests on 0:9000
Dec 27 21:13:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:04,122     INFO modbus-proxy.ModBus(192.168.66.57:502): Ready to accept requests on 0:502
Dec 27 21:13:16 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:16,750     INFO modbus-proxy.Client(192.168.66.65:39376): new client connection
Dec 27 21:13:16 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:16,876    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00^\x00\x00\x00\x06~\x03\x9cl\x00\x08'
Dec 27 21:13:16 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:16,877     INFO modbus-proxy.ModBus(192.168.66.57:502): connecting to modbus...
Dec 27 21:13:16 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:16,885     INFO modbus-proxy.ModBus(192.168.66.57:502): connected!
Dec 27 21:13:16 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:16,886     INFO modbus-proxy.ModBus(192.168.66.57:502): delay after connect: 0.1
Dec 27 21:13:16 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:16,987    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00^\x00\x00\x00\x06~\x03\x9cl\x00\x08'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,001    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00^\x00\x00\x00\x13~\x03\x100004.0016.0025\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,002    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00^\x00\x00\x00\x13~\x03\x100004.0016.0025\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,179    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00W\x00\x00\x00\x06~\x03\x9c\x85\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,180    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00W\x00\x00\x00\x06~\x03\x9c\x85\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,203    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00W\x00\x00\x00\x05~\x03\x02\x00g'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,203    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00W\x00\x00\x00\x05~\x03\x02\x00g'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,308    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00?\x00\x00\x00\x06~\x03\x9c\x87\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,309    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00?\x00\x00\x00\x06~\x03\x9c\x87\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,333    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00?\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,334    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00?\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,438    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xa7\x00\x00\x00\x06~\x03\x9c\x88\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,439    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xa7\x00\x00\x00\x06~\x03\x9c\x88\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,473    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xa7\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,473    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xa7\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,579    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00m\x00\x00\x00\x06~\x03\x9c\x89\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,580    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00m\x00\x00\x00\x06~\x03\x9c\x89\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,601    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00m\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,602    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00m\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,716    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x006\x00\x00\x00\x06~\x03\x9c\x8a\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,717    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x006\x00\x00\x00\x06~\x03\x9c\x8a\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,733    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x006\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,733    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x006\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,837    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00/\x00\x00\x00\x06~\x03\x9c\x8b\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,838    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00/\x00\x00\x00\x06~\x03\x9c\x8b\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,852    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00/\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,853    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00/\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,958    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xca\x00\x00\x00\x06~\x03\x9c\x8c\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,959    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xca\x00\x00\x00\x06~\x03\x9c\x8c\x00\x01'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,983    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xca\x00\x00\x00\x05~\x03\x02\x0f\xdc'
Dec 27 21:13:17 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:17,984    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xca\x00\x00\x00\x05~\x03\x02\x0f\xdc'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,088    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x92\x00\x00\x00\x06~\x03\x9c\x8d\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,089    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x92\x00\x00\x00\x06~\x03\x9c\x8d\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,121    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x92\x00\x00\x00\x05~\x03\x02\x0f\xd9'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,122    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x92\x00\x00\x00\x05~\x03\x02\x0f\xd9'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,227    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00f\x00\x00\x00\x06~\x03\x9c\x8e\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,228    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00f\x00\x00\x00\x06~\x03\x9c\x8e\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,242    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00f\x00\x00\x00\x05~\x03\x02\x0f\xd2'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,243    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00f\x00\x00\x00\x05~\x03\x02\x0f\xd2'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,348    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xab\x00\x00\x00\x06~\x03\x9c\x8f\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,349    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xab\x00\x00\x00\x06~\x03\x9c\x8f\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,373    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xab\x00\x00\x00\x05~\x03\x02\t"'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,373    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xab\x00\x00\x00\x05~\x03\x02\t"'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,477    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x0b\x00\x00\x00\x06~\x03\x9c\x90\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,478    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x0b\x00\x00\x00\x06~\x03\x9c\x90\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,502    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x0b\x00\x00\x00\x05~\x03\x02\t-'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,502    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x0b\x00\x00\x00\x05~\x03\x02\t-'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,607    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00Q\x00\x00\x00\x06~\x03\x9c\x91\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,608    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00Q\x00\x00\x00\x06~\x03\x9c\x91\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,642    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00Q\x00\x00\x00\x05~\x03\x02\t!'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,642    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00Q\x00\x00\x00\x05~\x03\x02\t!'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,757    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00e\x00\x00\x00\x06~\x03\x9c\x92\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,758    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00e\x00\x00\x00\x06~\x03\x9c\x92\x00\x01'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,773    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00e\x00\x00\x00\x05~\x03\x02\xff\xff'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,774    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00e\x00\x00\x00\x05~\x03\x02\xff\xff'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,886    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xb4\x00\x00\x00\x06~\x03\x9c\x93\x00\x02'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,887    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xb4\x00\x00\x00\x06~\x03\x9c\x93\x00\x02'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,913    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xb4\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:13:18 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:18,914    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xb4\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,130    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xd1\x00\x00\x00\x06~\x03\x9c\x95\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,130    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xd1\x00\x00\x00\x06~\x03\x9c\x95\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,174    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xd1\x00\x00\x00\x07~\x03\x04\x13\x88\xff\xfe'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,174    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xd1\x00\x00\x00\x07~\x03\x04\x13\x88\xff\xfe'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,336    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x14\x00\x00\x00\x06~\x03\x9c\x9b\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,337    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x14\x00\x00\x00\x06~\x03\x9c\x9b\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,354    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x14\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,354    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x14\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,459    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xe4\x00\x00\x00\x06~\x03\x9c\xa0\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,460    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xe4\x00\x00\x00\x06~\x03\x9c\xa0\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,494    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xe4\x00\x00\x00\x07~\x03\x04\xff\xff\x80\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,494    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xe4\x00\x00\x00\x07~\x03\x04\xff\xff\x80\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,598    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00N\x00\x00\x00\x06~\x03\x9c\xa2\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,599    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00N\x00\x00\x00\x06~\x03\x9c\xa2\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,624    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00N\x00\x00\x00\x07~\x03\x04\x00\x00\xff\xff'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,625    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00N\x00\x00\x00\x07~\x03\x04\x00\x00\xff\xff'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,730    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xd8\x00\x00\x00\x06~\x03\x9c\xa4\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,731    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xd8\x00\x00\x00\x06~\x03\x9c\xa4\x00\x02'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,754    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xd8\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,755    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xd8\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,862    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x84\x00\x00\x00\x06~\x03\x9c\xa7\x00\x01'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,863    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x84\x00\x00\x00\x06~\x03\x9c\xa7\x00\x01'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,885    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x84\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:19 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:19,885    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x84\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,030    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x0b\x00\x00\x00\x06~\x03\x9c\xaa\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,031    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x0b\x00\x00\x00\x06~\x03\x9c\xaa\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,045    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x0b\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,046    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x0b\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,151    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00:\x00\x00\x00\x06~\x03\x9c\xcb\x00\x10'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,152    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00:\x00\x00\x00\x06~\x03\x9c\xcb\x00\x10'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,195    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00:\x00\x00\x00#~\x03 N/A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,196    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00:\x00\x00\x00#~\x03 N/A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,300    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xee\x00\x00\x00\x06~\x03\x9d\x00\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,301    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xee\x00\x00\x00\x06~\x03\x9d\x00\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,315    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xee\x00\x00\x00\x05~\x03\x02\x00\x08'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,316    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xee\x00\x00\x00\x05~\x03\x02\x00\x08'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,420    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00X\x00\x00\x00\x06~\x03\x9d\x03\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,421    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00X\x00\x00\x00\x06~\x03\x9d\x03\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,435    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00X\x00\x00\x00\x05~\x03\x02[~'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,436    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00X\x00\x00\x00\x05~\x03\x02[~'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,540    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xa6\x00\x00\x00\x06~\x03\x9d\x06\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,541    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xa6\x00\x00\x00\x06~\x03\x9d\x06\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,574    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xa6\x00\x00\x00\x05~\x03\x02[p'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,575    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xa6\x00\x00\x00\x05~\x03\x02[p'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,680    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00v\x00\x00\x00\x06~\x03\x9d\x0e\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,681    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00v\x00\x00\x00\x06~\x03\x9d\x0e\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,706    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00v\x00\x00\x00\x05~\x03\x02\xfd\x81'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,706    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00v\x00\x00\x00\x05~\x03\x02\xfd\x81'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,897    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xbf\x00\x00\x00\x06~\x03\x9d2\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,898    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xbf\x00\x00\x00\x06~\x03\x9d2\x00\x01'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,915    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xbf\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:20 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:20,915    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xbf\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,143     INFO modbus-proxy.Client(192.168.66.95:47550): new client connection
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,144    DEBUG modbus-proxy.Client(192.168.66.95:47550): received b'\x00\x01\x00\x00\x00\x06~\x03\x9c@\x00\x02'
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,145     INFO modbus-proxy.ModBus(192.168.66.57:502): connecting to modbus...
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,147    ERROR modbus-proxy.ModBus(192.168.66.57:502): write_read error [1/2]: ConnectionRefusedError(111, "Connect call failed ('192.168.66.57', 502)")
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,148     INFO modbus-proxy.ModBus(192.168.66.57:502): connecting to modbus...
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,151    ERROR modbus-proxy.ModBus(192.168.66.57:502): write_read error [2/2]: ConnectionRefusedError(111, "Connect call failed ('192.168.66.57', 502)")
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,151     INFO modbus-proxy.Client(192.168.66.95:47550): closing connection...
Dec 27 21:13:24 rsp2 modbus-proxy[13616]: 2022-12-27 21:13:24,152     INFO modbus-proxy.Client(192.168.66.95:47550): connection closed
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,288    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xd6\x00\x00\x00\x06~\x03\x9cl\x00\x08'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,289    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xd6\x00\x00\x00\x06~\x03\x9cl\x00\x08'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,334    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xd6\x00\x00\x00\x13~\x03\x100004.0016.0025\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,335    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xd6\x00\x00\x00\x13~\x03\x100004.0016.0025\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,446    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00<\x00\x00\x00\x06~\x03\x9c\x85\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,447    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00<\x00\x00\x00\x06~\x03\x9c\x85\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,485    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00<\x00\x00\x00\x05~\x03\x02\x00g'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,486    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00<\x00\x00\x00\x05~\x03\x02\x00g'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,590    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00t\x00\x00\x00\x06~\x03\x9c\x87\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,591    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00t\x00\x00\x00\x06~\x03\x9c\x87\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,615    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00t\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,615    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00t\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,720    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00A\x00\x00\x00\x06~\x03\x9c\x88\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,721    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00A\x00\x00\x00\x06~\x03\x9c\x88\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,755    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00A\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,755    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00A\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,892    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00V\x00\x00\x00\x06~\x03\x9c\x89\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,893    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00V\x00\x00\x00\x06~\x03\x9c\x89\x00\x01'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,946    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00V\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:00 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:00,947    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00V\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,060    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x90\x00\x00\x00\x06~\x03\x9c\x8a\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,061    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x90\x00\x00\x00\x06~\x03\x9c\x8a\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,075    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x90\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,076    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x90\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,180    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00^\x00\x00\x00\x06~\x03\x9c\x8b\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,181    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00^\x00\x00\x00\x06~\x03\x9c\x8b\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,226    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00^\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,226    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00^\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,331    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xf3\x00\x00\x00\x06~\x03\x9c\x8c\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,332    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xf3\x00\x00\x00\x06~\x03\x9c\x8c\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,346    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xf3\x00\x00\x00\x05~\x03\x02\x0f\xdb'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,347    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xf3\x00\x00\x00\x05~\x03\x02\x0f\xdb'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,451    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x85\x00\x00\x00\x06~\x03\x9c\x8d\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,451    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x85\x00\x00\x00\x06~\x03\x9c\x8d\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,476    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x85\x00\x00\x00\x05~\x03\x02\x0f\xd8'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,476    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x85\x00\x00\x00\x05~\x03\x02\x0f\xd8'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,601    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x94\x00\x00\x00\x06~\x03\x9c\x8e\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,602    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x94\x00\x00\x00\x06~\x03\x9c\x8e\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,615    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x94\x00\x00\x00\x05~\x03\x02\x0f\xd2'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,616    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x94\x00\x00\x00\x05~\x03\x02\x0f\xd2'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,720    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00~\x00\x00\x00\x06~\x03\x9c\x8f\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,721    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00~\x00\x00\x00\x06~\x03\x9c\x8f\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,736    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00~\x00\x00\x00\x05~\x03\x02\t&'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,737    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00~\x00\x00\x00\x05~\x03\x02\t&'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,842    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xc4\x00\x00\x00\x06~\x03\x9c\x90\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,843    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xc4\x00\x00\x00\x06~\x03\x9c\x90\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,856    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xc4\x00\x00\x00\x05~\x03\x02\t,'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,856    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xc4\x00\x00\x00\x05~\x03\x02\t,'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,961    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00^\x00\x00\x00\x06~\x03\x9c\x91\x00\x01'
Dec 27 21:14:01 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:01,962    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00^\x00\x00\x00\x06~\x03\x9c\x91\x00\x01'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,007    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00^\x00\x00\x00\x05~\x03\x02\t$'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,007    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00^\x00\x00\x00\x05~\x03\x02\t$'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,260    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x86\x00\x00\x00\x06~\x03\x9c\x92\x00\x01'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,261    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x86\x00\x00\x00\x06~\x03\x9c\x92\x00\x01'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,276    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x86\x00\x00\x00\x05~\x03\x02\xff\xff'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,276    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x86\x00\x00\x00\x05~\x03\x02\xff\xff'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,381    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x96\x00\x00\x00\x06~\x03\x9c\x93\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,382    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x96\x00\x00\x00\x06~\x03\x9c\x93\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,396    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x96\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,397    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x96\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,502    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x08\x00\x00\x00\x06~\x03\x9c\x95\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,503    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x08\x00\x00\x00\x06~\x03\x9c\x95\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,527    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x08\x00\x00\x00\x07~\x03\x04\x13\x88\xff\xfe'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,528    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x08\x00\x00\x00\x07~\x03\x04\x13\x88\xff\xfe'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,633    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00i\x00\x00\x00\x06~\x03\x9c\x9b\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,634    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00i\x00\x00\x00\x06~\x03\x9c\x9b\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,657    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00i\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,657    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00i\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,772    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00&\x00\x00\x00\x06~\x03\x9c\xa0\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,773    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00&\x00\x00\x00\x06~\x03\x9c\xa0\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,787    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00&\x00\x00\x00\x07~\x03\x04\xff\xff\x80\x00'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,788    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00&\x00\x00\x00\x07~\x03\x04\xff\xff\x80\x00'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,916    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xb1\x00\x00\x00\x06~\x03\x9c\xa2\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,917    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xb1\x00\x00\x00\x06~\x03\x9c\xa2\x00\x02'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,957    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xb1\x00\x00\x00\x07~\x03\x04\x00\x00\xff\xff'
Dec 27 21:14:02 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:02,957    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xb1\x00\x00\x00\x07~\x03\x04\x00\x00\xff\xff'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,137    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x04\x00\x00\x00\x06~\x03\x9c\xa4\x00\x02'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,138    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x04\x00\x00\x00\x06~\x03\x9c\xa4\x00\x02'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,197    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x04\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,198    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x04\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,316    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00K\x00\x00\x00\x06~\x03\x9c\xa7\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,317    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00K\x00\x00\x00\x06~\x03\x9c\xa7\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,368    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00K\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,368    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00K\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,474    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00t\x00\x00\x00\x06~\x03\x9c\xaa\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,474    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00t\x00\x00\x00\x06~\x03\x9c\xaa\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,506    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00t\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,507    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00t\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,612    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00g\x00\x00\x00\x06~\x03\x9c\xab\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,613    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00g\x00\x00\x00\x06~\x03\x9c\xab\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,647    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00g\x00\x00\x00\x05~\x03\x02\x00\x02'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,648    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00g\x00\x00\x00\x05~\x03\x02\x00\x02'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,753    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xa6\x00\x00\x00\x06~\x03\x9c\xac\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,754    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xa6\x00\x00\x00\x06~\x03\x9c\xac\x00\x01'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,803    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xa6\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,804    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xa6\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,956    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x8e\x00\x00\x00\x06~\x03\x9c\xcb\x00\x10'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,956    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x8e\x00\x00\x00\x06~\x03\x9c\xcb\x00\x10'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,989    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x8e\x00\x00\x00#~\x03 N/A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Dec 27 21:14:03 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:03,989    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x8e\x00\x00\x00#~\x03 N/A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,128    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xb2\x00\x00\x00\x06~\x03\x9c\xfe\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,129    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xb2\x00\x00\x00\x06~\x03\x9c\xfe\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,181    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xb2\x00\x00\x00\x05~\x03\x02\x00\x1a'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,181    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xb2\x00\x00\x00\x05~\x03\x02\x00\x1a'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,335    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xd0\x00\x00\x00\x06~\x03\x9c\xff\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,336    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xd0\x00\x00\x00\x06~\x03\x9c\xff\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,348    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xd0\x00\x00\x00\x05~\x03\x02\x00\x0c'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,349    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xd0\x00\x00\x00\x05~\x03\x02\x00\x0c'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,502    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xaf\x00\x00\x00\x06~\x03\x9d\x00\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,503    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xaf\x00\x00\x00\x06~\x03\x9d\x00\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,539    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xaf\x00\x00\x00\x05~\x03\x02\x00\x08'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,540    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xaf\x00\x00\x00\x05~\x03\x02\x00\x08'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,763    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00|\x00\x00\x00\x06~\x03\x9d\x01\x00\x02'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,764    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00|\x00\x00\x00\x06~\x03\x9d\x01\x00\x02'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,789    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00|\x00\x00\x00\x07~\x03\x04\x00\x06\xff\xff'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,790    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00|\x00\x00\x00\x07~\x03\x04\x00\x06\xff\xff'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,924    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00A\x00\x00\x00\x06~\x03\x9d\x02\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,924    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00A\x00\x00\x00\x06~\x03\x9d\x02\x00\x01'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,939    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00A\x00\x00\x00\x05~\x03\x02\xff\xff'
Dec 27 21:14:04 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:04,940    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00A\x00\x00\x00\x05~\x03\x02\xff\xff'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,047    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00j\x00\x00\x00\x06~\x03\x9d\x03\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,048    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00j\x00\x00\x00\x06~\x03\x9d\x03\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,068    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00j\x00\x00\x00\x05~\x03\x02[\x8a'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,069    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00j\x00\x00\x00\x05~\x03\x02[\x8a'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,175    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x12\x00\x00\x00\x06~\x03\x9d\x04\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,175    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x12\x00\x00\x00\x06~\x03\x9d\x04\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,200    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x12\x00\x00\x00\x05~\x03\x02[\x8a'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,200    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x12\x00\x00\x00\x05~\x03\x02[\x8a'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,306    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00O\x00\x00\x00\x06~\x03\x9d\x05\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,307    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00O\x00\x00\x00\x06~\x03\x9d\x05\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,341    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00O\x00\x00\x00\x05~\x03\x02[\xc7'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,342    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00O\x00\x00\x00\x05~\x03\x02[\xc7'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,448    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xfc\x00\x00\x00\x06~\x03\x9d\x06\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,449    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xfc\x00\x00\x00\x06~\x03\x9d\x06\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,480    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xfc\x00\x00\x00\x05~\x03\x02[e'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,480    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xfc\x00\x00\x00\x05~\x03\x02[e'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,585    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\x17\x00\x00\x00\x06~\x03\x9d\x0b\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,586    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\x17\x00\x00\x00\x06~\x03\x9d\x0b\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,600    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\x17\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,601    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\x17\x00\x00\x00\x05~\x03\x02\xff\xfe'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,706    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xee\x00\x00\x00\x06~\x03\x9d\x0c\x00\x02'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,706    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xee\x00\x00\x00\x06~\x03\x9d\x0c\x00\x02'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,731    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xee\x00\x00\x00\x07~\x03\x04\x13\x88\xff\xfe'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,732    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xee\x00\x00\x00\x07~\x03\x04\x13\x88\xff\xfe'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,837    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xb8\x00\x00\x00\x06~\x03\x9d\x0e\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,837    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xb8\x00\x00\x00\x06~\x03\x9d\x0e\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,849    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xb8\x00\x00\x00\x05~\x03\x02\xfe:'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,850    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xb8\x00\x00\x00\x05~\x03\x02\xfe:'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,975    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\xa8\x00\x00\x00\x06~\x03\x9d\x12\x00\x01'
Dec 27 21:14:05 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:05,976    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\xa8\x00\x00\x00\x06~\x03\x9d\x12\x00\x01'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,001    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\xa8\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,002    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\xa8\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,107    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x004\x00\x00\x00\x06~\x03\x9d"\x00\x02'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,108    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x004\x00\x00\x00\x06~\x03\x9d"\x00\x02'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,130    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x004\x00\x00\x00\x07~\x03\x04\x00\xa3_\xc9'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,131    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x004\x00\x00\x00\x07~\x03\x04\x00\xa3_\xc9'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,235    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00`\x00\x00\x00\x06~\x03\x9d2\x00\x01'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,236    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00`\x00\x00\x00\x06~\x03\x9d2\x00\x01'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,270    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00`\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,271    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00`\x00\x00\x00\x05~\x03\x02\x00\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,376    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00r\x00\x00\x00\x06~\x03\x9d3\x00\x02'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,376    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00r\x00\x00\x00\x06~\x03\x9d3\x00\x02'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,390    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00r\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,391    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00r\x00\x00\x00\x07~\x03\x04\x00\x00\x00\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,496    DEBUG modbus-proxy.Client(192.168.66.65:39376): received b'\x00\r\x00\x00\x00\x06~\x03\x9dC\x00\x01'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,497    DEBUG modbus-proxy.ModBus(192.168.66.57:502): sending b'\x00\r\x00\x00\x00\x06~\x03\x9dC\x00\x01'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,531    DEBUG modbus-proxy.ModBus(192.168.66.57:502): received b'\x00\r\x00\x00\x00\x05~\x03\x02\x80\x00'
Dec 27 21:14:06 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:06,531    DEBUG modbus-proxy.Client(192.168.66.65:39376): sending b'\x00\r\x00\x00\x00\x05~\x03\x02\x80\x00'
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,161     INFO modbus-proxy.Client(192.168.66.95:47560): new client connection
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,162    DEBUG modbus-proxy.Client(192.168.66.95:47560): received b'\x00\x01\x00\x00\x00\x06~\x03\x9c@\x00\x02'
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,163     INFO modbus-proxy.ModBus(192.168.66.57:502): connecting to modbus...
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,165    ERROR modbus-proxy.ModBus(192.168.66.57:502): write_read error [1/2]: ConnectionRefusedError(111, "Connect call failed ('192.168.66.57', 502)")
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,166     INFO modbus-proxy.ModBus(192.168.66.57:502): connecting to modbus...
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,169    ERROR modbus-proxy.ModBus(192.168.66.57:502): write_read error [2/2]: ConnectionRefusedError(111, "Connect call failed ('192.168.66.57', 502)")
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,169     INFO modbus-proxy.Client(192.168.66.95:47560): closing connection...
Dec 27 21:14:29 rsp2 modbus-proxy[13616]: 2022-12-27 21:14:29,171     INFO modbus-proxy.Client(192.168.66.95:47560): connection closed
Dec 27 21:14:42 rsp2 systemd[1]: Stopping Modbus-Proxy...
Dec 27 21:14:42 rsp2 systemd[1]: mproxy.service: Succeeded.
Dec 27 21:14:42 rsp2 systemd[1]: Stopped Modbus-Proxy.

TypeError: 'NoneType' object is not iterable

  • ModBus TCP proxy version: the last one
  • Python version:
  • Operating System: Rasppi2

Description

Unfortunately, when I try to start the program via the console, it doesn't work.
When I enter it using the details on the console it works great, but unfortunately it just doesn't stay active. As soon as I close the console the program apparently quits.
modbus-proxy -b tcp://192.168.2.84:9001 --modbus tcp://192.168.2.91:502 --modbus-connection-time 0.1 --timeout 15

Output of the error in the console:

return [ModBus(cfg) for cfg in config["devices"]]
TypeError: 'NoneType' object is not iterable

What I Did

What is written in the config file:

devices:
-modbus:
url: 192.168.2.91:502
timeout: 15
connection_time: 0.1
listen:
bind: 192.168.2.84:9001

Error-ModbusProxy

I have no idea what the error is anymore, I changed every IP address, I was able to remove all TAB errors but this error remains.

Modbus Proxy with Huawei SUN2000

  • ModBus TCP proxy version: 0.4.1
  • Python version: 3.8
  • Operating System: Ubuntu 20.04.3

Description

I am trying to proxy modbus TCP connections to a Huawei SUN2000 L1 inverter. I usually poll the device using solar-logger using a reduced version of scanner_2.py in that repository.

Unfortunately, I receive the following output from modbus proxy

root@zabbix:~# modbus-proxy -b tcp://0:5020 --modbus tcp://192.168.1.30:502
2021-09-20 09:10:03,578     INFO modbus-proxy: Starting...
2021-09-20 09:10:03,582     INFO modbus-proxy.ModBus(192.168.1.30:502): Ready to accept requests on 0:5020
2021-09-20 09:10:04,583     INFO modbus-proxy.Client(127.0.0.1:37407): new client connection
2021-09-20 09:10:04,584     INFO modbus-proxy.ModBus(192.168.1.30:502): connecting to modbus...
2021-09-20 09:10:04,590     INFO modbus-proxy.ModBus(192.168.1.30:502): connected!
2021-09-20 09:10:14,594    ERROR modbus-proxy.ModBus(192.168.1.30:502): write_read error: TimeoutError()
2021-09-20 09:10:14,594     INFO modbus-proxy.ModBus(192.168.1.30:502): closing connection...
2021-09-20 09:10:14,594     INFO modbus-proxy.ModBus(192.168.1.30:502): connection closed
2021-09-20 09:10:14,594     INFO modbus-proxy.ModBus(192.168.1.30:502): connecting to modbus...
2021-09-20 09:10:14,601     INFO modbus-proxy.ModBus(192.168.1.30:502): connected!
2021-09-20 09:10:24,603    ERROR modbus-proxy.ModBus(192.168.1.30:502): write_read error: TimeoutError()
2021-09-20 09:10:24,603     INFO modbus-proxy.ModBus(192.168.1.30:502): closing connection...
2021-09-20 09:10:24,603     INFO modbus-proxy.ModBus(192.168.1.30:502): connection closed
2021-09-20 09:10:24,603     INFO modbus-proxy.Client(127.0.0.1:37407): closing connection...
2021-09-20 09:10:24,604     INFO modbus-proxy.Client(127.0.0.1:37407): connection closed
2021-09-20 09:10:29,122     INFO modbus-proxy.Client(127.0.0.1:40587): new client connection
2021-09-20 09:10:29,123     INFO modbus-proxy.ModBus(192.168.1.30:502): connecting to modbus...
2021-09-20 09:10:29,127     INFO modbus-proxy.ModBus(192.168.1.30:502): connected!

The poller doesn't receive any data.

root@zabbix:~# /root/solar-logger/leer_solar.py
Conectando a Inversor
^CTraceback (most recent call last):
  File "/root/solar-logger/leer_solar.py", line 310, in <module>
    j = result.registers[0]
AttributeError: 'ModbusIOException' object has no attribute 'registers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/solar-logger/leer_solar.py", line 42, in read_holding
    j = result.registers[nb - 1]
AttributeError: 'ModbusIOException' object has no attribute 'registers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/solar-logger/leer_solar.py", line 317, in <module>
    result = read_holding(client, UnitID, Registro, 2)
  File "/root/solar-logger/leer_solar.py", line 47, in read_holding
    time.sleep(0.1)
KeyboardInterrupt

TBH I have no clue about why this is happening, I'm mostly sure it is related to the way the poller requests the information, more than modbus proxy itself, but if you have any hint, It would be much appreciated.

Thanks.

modbus-proxy to Homey Pro 2023

I am trying to disconntinue my server and move everything related to home automation to Homey.

Could modbus-proxy be ported/run on Homey Pro 2023?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.