Is sensord supposed to work on the Pi?

Jun 10, 2015 13 Replies

Is sensord supposed to work on a Pi? (If it matters, I've just started playing with a 2 B.) I installed the package, ran sensors-detect, patched one line of it [1], & ended up with "Sorry, no sensors were detected."



Is the sensord package supposed to work on the Pi, or is it just in the repository because it comes from upstream & compiles?


[1] this, but on a slightly different line number:

Master Foo said: "A man who mistakes secrets for knowledge is like a man who, seeking light, hugs a candle so closely that he smothers it and burns his hand." --- Eric Raymond

No it doesn't work; the Pi doesn't have any of the sensor chips used on PC motherboards which sensors-detect is looking for.

Below is something very similar using RRD. Put the following in a script file and get cron to run it every 5 minutes. You can then use the graphing tools with RRD in the same way as sensord does.

----- #!/bin/sh

rrd="/run/temp.rrd" if [ ! -e "$rrd" ] then echo 'recreating rrd file!' rrdtool create $rrd DS:temp:GAUGE:600:0:120000 RRA:AVERAGE:0.5:1:288 RRA:AVERAGE:0.5:7:288 fi

t1=`cat /sys/devices/virtual/thermal/thermal_zone0/temp` upper=84000 lower=0 if [ "$t1" -lt "$upper" -a "$t1" -gt "$lower" ] then t2=`cat /sys/devices/virtual/thermal/thermal_zone0/temp` if [ "$t2" -lt "$upper" -a "$t2" -gt "$lower" ] then tmp=$(($t1+$t2)) tmp=$(($tmp/2)) rrdtool update $rrd N:$tmp # echo "t1 = $t1, t2 = $t2, temp = $tmp" fi fi

-----

Dave

OK, I guess it's just in the repository as a "left-over" from Debian.

Actually, it looks like all I need for now is this line:

which I'll combine with a syslog command, since I'm just used to finding that sort of thing in the syslog. But the database/graphing stuff looks interesting in the long run.

I guess the number that comes out is degrees C * 1000?

Thanks!

Our scientific power has outrun our spiritual power. We have guided missiles and misguided men. --- Martin Luther King, Jr.

An alternative command in Raspbian is vcgencmd measure_temp, like this:

pi@raspi2 ~ $ vcgencmd measure_temp temp=42.2'C

I see that command is well documented in the system: ;-)

$ man vcgencmd No manual entry for vcgencmd See 'man 7 undocumented' for help when manual pages are not available. $ vcgencmd --help error=1 error_msg="Command not registered" $ vcgencmd help error=1 error_msg="Command not registered"

Curiously, I get varying results from that while the thermal_zone0/temp file doesn't change:

$ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp

39007 temp=39.0'C $ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp 39007 temp=39.5'C $ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp 39007 temp=39.0'C $ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp 39007 temp=39.0'C $ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp 39007 temp=38.5'C $ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp 39007 temp=39.0'C $ cat /sys/devices/virtual/thermal/thermal_zone0/temp ; vcgencmd measure_temp 39007 temp=40.1'C

Why is that?

'...and Tom [Snyder] turns to him and says, "so Alice [Cooper], is it true you kill chickens on stage?" That was the opening question, and Alice looks at him real serious and goes, "Oh no, no no. That's Colonel Sanders. Colonel Sanders kills chickens."'

I suspect it's just 'noise' on the sensor output. That's why my script takes two measurements and averages them. Occasionally I've seen completely wild figures, so the script rejects any nonsensical values.

Dave

Interesting, thanks.

Cats don't have friends. They have co-conspirators. http://www.gocomics.com/getfuzzy/2015/05/31

At the three mile island nuclear power plant the operators ingnored ``nonsensical'' temperature values...

Ron

More people died at Chappaquiddick..

New Socialism consists essentially in being seen to have your heart in the right place whilst your head is in the clouds and your hand is in someone else's pocket.

YMMV, but nuclear power is way outside the scope of anything I'm planning to use the Pi for.

The love of money as a possession ... will be recognised for what it is, a somewhat disgusting morbidity, one of those semi-criminal, semi-pathological propensities which one hands over with a shudder to the specialists in mental disease. --- J M Keynes

On Fri, 12 Jun 2015 16:00:33 -0400, rickman declaimed the following:

But Chernobyl ensured the silence of the "Russian Woodpecker" (The Kenwood R-5000 actually had a second noise blanker function designed just for the woodpecker...)

Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

No pone got cancer at 3MI either.

New Socialism consists essentially in being seen to have your heart in the right place whilst your head is in the clouds and your hand is in someone else's pocket.

My comment was meant to be somewhat hyperbolic about ignoring ``nonsensical'' temperatures. I should have realized that some people get political at the mention of nuclear and I apologize for thoughtlessly polluting the group.

Please. Any further discussion to e-mail or an appropriate group.

Ron

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required