Closed ericvb closed 3 years ago
modbus documentation modbus source (message by IssueLinks)
Hey there @adamchengtkc, @janiversen, @vzahradnik, mind taking a look at this issue as it has been labeled with an integration (modbus
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
It seems your UNO is not responding, did you try to debug on the UNO.
It could be the UNO, that can not follow if multiple requests. For that I tested with only one sensor defined in the yaml and a scan interval of 60 seconds, but same problem. Don't know if I can debug the UNO, the code is opensource, it should be possible.
Do you have practical experience with this sort of setup : HA with modbus rtuovertcp <--> modbus rtu over tcp gateway <--> serial modbus device. If yes, what for modbus rtu over tcp gateway did you use? Self-build or commercial product?
I have heard of several that use a “converter”, but I cannot tell you which types etc. for that you need to ask in the community. I have a test setup with a software converter, but that is merely to test the code.
Surely the UNO software have some kind of debug log as well, typically the write directly to the serial port.
Hi @janiversen, I've talked to the maker of the UNO gateway software and he had done just corrections to his code. So I installed his new version, and the problem is gone, no more errors in the logfiles!
The problem
Trying to debug the problem and to understand what is happening in the logfile.
I have HA running on a Ubuntu OS with IP 192.168.1.x An Arduino UNO acts like a RTUOverTCP (https://github.com/budulinek/arduino-modbus-rtu-tcp-gateway) and is connected (serial) with a modbus enabled SDM630 powermeter. The Arduino runs in another VLAN 192.168.x.x. HA is configured to connect to this Arduino RTUOverTCP.
Everything works, but regurarly the device sensor has Unavailable and when consulting the logfile
2021-10-10 14:17:08 ERROR (SyncWorker_9) [homeassistant.components.modbus.modbus] Pymodbus: sdm630_laadpaal: Modbus Error: [Connection] ModbusTcpClient(192.168.x.x:502): Connection unexpectedly closed 0.000026 seconds into read of 2 bytes without response from unit before it closed connection
So I activated the logging in HAlogger: default: info logs: homeassistant.components.modbus: debug pymodbus.client: debug
What is version of Home Assistant Core has the issue?
2021.10.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
Modbus
Link to integration documentation on our website
https://www.home-assistant.io/integrations/modbus
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
Above logging continues and continues... I've been testing with different values for the delay, retries, timeout, close_com_on_error, .... For the moment the configuration is set to retrieve only one sensor from the SDM630, but always the same error