I have problem with pymodbus TcpClient timeout:
import logging
from pymodbus.client.sync import ModbusTcpClient
logging.basicConfig()
log = logging.getLogger()
log.setLevel(logging.DEBUG)
client = ModbusTcpClient('x.y.z.w', port=yyy)
client.connect()
result = client.read_holding_registers(10, 10)
print(result.registers)
client.close()
Error:
DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.transaction:Transaction failed. (timed out)
ERROR:pymodbus.client.sync:Connection to (x.y.z.w, yyy) failed: [Errno 10061] ╧юфъы■ўхэшх эх єёЄрэютыхэю,
Modpool with tiomeot=1 I have error:
modpoll.exe -c 5 -r 10 -o 1 -p yyy -m tcp x.y.z.w
-- Polling slave... (Ctrl-C to stop)
Reply time-out!
But with timeout=10 all goods:
modpoll.exe -c 5 -r 10 -o 10 -p yyy -m tcp x.y.z.w
-- Polling slave... (Ctrl-C to stop)
[10]: 2
[11]: 10
[12]: 10
[13]: 10
- How change default timeout in pymodbus TcpClient?