I have this code to connect to my sunny boy inverter.
"""
from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient(ip,
timeout=config.timeout,
RetryOnEmpty=True,
retries=3,
port=502)
print ("Connect")
client.connect()
time.sleep(5)
rr= client.read_input_registers(address=30775, count=2, unit=3)
"""
but I'm getting a broken pipe error as follow:
""""""""""""""
2019-06-09 06:43:33,042 MainThread DEBUG transaction :111 Current transaction state - IDLE
2019-06-09 06:43:33,042 MainThread DEBUG transaction :116 Running transaction 1
2019-06-09 06:43:33,042 MainThread DEBUG transaction :215 SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x78 0x37 0x0 0x2
2019-06-09 06:43:33,043 MainThread DEBUG sync :73 New Transaction state 'SENDING'
2019-06-09 06:43:33,043 MainThread DEBUG transaction :234 Transaction failed. ([Errno 32] Broken pipe)
2019-06-09 06:43:33,043 MainThread DEBUG socket_framer :147 Processing:
2019-06-09 06:43:33,043 MainThread DEBUG transaction :390 Getting transaction 1
2019-06-09 06:43:33,044 MainThread DEBUG transaction :189 Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE
""""""""""""""""""
I have tried both python 2.7 and 3.7 and modbus 2.1.0. I have also tried other uid and addresses on the same cluster, but the same error for all. I appreciate any suggestions and help on this.
thanks