Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'CPU temperature and hardware sensor readouts in bash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
CPU temperature and hardware sensor readouts in bash
Authored by: albertoricart on Oct 27, '05 06:51:13AM

Hello,

I wrote a similar thing as a dashboard widget (http://www.smartsoft.com), and found that the problem is actually quite a bit more complex than expected.
The value in the registry is an encoded value. And the encoding/meaning of the values varies depending on the machine.

So for example, the correct reading for powerbooks goes like this: The value written in the registry is actually encoded to the hardware sensor. On most machines, the value is a 32 bit int, with the upper word being the degrees in C and the lower word the fractional part of the temperature.

On other machines the value may not even be a temperature, but just some seed for the fan, or needed to be read from the fan itself. In those cases the actual temp cannot be deduced by looking at this value without having the calibration data for the fan (in prom). As you can see this ends up being quite a bit of work it requires custom code for each of the machines or sensor type.



[ Reply to This | # ]