lm_sensors on Fit-PC2
lm_sensors on Fit-PC2
I am struggling with one important thing on the Fit-PC2 - lm_sensors. I want to measure and track (e.g. with hobbit) the CPU temperature.
It seems that sensors-detect (on Ubuntu 8.04) detects lm92 due to Maxim chips - and also ds1621 due to "`Dallas Semiconductor DS1621", but lm92 nor the ds1621 is not available as a loadable module on the Compulab Ubuntu 8.04 recovery image. Is this a
glitch or am I missing something?
It seems that sensors-detect (on Ubuntu 8.04) detects lm92 due to Maxim chips - and also ds1621 due to "`Dallas Semiconductor DS1621", but lm92 nor the ds1621 is not available as a loadable module on the Compulab Ubuntu 8.04 recovery image. Is this a
glitch or am I missing something?
Re: lm_sensors on Fit-PC2
The only thermal sensors in fit-PC2 are built-in in CPU thermal sensors, installing lm-sensors is useless.
In general you can monitor CPU temperature via /proc/acpi/thermal_zone/TZ00/temperature, but on fit-PC2 it shows 0. We are working on this.
At the current moment you can measure CPU temperature using attached script, that reads special registers in PCI space. Run it as root.
Script shows reliable temperature above 50 C, under 50 C it shows 50 C by default.
In general you can monitor CPU temperature via /proc/acpi/thermal_zone/TZ00/temperature, but on fit-PC2 it shows 0. We are working on this.
At the current moment you can measure CPU temperature using attached script, that reads special registers in PCI space. Run it as root.
Script shows reliable temperature above 50 C, under 50 C it shows 50 C by default.
Code: Select all
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
fi
PCI_DEV_ADDR=00:0.0
REG_MCR=D0
REG_MDR=D4
B0_INIT=FFFFFFFF
B0_EXIT=00000000
function init_thermal {
setpci -s $PCI_DEV_ADDR $REG_MDR.l=$B0_INIT
setpci -s $PCI_DEV_ADDR $REG_MCR.l=E004B000
}
function exit_thermal {
setpci -s $PCI_DEV_ADDR $REG_MDR.l=$B0_EXIT
setpci -s $PCI_DEV_ADDR $REG_MCR.l=E004B000
}
# sch_read_reg: $1 - port, $2 - register
function sch_read_reg {
setpci -s $PCI_DEV_ADDR $REG_MCR.l=D0"$1""$2"00
for i in `seq 6 9`; do
R1=`lspci -s $PCI_DEV_ADDR -xxx | grep "d0:" | cut -d " " -f $i`
R2=$R1" "$R2
done
echo $R2
}
function convert_to_celsius {
R1=0x$1
let R2=$R1
C1=$((1680*$R2*$R2/1000000))
C2=$((82652*$R2/100000))
C3=$(($C1 - $C2 + 127 ))
echo $C3
}
# main:
init_thermal
unconverted=`sch_read_reg "04" "B1" | cut -d " " -f 4`
sensor0_celsius=`convert_to_celsius $unconverted`
unconverted=`sch_read_reg "04" "B1" | cut -d " " -f 3`
sensor1_celsius=`convert_to_celsius $unconverted`
surface_celsius=$((($sensor0_celsius + sensor1_celsius)/2 - 7 ))
echo "CPU core: $sensor0_celsius-$sensor1_celsius C, CPU surface: $surface_celsius C."
exit_thermal
Compulab's Linux support
-
- Posts: 26
- Joined: Wed May 27, 2009 8:59 pm
Re: lm_sensors on Fit-PC2
I recommend adding a check for root capabilities.
If accidentally this script is run as non-root, it gives errors, but shows a temperature of 127 degrees C as well.
Yeah, my first post with my just received Fit-PC2!
If accidentally this script is run as non-root, it gives errors, but shows a temperature of 127 degrees C as well.
Code: Select all
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
fi
Re: lm_sensors on Fit-PC2
thx that worked.
is here an easy way to include that script to gkrellm ?
is here an easy way to include that script to gkrellm ?
Re: lm_sensors on Fit-PC2
Thanks for Denis's script. Its 37 degrees in the shade outside and pretty
hot inside where my fitpc2 is. The script shows 64C and 57C. At what
temperature should I get worried?
hot inside where my fitpc2 is. The script shows 64C and 57C. At what
temperature should I get worried?
Re: lm_sensors on Fit-PC2
Thanks for that ... the specs say operating temperature 0-45C, I'm presuming
this is the ambient room temp?
Also, am I right in presuming the second figure of 55C (Thermal Sensor 1) being
picked up by Denis's script is the HDD?
I've put an old CPU Al heat sink on the top of the fit-pc2, seems to be
working ... lots of fins to dissipate heat.
Many thanks.
this is the ambient room temp?
Also, am I right in presuming the second figure of 55C (Thermal Sensor 1) being
picked up by Denis's script is the HDD?
I've put an old CPU Al heat sink on the top of the fit-pc2, seems to be
working ... lots of fins to dissipate heat.
Many thanks.
Re: lm_sensors on Fit-PC2
No, both sensors are built in CPU. You can take average of them as CPU temperature. The sensors are independent and placed in different parts of CPU - which makes a small difference in temperature which they show.Also, am I right in presuming the second figure of 55C (Thermal Sensor 1) being
picked up by Denis's script is the HDD?
Compulab's Linux support
Re: lm_sensors on Fit-PC2
Okay, then how do I find the HDD temperature?
smartctl --all /dev/sda
smartctl --all /dev/sda