View unanswered posts | View active topics It is currently Mon May 20, 2013 1:37 pm



Reply to topic  [ 31 posts ]  Go to page 1, 2, 3, 4  Next
 lm_sensors on Fit-PC2 
Author Message

Joined: Mon May 04, 2009 12:50 am
Posts: 32
Post 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?


Sun Jun 14, 2009 2:27 pm
Profile

Joined: Sun Apr 26, 2009 3:24 pm
Posts: 261
Post 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.

Code:
#!/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

_________________
Denis, Fit-PC2/3/IntensePC support


Tue Jun 16, 2009 8:46 am
Profile

Joined: Wed May 27, 2009 5:59 pm
Posts: 26
Post 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.

Code:
if [[ $EUID -ne 0 ]]; then
  echo "You must be a root user" 2>&1
  exit 1
fi


Yeah, my first post with my just received Fit-PC2!


Tue Jun 16, 2009 9:18 am
Profile

Joined: Tue Oct 20, 2009 9:23 pm
Posts: 43
Post Re: lm_sensors on Fit-PC2
thx that worked.

is here an easy way to include that script to gkrellm ?


Wed Oct 21, 2009 10:47 pm
Profile

Joined: Mon Nov 09, 2009 4:44 am
Posts: 9
Post 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?


Mon Nov 09, 2009 5:03 am
Profile
Site Admin

Joined: Mon Mar 16, 2009 2:11 pm
Posts: 1938
Post Re: lm_sensors on Fit-PC2
You are fine up to 90C CPU, but HDD does not like it over 60C.

_________________
-------------------------
Irad Stavi
fit-PC forum admin

-------------------------


Mon Nov 09, 2009 9:42 am
Profile

Joined: Mon Nov 09, 2009 4:44 am
Posts: 9
Post 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.


Mon Nov 09, 2009 9:56 am
Profile

Joined: Sun Apr 26, 2009 3:24 pm
Posts: 261
Post Re: lm_sensors on Fit-PC2
Quote:
Also, am I right in presuming the second figure of 55C (Thermal Sensor 1) being
picked up by Denis's script is the HDD?

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.

_________________
Denis, Fit-PC2/3/IntensePC support


Mon Nov 09, 2009 12:11 pm
Profile

Joined: Mon Nov 09, 2009 4:44 am
Posts: 9
Post Re: lm_sensors on Fit-PC2
Okay, then how do I find the HDD temperature?
smartctl --all /dev/sda


Mon Nov 09, 2009 11:59 pm
Profile

Joined: Sun Apr 26, 2009 3:24 pm
Posts: 261
Post Re: lm_sensors on Fit-PC2
Code:
sudo hddtemp /dev/sda

_________________
Denis, Fit-PC2/3/IntensePC support


Tue Nov 10, 2009 9:17 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 31 posts ]  Go to page 1, 2, 3, 4  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.