-
Notifications
You must be signed in to change notification settings - Fork 8.2k
sensors: ds18b20: reliablilty improvements #75246
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Move the content of the header file into the source file, and drop unnecessary includes. - Also, drop the bus access function. Signed-off-by: Thomas Stranger <[email protected]>
After each read of the scratchpad the crc of the data is checked and in case of a mismatch an error is returned. Signed-off-by: Thomas Stranger <[email protected]>
Verify that the scratchpad write was successful by reading back the configuration. Signed-off-by: Thomas Stranger <[email protected]>
When multiple devices are on the bus, and no slave matches the sent rom, the master receives only ones. This should be handled explicitly and the error reporting should not rely on the crc mismatch of the scratchpad. Note: Make sure that the sensor configuration is loaded to the eeprom (copy scratchpad), otherwise the resolution will not match the expectations in case a node looses power and recovers. As in that case the configuration will not be applied again. Also the sensor may still report the power on reset value of +85°C just after the sensor powered up. Signed-off-by: Thomas Stranger <[email protected]>
Any errors are clearly indicated and program execution ended. Signed-off-by: Thomas Stranger <[email protected]>
Martdur
reviewed
Jul 2, 2024
Contributor
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.
As discussed 74898 I've done quite the same modification on my DS18B20 implementation and I can detect bad reading scratchpad so I can only agree this PR
But I've not tested this specific PR for the moment, maybe some further tests are needed.
MaureenHelm
approved these changes
Jul 9, 2024
ubieda
approved these changes
Jul 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several reliability improvements to the sensor driver that make sure the configuration is applied correctly and sensor issues causing invalid read(device disconnection, bus disruption) are reported correctly.
Additionally, error handling is added to the corresponding sample.
Closes #74898