# Monitor CPU Temperature with lm_sensors and gkrellm

## smokeslikeapoet

Introduction

This process was accomplished with an Athlon XP 1800+ and EpoX 8KHA+ Via KT266A. Your result will be slightly different than my own. Please read the follow-up posts for information on other systems. I don't claim to be an expert in cpu cooling or motherboard sensor troubleshooting, I just consolidated about 2 hours worth of research in one HowTo. If you're having trouble getting lm-sensors working or have other platform specific questions I've opened a support thread here:

https://forums.gentoo.org/viewtopic.php?p=326081

Making It Work

When compilling your kernel in the Character Devices section enable I2C Support , I2C device interface, and I2C /proc interface, as modules. If you have a tvtuner card, like I do, you already have probably already enabled these options. If you haven't already enabled them all you have to do is:

```
# make modules && make modules_install
```

After compilling your kernel do the following 

```
emerge i2c lm-sensors gkrellm
```

if you're running kde you can use ksensors instead of gkrellm.

```
# emerge ksensors
```

Then run:

```
# sensors-detect
```

Press [return] to select the default options when you're prompted until you come to this

```
 Now follows a summary of the probes I have just done.

 Just press ENTER to continue:
```

You will get a list of sensors and directions like this.

```
Driver `eeprom' (should be inserted):

  Detects correctly:

  * Bus `bt848 #0' (Bit-shift algorithm)

    Busdriver `UNKNOWN', I2C address 0x50

    Chip `Serial EEPROM (SDRAM DIMM)' (confidence: 8)

  * Bus `SMBus Via Pro adapter at 5000' (Non-I2C SMBus adapter)

    Busdriver `i2c-viapro', I2C address 0x50

    Chip `Serial EEPROM (SDRAM DIMM)' (confidence: 8)

  * Bus `SMBus Via Pro adapter at 5000' (Non-I2C SMBus adapter)

    Busdriver `i2c-viapro', I2C address 0x51

    Chip `Serial EEPROM (SDRAM DIMM)' (confidence: 8)

 

Driver `w83781d' (should be inserted):

  Detects correctly:

  * ISA bus address 0x0290 (Busdriver `i2c-isa')

    Chip `Winbond W83697HF' (confidence: 8)

 

 

 I will now generate the commands needed to load the I2C modules.

 Sometimes, a chip is available both through the ISA bus and an I2C bus.

 ISA bus access is faster, but you need to load an additional driver module

 for it. If you have the choice, do you want to use the ISA bus or the

 I2C/SMBus (ISA/smbus)?

 

WARNING! If you have some things built into your kernel, the

below list will contain too many modules. Skip the appropriate ones!

To load everything that is needed, add this to some /etc/rc* file:

 

#----cut here----

# I2C adapter drivers

# modprobe unknown adapter bt848 #0 using Bit-shift algorithm

# modprobe unknown adapter bt848 #0 using Bit-shift algorithm

modprobe i2c-viapro

modprobe i2c-isa

# I2C chip drivers

modprobe eeprom

modprobe w83781d

#----cut here----

 

To make the sensors modules behave correctly, add these lines to either

/etc/modules.conf or /etc/conf.modules:

 

#----cut here----

# I2C module options

alias char-major-89 i2c-dev

#----cut here----

```

Instead of following those directions verbatim, I added i2c-viapro, i2c-isa, eeprom, and w83791d to /etc/modules.autoload. Make sure you have  alias char-major-89 i2c-dev in /etc/modules.conf. The lm_sensors ebuild has added /etc/init.d/lm_sensors for us. So to load lm_sensors at boot do this:

```
# rc-update add lm_sensors default
```

Since we're Linux users and don't like to reboot do this, just replace the my modules with you're own. 

```
# modprobe i2c-viapro

# modprobe i2c-isa

# modprobe eeprom

# modprobe w83781d
```

and then start lm_sensors:

```
# /etc/init.d/lm_sensors start
```

You can check to see if it's working properly. Just type:

```
# sensors
```

You should get an output similar to this:

```
eeprom-i2c-0-50

Adapter: bt848 #0

Algorithm: Bit-shift algorithm

 

eeprom-i2c-1-50

Adapter: SMBus Via Pro adapter at 5000

Algorithm: Non-I2C SMBus adapter

Memory type:            DDR SDRAM DIMM SPD

SDRAM Size (MB):        256

 

eeprom-i2c-1-51

Adapter: SMBus Via Pro adapter at 5000

Algorithm: Non-I2C SMBus adapter

Memory type:            DDR SDRAM DIMM SPD

SDRAM Size (MB):        256

 

w83697hf-isa-0290

Adapter: ISA adapter

Algorithm: ISA algorithm

VCore:     +1.76 V  (min =  +0.00 V, max =  +0.00 V)

+3.3V:     +1.52 V  (min =  +2.97 V, max =  +3.63 V)

+5V:       +4.89 V  (min =  +4.50 V, max =  +5.48 V)

+12V:     +12.58 V  (min = +10.79 V, max = +13.11 V)

-12V:      +2.10 V  (min = -13.21 V, max = -10.90 V)

-5V:       +0.58 V  (min =  -5.51 V, max =  -4.51 V)

V5SB:      +5.53 V  (min =  +4.50 V, max =  +5.48 V)

VBat:      +3.13 V  (min =  +2.70 V, max =  +3.29 V)

fan1:        0 RPM  (min = 3000 RPM, div = 2)

fan2:        0 RPM  (min = 3000 RPM, div = 2)

temp1:       +28°C  (limit =  +60°C)                       sensor = thermistor

                                                                                

temp2:     +41.5°C  (limit =  +60°C, hysteresis =  +50°C) sensor = thermistor

                                                                                

alarms:

beep_enable:

          Sound alarm disabled

```

Now, I'm sure my output isn't totally accurate and yours probably isn't either. For example, I'm not using the normal 3 pin connector for my CPU fan because I have an 80mm Delta screamer on my heat sink. I also know that my core voltage isn't 1.52V. This can be corrected in:

```
/etc/sensors.conf
```

Since calibration is motherboard specific it is beyond the scope of this tutorial (perhaps a new tutorial is in order), but you can read more on how to calibrate your output on these pages:

http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/lm_sensors-FAQ.html

http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/etc/sensors.conf.eg

The CPU core temps can only be exactly measured in a laboratory environment. You can however correct the mesurements you know to be inaccurate.

Finishing Up

Now you can launch gkrellm2 as a user (note the program name is gkrellm2). With the gkrellm window active press F1. Expand the Builtins menu and click on sensors. Here you can configure which sensors you would like to see in the gkrellm window. I'll leave that up to you. A note to my fellow Americans you can select Fahrenheit temps in the Options tab. Ksensors can also be configured in much the same way by right-clicking on the window. 

This is my first How-To attempt for this forum your constructive criticism is appreciated.

edit: corrected typo, added ksensors info, added command line sensors info, added categories, added supercool Indigo headers, added calibration information (thanks, puddpunk). updated lm_sensors to lm-sensors.

----------

## ERW1N

Thx a lot.

been looking for this tips.  :Very Happy: 

 *smokeslikeapoet wrote:*   

> After compilling your kernel do the following
> 
> ```
> emerge i2c lmsensors gkrellm
> ```
> ...

 

there's a typo there, should be:

```
emerge i2c lm_sensors gkrellm
```

----------

## ERW1N

the sensor gives me:

temp1 36.0 C

temp2 28.5 C

temp3  7.5 C

what are those temp? cpu or motherboard?

it's impossible to have such low temperature for my Athlon XP

-Erwin-

----------

## ctford0

There is also a nice program for KDE called ksensors instead of gkrellm for all you KDE fans out there.

During the set I also had to create the directory /etc/sysconfig manually before I could get /etc/init.d/lm_sensors to start.

ERW1N:

	A good check would be to reboot and check the health status in your bios to see what the temperature is running there.

Chris

----------

## piquadrat

just a side note to IBM ThinkPad users: lmsensors can damage the bios or something. The install script checks wheter the PC is a ThinkPad and denies installation in that case, I think.

----------

## barlad

Another note, for ASUS mobo users. On most recent motherboards (the ones using ICH4 chipset), ASUS disables the SMBus device and does not provide us with any bios option to enable it. Thus it is totally impossible to have lm_sensors work "out of the box". That said, there is a hack, documented in lm_sensors package, which solves it.

If anyone has got that problem, I can post a walkthrough.

----------

## smokeslikeapoet

 *ERW1N wrote:*   

> the sensor gives me:
> 
> temp1 36.0 C
> 
> temp2 28.5 C
> ...

 

Your first temp is your processor. I would assume that you measured it idle. Mine runs at 42.5 at load with a 24.5 degree ambient room tempurature. Your second tempurature is the secondary sensor on your motherboard. Mine runs at 28.0C. The secondary sensor should not be much higher than your ambient room tempurature, otherwise you could use an extra case fan or two. 

If you want a program that will tax your processor for a while click on the link in my signature. It's a distributed computing project that combats infectious diseases. 

For some software cooling solutions checkout this thread.

https://forums.gentoo.org/viewtopic.php?t=6131

----------

## ERW1N

 *barlad wrote:*   

> Another note, for ASUS mobo users. On most recent motherboards (the ones using ICH4 chipset), ASUS disables the SMBus device and does not provide us with any bios option to enable it. Thus it is totally impossible to have lm_sensors work "out of the box". That said, there is a hack, documented in lm_sensors package, which solves it. 

 

i have ASUS A7V333 and lm_sensors works fine, it's just not detecting the CPU temp correctly....

 *smokeslikeapoet wrote:*   

> Your first temp is your processor. I would assume that you measured it idle. Mine runs at 42.5 at load with a 24.5 degree ambient room tempurature. Your second tempurature is the secondary sensor on your motherboard. Mine runs at 28.0C. The secondary sensor should not be much higher than your ambient room tempurature, otherwise you could use an extra case fan or two. 

 

i rebooted my box and checked the BIOS, the only match temp was the 1st temp which was displayed as M/B temp in BIOS. Weird.. seems lm_sensors can't detect my cpu temp correctly.

----------

## StuBear

[quote="ERW1N]i rebooted my box and checked the BIOS, the only match temp was the 1st temp which was displayed as M/B temp in BIOS. Weird.. seems lm_sensors can't detect my cpu temp correctly.[/quote]

try typing 

```
sensors
```

 at a command prompt. On my gigabyte MB, I had a similair problem, I found that sensor-detect had detected the standard i2c sensor and the via sensor (viapro). gkrellm uses the standard one by default. On my system the via sensor showed the correct temp, but the i2c on was way off - I guess the offset etc needs to be tweaked for the standard i2c sensor, but I just set gkrellm to display the readings from the via sensor.

----------

## ERW1N

cool!

sensors gives me the correct temperature and fan speed..

how to set gkrellm to display the reading from via sensor?

i tried checking the conf files but couldn't find anything

----------

## GenKiller

Very nice tutorial!  It's very nice to see a tutorial done about it, and it works awesome here on my Asus A7M266-D   :Very Happy: 

----------

## swat

 *barlad wrote:*   

> Another note, for ASUS mobo users. On most recent motherboards (the ones using ICH4 chipset), ASUS disables the SMBus device and does not provide us with any bios option to enable it. Thus it is totally impossible to have lm_sensors work "out of the box". That said, there is a hack, documented in lm_sensors package, which solves it.
> 
> If anyone has got that problem, I can post a walkthrough.

 

This would be useful, as it is what i'm trying to do  :Wink: 

Thank you

Simon

----------

## smokeslikeapoet

 *barlad wrote:*   

> Another note, for ASUS mobo users. On most recent motherboards (the ones using ICH4 chipset), ASUS disables the SMBus device and does not provide us with any bios option to enable it. Thus it is totally impossible to have lm_sensors work "out of the box". That said, there is a hack, documented in lm_sensors package, which solves it.
> 
> If anyone has got that problem, I can post a walkthrough.

 

If you want to add the information. I'll included it in my howto. You can post or pm me the info.

----------

## puddpunk

What hasn't even been mentioned on this thread, is that temperatures that are on the BIOS screen or whatever, have a whole lot of calculations done to it, to give an accurate temperature.

That means, that the reason some of your sensors are giving "funky" results, is that lm_sensors needs to be calibrated. There should be a file in the /usr/doc/<lmsensor-package> directory which will step you through it.

smokeslikeapoet, I suggest you complete this howto with directions for sensor calibration.

Thanks,

Chris.

----------

## smokeslikeapoet

 *puddpunk wrote:*   

> What hasn't even been mentioned on this thread, is that temperatures that are on the BIOS screen or whatever, have a whole lot of calculations done to it, to give an accurate temperature.
> 
> That means, that the reason some of your sensors are giving "funky" results, is that lm_sensors needs to be calibrated. There should be a file in the /usr/doc/<lmsensor-package> directory which will step you through it.
> 
> 

 

I added your info to the tutorial. Thanks.

----------

## arlequin

Yeah baby yeah, thanx for this tutorial   :Wink: 

A little question: is there an app for gnome2 that show the temp ? A panel addon would be really gret   :Cool:  If someone know where I can find this...

----------

## Braempje

This is just great, and works perfectly since I also have an Epox 8KHA+   :Very Happy: 

Thanks!

----------

## barlad

Hey guys, 

sorry for the delay.

This is a HOW-TO to make smbus work on some asus motherboards. Sorry if this is not clear enough, english is not my native language. Feel free to modify it and add it to your post Smokeslikeapoet

I did not invent all of that, it's very well documented in the lm_sensors package. I just formatted it.

 INTRODUCTION 

This how-to concerns people who own an ASUS motherboards and cannot spot the SMBus device although the documentation says it exists.  It ONLY works for ASUS motherboards using an ICH4 intel device (82801DB) or an ICH2 device (82801BA). Using it with another motherboard may be dangerous. 

They are for pentium IV and use an intel Chipset. For exemple, it includes all the P4G8 serie or some motherboards with i801 chipset.

You can know what device is on your motherboard just by doing a lspci, you should then recognize the given references. Some lines will read like this:

```
00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB PCI Bridge (rev 82)

00:1f.0 ISA bridge: Intel Corp. 82801DB LPC Interface Controller (rev 02)

00:1f.1 IDE interface: Intel Corp. 82801DB Ultra ATA Storage Controller (rev 02)
```

 PREPARATION 

You need:

- lm_sensors and i2C emerged 

```
 emerge lm_sensors 

emerge i2c
```

 - the lm_sensors sources. either lm_sensors-2.6.5 or lm_sensors-2.7.0. We will suppose you untared it in ~/lmsensors directory. If you deleted the distfiles, you can grab it with

```
 emerge -f lm_sensors 
```

 then copy it from /usr/portage/distfiles.

-  Pci HOTPLUG support compiled IN the kernel 

 STEP I 

- There is a module created by lm_sensors to activate the smbus hidden by ASUS. Basically, it just enables it in the bios (by modifying two bits) then it reports it to the kernel so that lmsensors can see the device. That module must not have been used a lot because there is a glitch in the source that prevent it from compiling. 

- The module is in ~/lmsensors/prog/hotplug/ so do

```
 cd ~/lmsensors/prog/hotplug 
```

- Let's fix the sources. Edit the p4b_smbus.c file.

Modify the line 263 that reads:

```
write_lock_irqsave(i801smbus_lock, i801smbus_lock_flags);
```

with:

```
write_lock_irqsave(&i801smbus_lock, i801smbus_lock_flags);
```

Modify the line 268 that reads:

```
write_unlock_irqrestore(i801smbus_lock, i801smbus_lock_flags);
```

with: 

```
write_unlock_irqrestore(&i801smbus_lock, i801smbus_lock_flags);
```

- We are ready to compile the module now.

```
 make -f Makefile.p4B 
```

Now you should have a file called p4b_smbus.o.

 STEP II 

- We have to try if it works. run: 

```
 insmod p4b_smbus.o 
```

Dmesg should give you something like this

```
i801smbus: found Intel ICH4 (82801DB).

i801smbus: SMBus activated in LPC!

i801smbus: Enabled
```

And lspci should give you this:

```
00:1f.3 SMBus: Intel Corp. 82801DB/DBM SMBus Controller (rev 02)
```

If you have this, then you are all set. 

- copy p4b_smbus.o to your kernel modules directory:

```
 cp p4b_smbus.o /lib/modules/`uname -r`/misc/  
```

Add p4b_smbus to your modules.autoload file.

- Now I think there are two options. Once p4b_smbus.o is loaded, you can most likely run sensors-detect. I did not do that but it should work.

The other way to go is just to load manually the following modules:

```
 modprobe i2c-core

modprobe i2c-i801

modprobe i2c-dev

modprobe i2c-proc

modprobe w83781d 
```

Add those modules to your module.autoload file.

Enjoy. It works.

----------

## Vi Rocks

Currently the makedev.sh script provided in lm_sensors creates 

i2c devices in /dev . eg /dev/i2c-0 /dev/i2c-1 etc upto /dev/i2c-32.

But when i2c-dev module is loaded it creates a directory in /dev called i2c.

Is there a way by which all this can be encompassed in devfs.

i.e the devices would be /dev/i2c/<i2c-device-0> to /dev/i2c/<i2c-device-31>

and then use devfs to create symbolic links to the files in /dev/i2c directory.

thanks

----------

## ctford0

ChrisLast edited by ctford0 on Sat May 17, 2003 2:12 pm; edited 1 time in total

----------

## smokeslikeapoet

ctford0: This isn't a support forum. I started a thread for specific problems here: https://forums.gentoo.org/viewtopic.php?p=326081

Please, respond to that thread and post the requested information. 

If anyone has platform specific issues or concerns other than how the howto is written please post them to the thread mentioned above.

----------

## kermitjunior

 *smokeslikeapoet wrote:*   

>  *ERW1N wrote:*   the sensor gives me:
> 
> temp1 36.0 C
> 
> temp2 28.5 C
> ...

 

Not necessarily.  When you run #sensors     it tells you what temp is what sensor.  On my Abit K7R, they are:

temp1: SYS Temp

temp2: CPU Temp

temp3: SBr Temp

On another note... this howto is awesome!!!

Much better than the gkrellm documentation (which didn't work for me!)

V/r,

KJ

----------

## calhoun

I've been looking for this. Thanks

----------

## totoffe

Oupps just a wee error :

emerge i2c lm-sensors gkrellm

it is not an underscore!

----------

## ikaro

if you use fluxbox and use the 'slit' insted of Gkellm, you can use dockapps.

```

emerge wmgtemp

```

add this to your .xinitrc before the "exec fluxbox" line

```

WM_BG_COLOR=#dbdfe8

wmgtemp -t -H 75 -w 70 -M 85 &

```

----------

## maalth

If you have an IBM Thinkpad (any model), do NOT use lm_sensors under any circumstances.

----------

## marshall_j

 *maalth wrote:*   

> If you have an IBM Thinkpad (any model), do NOT use lm_sensors under any circumstances.

 

Why's that?!

----------

## kaare

Hey!

This info is great!.

I'm wondering if there is a app out there that can output the sensors info to web?

The ones I found doesn't support my chip (amd756).

----------

## rollinncoaster

If you get this error message:

#sensors-detect

#No i2c device files found. Use prog/mkdev/mkdev.sh to create them.

Download the source, untar it. And run the mkdev.sh script to create the necessary device files in order to let sensors-detect do its job. 

Perhaps a change in the ebuild??

Hope this helps. 

RC

----------

## charlesnadeau

 *smokeslikeapoet wrote:*   

> 
> 
> Making It Work
> 
> When compilling your kernel in the Character Devices section enable I2C Support , I2C device interface, and I2C /proc interface, as modules. If you have a tvtuner card, like I do, you already have probably already enabled these options. If you haven't already enabled them all you have to do is:
> ...

 

If I recompile my kernel, do I have to re-emerge i2c lm-sensors and gkrellm? If so it would be like for alsa-driver.

Thanks!

Charles

----------

## bammbamm808

Followed your guide. 2.8.1 wouldn't give me any temperatures, so I unmerged and emerge 2.8.2 and there it was. Thanks. I've always installed from the vanilla sources rather than emerge, but for some reason the "make, make install..." method wouldn't work this time. At least portage was there to bail me out.

----------

## berus

 *barlad wrote:*   

> Hey guys, 
> 
> - The module is in ~/lmsensors/prog/hotplug/ so do
> 
> ```
> ...

 

Hi, sorry form my english!

A follow this instructions ma after 

```
 make -f Makefile.p4B 
```

 I have this error 

```
p4b_smbus.c: At top level:

p4b_smbus.c:277: warning: type defaults to `int' in declaration of `EXPORT_NO_SYMBOLS'

p4b_smbus.c:277: warning: data definition has no type or storage class

make: *** [p4b_smbus.o] Error 1

```

Someone can help me? I have a ASUS P4G8X and "hot-pluggable devices" is build in the kernel..   :Sad: 

----------

## berus

Any idea? Can depends by the gcc version?

 *Quote:*   

> gcc version 3.3.2 20040119 (Gentoo Linux 3.3.2-r7, propolice-3.3-7)
> 
> 

 

----------

## berus

Here I read that p4b_smbus isn´t needed for kernels 2.6.x.. and now?

----------

## tlaloctlaloc

Good news for you (and me), berus. It is right that you do not need the p4b_smbus module anymore. The Intel 801 (i2c-i801) option enabled in the kernel works for my Asus P4B533E mb with the ASB100 hardware monitoring chip which is supported in the 2.6.3 kernel (wasn`t so in the 2.6.1 kernel, had to upgrade).

All i did was enable:

the Intel 801 option in Device Drivers--> I2C support --> I2C Hardware Bus support;

the I2C device interface option in Device Drivers--> I2C support;

the Asus ASB100 Bach option in Device Drivers --> I2C support --> Hardware Sensors Chip support.

The modules i have to load are asb100, i2c_sensor, i2c_i801, i2c_dev and i2c_core, which i have also added to  to my /etc/modules.autoload.d/kernel-2.6 file. If I also have to do the rc-update add lm-sensors default I do not know. But I get the right temperature out of the box.

Bye, Valentin.

----------

## berus

Thanks, Valentin. Now I try to re-compile kernel with the options enabled.. I hope that it works on my pc also!!   :Very Happy: 

----------

## KenTI

 *rollinncoaster wrote:*   

> If you get this error message:
> 
> #sensors-detect
> 
> #No i2c device files found. Use prog/mkdev/mkdev.sh to create them.
> ...

 

sorry where is the mkdev.sh script?

i tried also with

cd /dev

./MAKEDEV i2c 

but it said

.devfsd presence implies active DevFS.  Aborting MAKEDEV invocation.

i also unpacked the source and compiled i2c manually but i still can't find the mkdev.sh script..

----------

## eean

 *KenTI wrote:*   

>  *rollinncoaster wrote:*   If you get this error message:
> 
> #sensors-detect
> 
> #No i2c device files found. Use prog/mkdev/mkdev.sh to create them.
> ...

  I think rollinncoaster is wrong, at least in my case. When I get this message its because I haven't loaded i2c-dev yet.

----------

## AugustineF

CPU fan speed is always zero.

I have a 3 pin connector to the CPU fan, as the document suggests, but the speed shown is always zero.

The system fan speed indicator is working though.

----------

## ares

I use sensors in my .bashrc 

Capture Cpu/Temp

vim .bashrc

```

# Sens

sens() {

sensors | sed -n '/+/p' | awk '{print $1}' | sed -e '/v/d' | tail -n 1

}

export sens

export PS1="`sens`/\w /"

```

My PS1

+46°C/~/temp/

----------

## jessler

The sensors-detect utility identified that I need a module named bmcsensors.

```
#----cut here----

# I2C adapter drivers

modprobe i2c-piix4

modprobe i2c-isa

# I2C chip drivers

modprobe eeprom

modprobe bmcsensors

# sleep 2 # optional

/usr/local/bin/sensors -s # recommended

#----cut here----

```

When I tried to install the module I get this.

```
modprobe: Can't locate module bmcsensors

```

I have searched the entire file system and cannot find an module named bmcsensors.o. All of the other modules installed and appear to work fine.

Here is what I get when I run sensors:

```

eeprom-i2c-0-50

Adapter: SMBus PIIX4 adapter at 08a0

Algorithm: Non-I2C SMBus adapter

Memory type:            SDR SDRAM DIMM

Memory size (MB):       1024

eeprom-i2c-0-51

Adapter: SMBus PIIX4 adapter at 08a0

Algorithm: Non-I2C SMBus adapter

Memory type:            SDR SDRAM DIMM

Memory size (MB):       1024

```

Is there a workaround or solution for this?

----------

## roshan

 *marshall_j wrote:*   

>  *maalth wrote:*   If you have an IBM Thinkpad (any model), do NOT use lm_sensors under any circumstances. 
> 
> Why's that?!

 

Because it can corrupt the eeprom on certain (most?) Thinkpads.

----------

## roshan

 *KenTI wrote:*   

>  *rollinncoaster wrote:*   If you get this error message:
> 
> #sensors-detect
> 
> #No i2c device files found. Use prog/mkdev/mkdev.sh to create them.
> ...

 

Ensure that you have the source available again, by typing: 

```
emerge -f lm-sensors
```

Then, extract the mkdev.sh file from the archive by issuing the following command, while located for example in the /tmp directory:

```
tar zxvf /usr/portage/distfiles/lm_sensors-2.8.1.tar.gz lm_sensors-2.8.1/prog/mkdev/mkdev.sh
```

You'll find mkdev.sh in /tmp/lm_sensors-2.8.1/prog/mkdev/mkdev.sh

----------

## H-Dragon

hi all!

i am running a a-xp 2400+  on my gigabyte ga7dxr with a ekl-papst cooler. 

this is what lm-sensors tells me:

```

via686a-isa-6000

Adapter: ISA adapter

Algorithm: ISA algorithm

CPU core:  +1.81 V  (min =  +1.79 V, max =  +2.18 V)

+2.5V:     +1.13 V  (min =  +2.24 V, max =  +2.74 V)   ALARM

I/O:       +3.30 V  (min =  +2.95 V, max =  +3.62 V)

+5V:       +4.99 V  (min =  +4.47 V, max =  +5.49 V)

+12V:     +12.28 V  (min = +10.79 V, max = +13.18 V)

CPU Fan:     0 RPM  (min = 3000 RPM, div = 2)

P/S Fan:     0 RPM  (min = 3000 RPM, div = 2)

SYS Temp:  +61.0°C  (limit =  +60°C, hysteresis =  +50°C) ALARM

CPU Temp:  +37.4°C  (limit =  +60°C, hysteresis =  +50°C)

SBr Temp:  +25.3°C  (limit =  +60°C, hysteresis =  +50°C)

```

1. why is there a error with the Voltage?????

2. the cpu temp is about 50° not 37 nor 61° !!!!!!!  why is it so far off (and / or wrongly labeled?)

thanks!

----------

## salamander

I've got a dual Xeon 2.4Ghz and I've unsuccesfully tried to make lm-sensors work a lot of times.  I always arrived to the following message:

```

# modprobe i2c-dev

# sensors-detect

No i2c device files found. Use prog/mkdev/mkdev.sh to create them.

```

And I had no clue on how to continue from here. (Using mkdev seemed a bit out of place). Every howto I've read proposes, as it is shown in the example, to just load the module i2c-dev prior to the execution of sensors-detect to solve this problem.

But, with my machine (or kernel configuration) this was not sufficient.

I've just found that I also needed to load the i2c-isa module prior to running sensors-detect (I've double-checked that this was the only aditional module needed). This solved the problem:

```

# modprobe i2c-dev i2c-isa

# sensors-detect

[output of sensors-detect]

```

Perhaps it is usefull to add this information to the how-to.

Thank you very much for your effort.

----------

## CarlUman

Just thought I'd post this page that has a list of the hardware monitor chipsets for motherboards.

Hope it helps  :Smile: 

----------

## SAngeli

Hi,

it seems like many times it is easyer to read than to execute. 

I am not able to enable lm-sensors.

This is what I get when I run sensors-detect

No i2c device files found. Use prog/mkdev/mkdev.sh to create them.

Moreover, I am not able to find in my kernel this entry: <M> I2C /proc interface Where is it???

Finally, if I run sensors I get:

```
 # sensors

Can't access procfs/sysfs file

Unable to find i2c bus information;

For 2.6 kernels, make sure you have mounted sysfs and done

'modprobe i2c_sensor'!

For older kernels, make sure you have done 'modprobe i2c-proc'!

```

Here is my configuration spec:

- 2.6.9-gentoo-r13

- Udev

- Kernel specs:

```
  <M> I2C support

   <M>   I2C device interface

   I2C Algorithms  --->

   I2C Hardware Bus support  --->

   Hardware Sensors Chip support  --->

   Other I2C Chip support  --->

   [ ]   I2C Core debugging messages

   [ ]   I2C Algorithm debugging messages

   [ ]   I2C Bus debugging messages

   [ ]   I2C Chip debugging messages

I2C Algorithms  --->

 --- I2C bit-banging interfaces

 <M> I2C PCF 8584 interfaces

 <M> I2C PCA 9564 interfaces

I2C Hardware Bus support  ---> (only the following selected)

<M> Intel 801

<M> Intel 810/815

Hardware Sensors Chip support  ---> (none selected)

Other I2C Chip support  ---> (none selected)

```

- Motherboard: Intel D865-GLC

- Software: Kde and GKrellM

Please help. I am tired reading here and there info and tips but not having mine working.  :Crying or Very sad: 

Thank you,

Spiro

----------

## mdshort

I don't see that entry either, its kinda frustrating.

Anyone?

----------

## stahlsau

this guide is more than 2 years old, probably many things have changed since then.

I never could lmsensors get working, no matter what i did, so, for the moment, i li´ve with gkrellm2 which shows me CPU and GPU Temps out-of-the-box.

----------

## mdshort

I got it to work, this is what you need to do:

(This tutorial was made using a 2.6.12 kernel, most recent versions of the 2.6 kernel have /proc support for I2C built in so enabling it is unnecissary.)

Step One - Kernel

First, configure your kernel with i2c and i2c-dev compiled as modules.

 *Quote:*   

> 
> 
> Device Drivers ---> I2C support ---> (M) I2C support
> 
> Device Drivers ---> I2C support ---> (M) I2C device interface
> ...

 

After enabling them as modules, enable your corresponding I2C Hardware Bus support.

 *Quote:*   

> 
> 
> Device Drivers ---> I2C support ---> I2C Hardware Bus support ---> (M) <coresponding module(s)>
> 
> 

 

Exit, saving your kernel config, then mount your /boot partition (if applicable) and compile your kernel.

 *Quote:*   

> 
> 
> # make && make modules modules_install install
> 
> 

 

Reboot to your new kernel.

Step Two - Detection

At this point, install the lm_sensors package.

 *Quote:*   

> 
> 
> emerge lm_sensors
> 
> 

 

Now use modprobe to load all of the modules you enabled in the kernel.

 *Quote:*   

> 
> 
> # modprobe i2c-core
> 
> # modprobe i2c-dev
> ...

 

At this point its time to detect your heat sensors, run sensors-detect while answering "YES" to everything until you get to the summary question.

If this command fails, you either didn't follow this tutorial correctly, or chose the wrong I2C Hardware Bus support module.

 *Quote:*   

> 
> 
> # sensors-detect
> 
> 

 

Pressing enter, take note of all the modules listed that say "should be inserted" ignoring all other types. (You will use these later.)

 *Quote:*   

> 
> 
> Now follows a summary of the probes I have just done.
> 
> Just press ENTER to continue:
> ...

 

Afterwards, allow the script to create the configuration file when it asks.

Using the notes you took enable the corresponding modules in your kernel.

 *Quote:*   

> 
> 
> Device Drivers ---> I2C support ---> Hardware Sensors Chip support ---> (M) <your noted module(s)>
> 
> 

 

Your almost done!  Rebuild your kernel with the previous build command (# make && make modules modules_install install) after mouting your /boot partition (if applicable).

Then enable the lm_sensors module autoloader.

 *Quote:*   

> # rc-update add lm_sensors default

 

*Then reboot to your new kernel.*

Test your sensors with the "sensors" command in the console.

 *Quote:*   

> # sensors

 

Step Three - Choose Your Favorite Monitor

If your using KDE, then there is a KSensors applet you can install.

 *Quote:*   

> # emerge ksensors

 

Otherwise, if your using Gnome or other window systems, install gkrellm.

 *Quote:*   

> # emerge gkrellm

 

And if your a console only advocate, simply use the "sensors" command provided with the lm_sensors package.

 *Quote:*   

> # sensors

 

----------

## druggo

Great ! 

will try it, I want to monitor my CPU's temp  :Smile: 

----------

## stegerpl

Hi,

This thread is great - I finally got all my sensors working but at the same time my CPU fan startet to run in high speed mode.

Does anybody have an idea how to check this problem - because now it is very noisy... :Evil or Very Mad: 

Peter

----------

## ikaro

@root echo "120" > /sys/bus/i2c/devices/*-0290/pwm*

see if something happens  :Smile: 

----------

## stegerpl

Hi,

this gives me just this message:

bash: /sys/bus/i2c/devices/*-0290/pwm*: ambiguous redirect

These files (pwm1 to pwm3) exist and all contain 240.

However when I do it file by file it works !

What did I do by this change from 240 to 120 ? The indicated fan speed at gkrellm as well as ksensors dropped to 0 (zero). If I pass over a "160" than it goes to about 2660 rpms - below again zero. With "240" it was 4200 rpms. Hopefully this will not "hard" limit the fan (does mean that it will never be above these values even when the CPU becomes hot)...

Anyway thanks a lot for this excellent and fast reply...

Peter

----------

## ikaro

that just lets you control manually how fast the fans spin.

i use 4 settings for my cpu fan ( a zalman 7700cu ) :

48, 144,176 and 240

I dont know how much it translates into rpm. however  when i run the cpu at 1gz i turn the fan off by echoing the 44,

and the other settings as needed - when compiling stuff I set it to max speed ( 240 ).

i just have all of this in keybindings so its a rather simple task to change both fan speed and cpu frequency on the fly.

----------

## stegerpl

...so read it that it really "hard" locks the fan speed to a certain speed. But this might (in bad cases) lead to an overheating in case I set it to low speed (noise) and forget to increase it when I do something which needs full power of the CPU (such as sytem update or long compiling sessions). 

However I believe that the danger would be rather small but do you think that a small script checking the CPU temperature an triggering the correspondig value would be nice ? Maybe there is such a tool out there - does anybody know one ?

Peter

----------

## swizec

hi,

I've used this before but now after a reinstall I can't get it to work anymore, I keep getting an error:

```

!!! ERROR: sys-apps/lm_sensors-2.9.1 failed.

!!! Function pkg_setup, Line 39, Exitcode 0

!!! CONFIG_I2C_SENSOR not detected

```

any idea on what I should do?

----------

## ikaro

thats not any error - the error its in the block over that, last 40 lines or so

----------

## swizec

oh yeah

these are the last few lines:

```

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.12-gentoo-r6

 *

 * lm_sensors-2.9.1 requires CONFIG_I2C_SENSOR to be enabled for non-2.4.x kernels.

 *

```

I have all the i2c stuff compiled in the kernel though...

----------

## ikaro

i have this:

( grep I2C /usr/src/linux/.config )

```

# I2C support

CONFIG_I2C=y

CONFIG_I2C_CHARDEV=m

# I2C Algorithms

CONFIG_I2C_ALGOBIT=y

# I2C Hardware Bus support

CONFIG_I2C_ISA=m

CONFIG_I2C_SENSOR=m

CONFIG_SENSORS_W83627HF=m

```

----------

## fisherking

 *Quote:*   

> 
> 
> hi,
> 
> I've used this before but now after a reinstall I can't get it to work anymore, I keep getting an error:
> ...

 

According to the tutorial on the previous page (2), the hardware sensor chip shall be compiled into the kernel after you emerged lmsensors. Well, Lm_Sensors cried out in anger for this so, I had to include the hardware sensor chip before emerging lm_sensors.

----------

## swizec

yeah, I managed to solve it, seems I didn't include the chips in the kernel from some strange reason...

anyways, it worked after I added them

----------

## trinity

Hi,

I built a water cooling system for my pc and so far it working pretty well! I'm looking for a script or program which can check my cpu temperature and if temperature is too high (>55 C for instance) then do a shutdown (in case my pump stop working). I checked my BIOS and it can't do it. (it will shutdown pc only if fan stop working).

Anyone can help me?

Thanks.

----------

## Spetsnaz84

```

Antwerpen Spetsnaz # /usr/bin/sensors -s # recommended

Can't access procfs/sysfs file

Unable to find i2c bus information;

For 2.6 kernels, make sure you have mounted sysfs and libsensors

was compiled with sysfs support!

For older kernels, make sure you have done 'modprobe i2c-proc'!

Antwerpen Spetsnaz # lsmod

Module                  Size  Used by

eeprom                  6544  0

i2c_dev                 8452  0

i2c_i801                8972  0

i2c_core               18432  3 eeprom,i2c_dev,i2c_i801

```

Any ideas ?

sysfs is mounted of course.

And there was only one use flags (which I enabled) for lm_sensors..

Thanks !

----------

