Skip to content
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

One-wire senosors unintendendly read on Linux #2451

Open
antonverburg opened this issue Oct 3, 2024 · 0 comments
Open

One-wire senosors unintendendly read on Linux #2451

antonverburg opened this issue Oct 3, 2024 · 0 comments

Comments

@antonverburg
Copy link

antonverburg commented Oct 3, 2024

Summary

  • OS: Linux homeassistant 6.6.31-haos-raspi SMP PREEMPT Wed Aug 21 16:29:59 UTC 2024 aarch64 Linux
  • Architecture: 64bit
  • Psutil version: 6.0.0
  • Python version: 3.12.4
  • Type: conflicting hardware

Description

When using parasitic-powered 1-wire temperature sensors with the DS2482S-100 line driver, the 1-wire temperature sensors now-and-then reported temperature 85degC. This indicates that the time that the device could consume the parasitic power from the dataline was too short to make a valid temperature readout.
Further investigation with oscilloscope showed me that another client was sending readout messages to the one-wire sensor during the time that the dataline was feeding power. This causes the line master to stop feeding power. And for that reason, the sensor returned 85degC.
Looking for the cause of this disruption I found that the Systemmonitor of Homeassistant uses psutil for monitoring all kind of system resources, including CPU temperature. Psutil is reading all sensors in /sys/class/hwmon/. As linux also propagates the one-wire sensors in this directory, these sensors are read as well. I think it is not the intention of psutil to read those sensors; a single readout can take up to 1 second time, so if a system contains a lot of these sensors, reading all of them can take a lot of time. Beside that, temperature sensors on the onewire bus are not interesting for system monitoring. So I propose to skip the onewire sensors when reading the content of /sys/class/hwmon. I will prepaire a tested pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant