-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Modbus Crashes on 0.108.1 using Serial #33872
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
Comments
I'm seeing the same problem with 0.108.1, and also with the latest dev-branch.
|
CONF_DELAY was used in a serial connection, which is not permitted. Sometimes async_update is called after async_setup is completed, but before event EVENT_HOMEASSISTANT_START is issued, leading to a missing object.
* solve modbus issue #33872 CONF_DELAY was used in a serial connection, which is not permitted. Sometimes async_update is called after async_setup is completed, but before event EVENT_HOMEASSISTANT_START is issued, leading to a missing object. * resolve review comment. Do not wait for start event, but activate pymodbus directly in async setup. * review 2 Remark, this does not work, async_setup hangs. clean start_modbus() from async calls, leaving only the pymodbus setup. * review 2a Moved listen_once back to start_modbus, since it is sync.
Hey there @adamchengtkc, mind taking a look at this issue as its been labeled with a integration ( |
A fix is merged on dev, and ready for testing. |
With the latest dev branch, I had to manually install But I still get the following warnings/errors:
My configuration looks like this:
|
I wonder why I did not have to install pyserial-asyncio, we have pymodbus in the manifest, but not the dependencies of that. Normally each package only list the direct dependencies. I will take a look at pymodbus. I think you caught a real UPS, timeout is silently ignored in my test setup. I will remove it in line 208 of init.py |
No luck with Latest PR:
Subsequently: Unable to prepare setup for platform modbus.switch: Unable to set up component. |
Please verify that components/modbus/init.py line 199 ++ looks like this:
NO timeout= parameter. I just checked the PR on github and it contains a removal of timeout=, so maybe you have the old version of the PR. |
Thanks, updated with new error:
|
hmm this looks to me as if your installation (including the fact that you had to manually install pyserial-asyncio) is somehow not updated. Please verify with pip3 that you have the right packages installed. Or even better uninstall pymodbus, to get a fresh install. |
I think you're confusing me with @marhoy I made no changes to my packages but just for the sake of it I uninstalled and reinstalled to no avail: (same error)
|
@janiversen To be clear about my setup. I'm:
Given this: I
|
@thehaxxa I was not confused, but did not direct my comment directly at @marhoy. Btw the PR is ready for you to test. @marhoy I have no idea why pyserial-asyncio is not installed as part of pymodbus on your machine, but it should be. If you manually need to remove line 207, then it seems you have not gotten the PR. The PR contains this removal along with a number of other changes. That PR is not yet in dev. |
Today I worked with dev dd7fbef I also had to install 'pyserial-asyncio' manually. 'script/setup' does not installed it. |
I replaced every file with the latest PR, I can confirm the same error listed as before occurs. |
Just tested with the latest dev-branch (at commit 9535dd8, which I think includes your PR?)
|
* solve modbus issue #33872 CONF_DELAY was used in a serial connection, which is not permitted. Sometimes async_update is called after async_setup is completed, but before event EVENT_HOMEASSISTANT_START is issued, leading to a missing object. * resolve review comment. Do not wait for start event, but activate pymodbus directly in async setup. * review 2 Remark, this does not work, async_setup hangs. clean start_modbus() from async calls, leaving only the pymodbus setup. * review 2a Moved listen_once back to start_modbus, since it is sync.
All of the PRs thus far are included in 0.108.2, which I have now upgraded to. Just confirming the same issue persists:
|
Hello. |
Please add the specific line “ In HA 0.107.7 there is the correct connection options (with rtuovertcp). In HA 0.108.2 there isn't this log line.” and surely there is a line in 0.108b too but different, which would be nice to see. |
Should I wait for the update for a couple of hours or is it better to roll back to 0.107.7? I can’t turn on the light because of this problem with serial modbus. |
It is definitively going to take at least until tomorrow until a patch is merged, so if you want light you need to roll back. Depending on your setup, a midway is to pick the directory components/modbus from 0.107.7 and replace it in 0.108x. That is actually how I do a lot of the regression testing. |
I updated my Home Assistant to version 0.108.3 and still have a problem. On version 0.107.7 all works perfect. Ony after update is a problem. and in logs show me this: Is any solution for it ? |
For the moment only copy the components/modbus files from 0.107.7 to current or downgrade. We are working on a patch but this is a far from simple bug. |
copying the 0.107.7 modbus component folder to new one didn't helped. The problem still persists. |
@docvipul then you did not copy the directory with files correctly. Version 0.107.7 has been reported by many as working because it did not have any of the async connections. If you still get the serial connect problem as reported here, you are still running with the new version. |
I am happy to inform you all, that I have solved the problem at hand !!! However due to the lockdown in Spain I do not have access to my serial modbus equipment, so I have only tested that the client is created correctly (the error reported in a couple of variants here), so I hope some of you will pick PR #34043 and check if it passed into actually doing something. I am not sure how well serial reconnect is handled, should this be a problem, then please make a new issue and attach the debug logs. Any other new problems you might find (hope not, this one caused quite some pain to solve) please make a new issue for each, that way it is easier for me to make PRs. Thanks in advance for helping with test and your patience. ohhh, of course I would also like to hear if it works :-) |
So I just tested the PR and in good news the PR has stopped errors appearing in HASS Logs but in bad news none of my Modbus Serial Devices work. New Issue has made made (relating to this issue): #34046 |
Thanks, nice to get a confirmation. Plan is to get the current PR merged, and then issue a new PR for the new issue. |
As Modbus is no longer crashing, I am closing this issue. The implementation is still broken (for serial devices) as noted in the new issue: #34046 |
Just for info, please do not close an issue, when the PR is not merged to dev. When the PR is merged, the issue will automatically be closed. The reason for this is, that if you pull dev the issue is not closed. |
0.108.3 modbus/serial still has error
@janiversen, is I need to make new issue? |
No this issue is still open, and your error is exact this issue. There is a PR #34043 waiting to be merged that solves this issue but it turned out that there are followup issues. If you like to beta test you can grab the files in PR #34043, which solves the connect but seems to have problems communicating. We are discussing the communication problem on issue #34046 |
hello, The problemHello team, I use the modbus integration together with a USB to UART module for more than a year to readback information from my solar charger. Everything worked fine until version 0.107.x when I jumped to the 0.108.5 and 0.108.6, the modbus integration is showing the following warning and errors and the entities are not created. I didnt try rolling back to 0.107 yet EnvironmentRpi3B+
Problem-relevant
|
This issue is closed, because the problem is solved. The solution is in the newest 0.108 patch release |
Hello Janiversen! thanks for fast response. I'm on 0.108.6 already and I still have the issue. Do I need to switch to the dev branch? |
But it is NOT in 0.108.6 newest release is 0.108,7 which was made yesterday. You can always look at the release notes to see if a fix is included or not. |
I confirmed it works on 0.108.7. Regards, |
@omellin if u r still facing issues you can do this for time being:
|
@docvipul that is a correct way of using 0.107.7 in 0.108.* and it works unless you use one of the integrations that depend on modbus. However it is going to be a long “for time being”, because we do not work on this issue, until we see some debug logs (from 0.108.7 or higher) showing problems. |
btw the fix in 0.108.7 is basically that copy, hence big surprise if something works in 0.107.7 and not in 0.108.7+ |
@janiversen we appriciate your efforts. You’re doing a great job !! Thanks. |
ok, i didnt see the update available in the supervisor so i forced "ha core update --version=0.108.7" and it works now ! thanks so much! |
The problem
Modbus Crashes in Home Assistant 108.1 using Serial Connection.
Environment
0.108.1
0.107.7
Home Assistant
Modbus
https://www.home-assistant.io/integrations/modbus/
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information
Different Issue to Recently fixed MODBUS issue.
The text was updated successfully, but these errors were encountered: