thinkfan icon indicating copy to clipboard operation
thinkfan copied to clipboard

WIP: Warn about unusual sensor readings

Open mmtj opened this issue 5 years ago • 6 comments

Related issue: #77

This PR attempts to warn user about unusual sensors readings by log messages. In current state it is more like crude attempt and I am open to suggestions, how to make this PR better.

There certainly is room for improvements, just to mention few:

  • Is there a generic way to report such readings from any SensorDriver instead of impletement it in every driver read_temps()?
  • Is it better to use string/stringstream in section of code or predefined string using #define in header file?

mmtj avatar Oct 31 '19 02:10 mmtj

As in my comment on the issue: It won't work this way. Some implementation-related remarks presupposing you actually want to go through with the mentioned noise estimation:

  • The entire logic should go into the TemperatureState class.
  • You should be able to just << everything into the log(...) function.
  • Missing noise should be checked/reported in the run(...) function, but only after enough data have been gathered.

vmatare avatar Oct 31 '19 13:10 vmatare

Giving it some more thought: If we want to warn/fail only if the noise is actually 0, the noise estimation can (and should) be rather cheap. Note also that in DANGEROUS mode it should be logged as an error, but thinkfan should keep running. That's what the error(...) function is for.

vmatare avatar Oct 31 '19 13:10 vmatare

Giving it some more thought: If we want to warn/fail only if the noise is actually 0, the noise estimation can (and should) be rather cheap.

Sound reasonable. But just to be on the same side, what exactly do you mean by noise here?

mmtj avatar Oct 31 '19 23:10 mmtj

what exactly do you mean by noise here?

Well, the noise in the temperature readings. If there is no noise in a sensor, we can safely assume that sensor isn't measuring anything.

That said, we don't need a "correct" noise measure. We could e.g. just sum up the temperature changes during the last N cycles. If that sum is 0 for a large enough N, we know something must be wrong.

vmatare avatar Nov 01 '19 20:11 vmatare

Ok, that sound fairly simple and I'll try to implement it.

mmtj avatar Nov 04 '19 22:11 mmtj

Oh just realize this is from 2019. Sorry for digging it up. Do we still need this feature though?

wonbinbk avatar Feb 15 '24 11:02 wonbinbk