-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Fix modbus 8000 transaction response #33824
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
Conversation
Hey there @adamchengtkc, mind taking a look at this pull request as its been labeled with a integration ( |
Sometimes a modbus server do not respond to a transaction, this is a contradiction to the modbus protocol specification, but merely a matter of fact. Use asynio.await_for() to provoke a timeout, and close the transaction.
31beb98
to
66c31d2
Compare
@MartinHjelmare changed according to your suggestion (and tested). I updated the commit (look for _read and _write). @balloob you approved the PR earlier, so just informing you that the content have changed slightly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
For the future, please don't squash commits after review has started to make it easier for readers to track changes. We'll squash when merging.
hmmm: |
No, that's not you. Sorry. It's fixed on dev now. It would be good to rebase this PR on dev again to make sure nothing else is wonky. |
I'll merge it, I want to tag the beta :) |
Sometimes a modbus server do not respond to a transaction, this is a contradiction to the modbus protocol specification, but merely a matter of fact. Use asynio.await_for() to provoke a timeout, and close the transaction.
This or the other change to modbus seems to have broken something related to my modbus setup. I don't have a good enough understanding of either modbus protocol or the change that is implemented in these PR. See mine https://community.home-assistant.io/t/0-108-logos-area-pages-lovelace-entity-card-lovelace-map-history/184891/309?u=jolo and also this report: https://community.home-assistant.io/t/0-108-logos-area-pages-lovelace-entity-card-lovelace-map-history/184891/68 |
Please open an issue if you suspect a bug. Merged PRs should not be used for support or bug reports. Thanks! |
Breaking change
Proposed change
Sometimes a modbus server do not respond to a transaction,
this is a contradiction to the modbus protocol specification,
but merely a matter of fact.
This patch implements a timeout (as configured in the modbus: platform or default 3sec),
which cancels the transaction and sets unavailable (next scan cycle, will hopefully get a value).
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
fixes: Modbus broken in 0.108b #33754
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: