-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modbus serial gives no response after core update to 2024.4.1 #115039
Comments
Hey there @janiversen, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) modbus documentation |
Seems your device is not responding, that can be due to a number of causes, the most frequent is that the port have changed. In order for us to see if there are a bug, please submit a debug log as pr modbus integration documentation. |
I started getting the same error after 2024.4. LOG: And config:
|
Unfortunately the same thing here.
|
@simoautio that is hardly the same problem, you are using tcp the issue is about serial, apart from that you have cut the log, so the interesting part is not included. @mr-p666 I can see you have a problem, but since you do not publish the config I cannot see why. @e6on that helps absolutely nothing,...."me too", does not work to help find a problem, please follow the guidelines. |
If you follow the log:
This is the normal pattern, and valid, but when continuing you see:
We suddenly receive a message we never asked for, and that of course leads to some "confusion". I see the "Unrequested message" in the other log as well, which signals we receive a message we never asked for. I am not sure if that is bug in the integration/the library or somewhere else. |
Here is some additional info from the logger: 2024-04-07 09:51:26.605 INFO (MainThread) [homeassistant.components.modbus.modbus] modbus WP communication open |
@Richardvdw01 I need a debug log as pr modbus integration documentation, what you provide is just the errors and do not help. @mr-p666 I analyzed your log, since you have 2 open connections it is impossible to debug. Please make a debug log only with the faulty connection. |
Here are the debug logs: 2024-04-07 10:30:32.021 DEBUG (MainThread) [pymodbus.logging] Connecting to /dev/ttyUSB0. |
Thanks that looks more understandle....and it seems the "unrequested response" is gone. I will have a closer look later. |
Created proper issue here #115114 |
I am confused, you DO get a lot of entity updates, so at the very least the title is not correct ! At 10:30:51.293 you have a communication errors:
At 10:30:51.395 it is reconnected and data flows again.
So it seems to me, you do get data (title says "no response"), and the integration reconnects automatically. Of course you have a short time where the entity is marked as unavailable which is CORRECT, because the device is not connected. |
@JCRundy if you want us to look at something, you need to:
Without that, we cannot see if there are a bug or not, however a timeout of 0.1 is extremely short, and will lead to the connection being closed due to lack of response, so with that in mind it is no surprise to see that you have stability issues. |
Just to confirm this seems to be a broader issue, I unfortunately also have errors with the modbus integration since 2024.4.1, everything was working fine before and nothing was changed. Config of the modbus config:
Error message with debug enabled in the log file:
Fyi. The Mennekes Wallbox is pingable and has a web page that can be accessed. |
@redlefloh it might be a broader issue, but if you want us to look at your problem, you need to follow the guideline about....what you have provided does not make it possible to see what happens. that a site is pingable does not tell if it has shorter disconnections, nor does it tell if your device have a response time > 5sec. |
From what I have seen until now, it is more a matter of that the new version is a lot faster, and thus detects connections breakages a lot more frequently. The modbus integrations marks an entity as unavailable whenever the connection is broken, which reflect the real state of the entity....the async version (introduced in 2024.4.0) is about 10-15 times faster, and thus picks up a lot more than the old sync version. That is the reason it is marked as a "breaking change" in the release notes. |
Thanks for your responsiveness, I had already done what you asked to check that it was what was mentioned in this post.
I'm going to analyse this... it seems that during a time out it relaunches the next modbus request even though it's not ready to receive the response. Thanks to you "2024-04-07 20:46:08.851 DEBUG (MainThread) [pymodbus.logging] Connecting to 192.168.20.13:502. |
"I'm going to analyse this... it seems that during a time out it relaunches the next modbus request even though it's not ready to receive the response." That is an interesting idea, that should not happen, looking forward to read your analysis. |
Analyzing the log, there are NO bugs in the modbus integration or lib. What happens is that the device do not respond during 3 timeouts and thus the connection is closed and restarted, that causes the entities to be marked as unavailable, which in my mind is correct since the connection is broken. |
Closing this, because as of this moment, all logs have shown that THERE ARE RESPONSES ! however this version sets the entities to unavailable even with a short disconnect (which was probably not detected earlier), but in all the logs above it reconnects and starts updating again. |
Thank you for everything, I'm not saying that there is a bug in your work but maybe elsewhere in this new version of HA, who knows? I confirm that when my devices 51 and 52 are present, my device 11 appears available but when 51 and 52 are disconnected, device 11 appears unavailable. My field is electronics. I am therefore not good enough in programming to continue this discussion. " |
@janiversen - Sorry for the missing config.
And here is also a new logfile with the faulty connection only:
|
Thank you for investigating. |
Thanks for your confidence, however I think there is a problem with the modbus integration....just not with the title of this issue "No response" or your text "Modbus fails to read data fom any register.", since you obviously do get data, just not as you would like them. And be aware I do not look at issues in other repos. There seems to be a problem with:
|
The problem
After core update to 2024.4.1 Modbus fails to read data fom any register.
What version of Home Assistant Core has the issue?
2024.4.1
What was the last working version of Home Assistant Core?
2024.3.3
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Modbus
Link to integration documentation on our website
https://www.home-assistant.io/integrations/modbus/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: