ACPI temperature

Steven Friedrich freebsd at insightbb.com
Tue Dec 8 10:53:22 UTC 2009


On Sunday 06 December 2009 01:05:04 pm you wrote:
> On 5 Dec 2009, at 04:37, Steven Friedrich wrote:
> > I sent this to questions last Sunday, but only one person responded.
> > He's
> > running FreeBSD 8 and I think his system is reporting bogus temps too.
> > I think there might be a missing scaling factor. I'm a hardware guy,
> > but I
> > don't currently have temperature measuring equipment and I would
> > want to do it
> > on one of my towers (which are currently in storage), not my laptop
> > anyway.
> >
> > I booted my HP Pavilion zd8215us and I immediately invoked
> > chkCPUTemperature.
> > The first temp reported was 52C, which is 125.6F. This leads me to
> > believe
> > that acpi has an anomaly regarding temperature measurement. The
> > ambient temp
> > was 71F (21.6C). The machine had been off for over eight hours.
> 
> As others have said, 52C is pretty normal.
> 
> --
> Rui Paulo
> 
The 52C was only suspect because it reached it so quickly.
It usually runs around 73C, when building ports, etc.

In case anyone is interested, here are the scripts and themes I threw 
together. You may have to modify for your system.
here's readCPUTemp, be sure to change ^[ to ESC, i.e., in vi use Control-V ESC
#!/bin/sh
# $Id:$
#

ON_LIMIT_BLINK=78
ON_LIMIT_RED=75
# read CPU Temperature Information from ACPI and display in C and F
	CPU_TEMP_C=`sysctl hw.acpi.thermal.tz0.temperature|awk '{print substr($2, 1, 
4)}'`
	CPU_TEMP_C_INTEGER=`printf "%d" $CPU_TEMP_C 2>&1 | tail -n 1`

	[ "`tty`" = "not a tty" ] && (printf "%sC/%sF\n" $CPU_TEMP_C `toFahrenheit 
$CPU_TEMP_C`;exit)
	if [ $CPU_TEMP_C_INTEGER -ge $ON_LIMIT_BLINK ]; then
		printf "%s%sC/%sF\n" "^[[5m^[[31m" $CPU_TEMP_C `toFahrenheit $CPU_TEMP_C`
	elif [ $CPU_TEMP_C_INTEGER -ge $ON_LIMIT_RED ]; then
		printf "%s%sC/%sF\n" "^[[25m^[[31m" $CPU_TEMP_C `toFahrenheit $CPU_TEMP_C`
	else
		printf "%s%sC/%sF\n" "^[[25m^[[39m" $CPU_TEMP_C `toFahrenheit $CPU_TEMP_C`
	fi

here's chkCPUTemperature, which loops
#!/bin/sh
# $Id:$
#

# CPU Temperature Information from ACPI
POLLING_RATE=`sysctl hw.acpi.thermal.polling_rate|awk '{print $2}'`
while [ 1 ]
do
	readCPUTemp
	sleep $POLLING_RATE
done

Here's a superkaramba theme:
# CPU Temperature monitor

# General
KARAMBA  X=600 Y=500 W=445 H=40 BOTTOM=true ontop=true interval=10000 
locked=true

# grey
#defaultfont font="Arial" fontsize=36 color=150,150,150
# black
defaultfont font="Arial" fontsize=36 color=0,0,0

# cpu temp from acpi
text x=0 y=00 value="acpi tz0"
text x=180 y=00 sensor=program program="readCPUTemp"



More information about the freebsd-acpi mailing list