Versions
- Python: 3.11.9
- OS: Win11
- Pymodbus: 3.15.0
Pymodbus Specific
Description
I was polling multiple slave addresses (1 - 10) to see how many slaves are connected. After several consecutive timeouts, the connection is automatically dropped, and subsequent requests immediately fail because there is no active connection.
I think this behavior should be disabled by default:
- The sync client (v.3.12) does not do so;
- It was a surprise to me;
- This logic should be explicitly handled by the application.
Workaround
Delete the following code in TransactionManager:
if self.count_until_disconnect < 0:
self.connection_lost(asyncio.TimeoutError("Server not responding"))
raise ModbusIOException(
"ERROR: No response received of the last requests (default: retries+3), CLOSING CONNECTION."
)
self.count_until_disconnect -= 1
Versions
Pymodbus Specific
Description
I was polling multiple slave addresses (1 - 10) to see how many slaves are connected. After several consecutive timeouts, the connection is automatically dropped, and subsequent requests immediately fail because there is no active connection.
I think this behavior should be disabled by default:
Workaround
Delete the following code in
TransactionManager: