-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Prerequisites
- I am running the latest Evok version
- I have searched other issues
Describe the bug
When using proxied RS485 communication (ttyNS*) in EVOK, the connection becomes unstable if more than one device is connected.
With a single device, communication works reliably. However, once an additional device is added, the communication starts to drop out and becomes unreliable. This makes it difficult to use EVOK in multi-device RS485 networks.
Evok log
....
DEBUG:evok:Registered new device 'ro' with circuit xS11_01 (<evok.modbus_slave.Relay object at 0xffffb394eb90>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_02 (<evok.modbus_slave.Relay object at 0xffffb394ec50>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_03 (<evok.modbus_slave.Relay object at 0xffffb394ed10>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_04 (<evok.modbus_slave.Relay object at 0xffffb394edd0>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_05 (<evok.modbus_slave.Relay object at 0xffffb394ee90>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_06 (<evok.modbus_slave.Relay object at 0xffffb394ef50>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_07 (<evok.modbus_slave.Relay object at 0xffffb394f010>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_08 (<evok.modbus_slave.Relay object at 0xffffb394f0d0>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_09 (<evok.modbus_slave.Relay object at 0xffffb394f190>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_10 (<evok.modbus_slave.Relay object at 0xffffb394f250>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_11 (<evok.modbus_slave.Relay object at 0xffffb394f310>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_12 (<evok.modbus_slave.Relay object at 0xffffb394f3d0>)
DEBUG:evok:Registered new device 'ro' with circuit xS11_13 (<evok.modbus_slave.Relay object at 0xffffb394f490>)
DEBUG:evok:Registered new device 'led' with circuit xS11_01 (<evok.modbus_slave.ULED object at 0xffffb394f550>)
DEBUG:evok:Registered new device 'led' with circuit xS11_02 (<evok.modbus_slave.ULED object at 0xffffb394f610>)
DEBUG:evok:Registered new device 'led' with circuit xS11_03 (<evok.modbus_slave.ULED object at 0xffffb394f6d0>)
DEBUG:evok:Registered new device 'watchdog' with circuit xS11_01 (<evok.modbus_slave.Watchdog object at 0xffffb394f790>)
DEBUG:evok:Registered new device 'nv_save' with circuit xS11 (<evok.modbus_slave.NvSave object at 0xffffb3929a50>)
ERROR:evok:xS11: Error while scanning: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_slave.py", line 223, in scan_boards
if await self.modbus_cache_map.do_scan(slave=self.modbus_address) is True:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_slave.py", line 99, in do_scan
vals = await self.modbus_slave.client.read_holding_registers(m_reg_group['start_reg'], m_reg_group['count'], slave=slave)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_unipi.py", line 43, in ret
aret = await operation(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/pymodbus/client/base.py", line 206, in async_execute
self.close(reconnect=True)
File "/opt/evok/lib/python3.11/site-packages/pymodbus/client/base.py", line 153, in close
self.connection_lost(asyncio.TimeoutError("Server not responding"))
File "/opt/evok/lib/python3.11/site-packages/pymodbus/transport/transport.py", line 300, in connection_lost
self.transport_close(intern=True)
File "/opt/evok/lib/python3.11/site-packages/pymodbus/transport/transport.py", line 419, in transport_close
self.transport.close()
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
WARNING:evok:Slowing down device: 'xS11'
INFO:evok:Communication with device is back: 'xS11'
ERROR:evok:xS11: Error while scanning: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_slave.py", line 223, in scan_boards
if await self.modbus_cache_map.do_scan(slave=self.modbus_address) is True:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_slave.py", line 99, in do_scan
vals = await self.modbus_slave.client.read_holding_registers(m_reg_group['start_reg'], m_reg_group['count'], slave=slave)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_unipi.py", line 43, in ret
aret = await operation(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/pymodbus/client/base.py", line 206, in async_execute
self.close(reconnect=True)
File "/opt/evok/lib/python3.11/site-packages/pymodbus/client/base.py", line 153, in close
self.connection_lost(asyncio.TimeoutError("Server not responding"))
File "/opt/evok/lib/python3.11/site-packages/pymodbus/transport/transport.py", line 300, in connection_lost
self.transport_close(intern=True)
File "/opt/evok/lib/python3.11/site-packages/pymodbus/transport/transport.py", line 419, in transport_close
self.transport.close()
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
WARNING:evok:Slowing down device: 'xS11'
INFO:evok:Communication with device is back: 'xS11'
ERROR:evok:xS11: Error while scanning: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_slave.py", line 223, in scan_boards
if await self.modbus_cache_map.do_scan(slave=self.modbus_address) is True:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_slave.py", line 99, in do_scan
vals = await self.modbus_slave.client.read_holding_registers(m_reg_group['start_reg'], m_reg_group['count'], slave=slave)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/evok/modbus_unipi.py", line 43, in ret
aret = await operation(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/evok/lib/python3.11/site-packages/pymodbus/client/base.py", line 206, in async_execute
self.close(reconnect=True)
File "/opt/evok/lib/python3.11/site-packages/pymodbus/client/base.py", line 153, in close
self.connection_lost(asyncio.TimeoutError("Server not responding"))
File "/opt/evok/lib/python3.11/site-packages/pymodbus/transport/transport.py", line 300, in connection_lost
self.transport_close(intern=True)
File "/opt/evok/lib/python3.11/site-packages/pymodbus/transport/transport.py", line 419, in transport_close
self.transport.close()
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
WARNING:evok:Slowing down device: 'xS11'
INFO:evok:Communication with device is back: 'xS11'
Steps to reproduce
- Set up EVOK with proxied RS485 communication (ttyNS*).
- Connect one RS485 device -> communication is stable.
- Connect a second RS485 device to the same bus.
- Observe communication instability and dropouts.
Expected behavior
EVOK should provide stable proxied RS485 communication even with multiple devices connected to the bus.
Actual behavior
With more than one device, communication drops out frequently and is not reliable.