HARDWARE Sensors

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related



Contents

Warnings


Warning: Do not use lm_sensors with IBM thinkpads! This will most likely hose your EEPROM. When this happens you need to go to your nearest IBM service center and have the motherboard changed! Please look for more information at www.linux-thinkpad.org.


Note: Do not have i2c_viapro and VIA686A loaded at the same time! They conflict and neither will work!


Note: lm_sensors doesn't support ALi chipsets for hardware sensors (i.e. Iwill XP333) so don't bother trying.

Introduction

Many packages have been merged into the new kernel's sources - one of them is lm_sensors. This package consists of two components: the kernel modules and userspace applications. It should enable you to read temperature data from the thermal sensors on your motherboard, to get and set the fan speed, to get and set temperature alerts for the fan speed and so on.


Note: Before you use this guide, be warned that not all kernel modules of this package have yet been ported or went into the kernel's sources. To get more information about lm_sensors being ported from 2.4 to 2.6 and which drivers are supported, please see the pages [1], [2] and [3].

Kernel

Be sure to read this page: the guys behind lm_sensors tell you there what you can do if your chip is not detected, what special parameters to use with your hardware and, most important of all, if your hardware is supported in 2.6.x!

Create /sys:

# mkdir /sys

Remove obsolete packages (I²C has been merged into the sources, gkrellm works well with sysfs and without gkrellm-sensors, lm-sensors has been renamed lm_sensors):

# emerge -Ca i2c gkrellm-sensors lm-sensors

Point /usr/src/linux to your new kernel sources:

# ln -sf /usr/src/linux-2.6.x-yournewkernel /usr/src/linux

Compile I²C as module and choose the appropriate modules for your hardware:


Linux Kernel Configuration: Device Drivers
I2C support  --->
<M> I2C support
<M>   I2C device interface
      I2C Hardware Bus support  --->
      <M> Choose the appropriate module(s) for your hardware

If you can't find the right module for your hardware, also check:

Hardware Monitoring Support --->
<M> Hardware Monitoring support
<M> Choose the appropriate module(s) for your hardware

If you don't know which sensors are on your motherboard, this page has a listing of the sensors MBM (Motherboard Monitor, a Windows application) supports. If your motherboard isn't present, try Google.

Compile your new kernel and reboot.

Now let's install lm_sensors:

# emerge -av lm_sensors


Note: If you have an early 2.6 kernel (2.6.0 to 2.6.9), you should install a particular lm_sensors version; please check here for details.

(Re)emerge gkrellm to let it read out your sensor data. Load it. Open up properties and see the built-in "sensors" item. You should find all of your sensors there.

Automatically start lm_sensors at boot time if desired:

# rc-update add lm_sensors default

Troubleshooting

If all went right, you should now have something like this:

Code: sensors
# sensors
it8712-isa-0c00
Adapter: ISA adapter
VCore 1:   +1.66 V  (min =  +4.08 V, max =  +4.08 V)   ALARM
VCore 2:   +4.08 V  (min =  +4.08 V, max =  +4.08 V)   ALARM
+3.3V:     +3.23 V  (min =  +4.08 V, max =  +4.08 V)   ALARM
+5V:       +4.87 V  (min =  +6.85 V, max =  +6.85 V)   ALARM
+12V:     +12.22 V  (min = +16.32 V, max = +16.32 V)   ALARM
-12V:      +3.93 V  (min =  +3.93 V, max =  +3.93 V)   ALARM
-5V:       +4.03 V  (min =  +4.03 V, max =  +4.03 V)   ALARM
Stdby:     +6.85 V  (min =  +6.85 V, max =  +6.85 V)   ALARM
VBat:      +4.08 V
fan1:     2481 RPM  (min =    0 RPM, div = 4)          
fan2:     2428 RPM  (min =    0 RPM, div = 4)          
fan3:        0 RPM  (min =    0 RPM, div = 2)          
M/B Temp:    +44°C  (low  =    -1°C, high =    -1°C)   sensor = thermistor   
CPU Temp:    +36°C  (low  =    -1°C, high =    -1°C)   sensor = thermistor   
Temp3:        -1°C  (low  =    -1°C, high =    -1°C)   sensor = disabled   ALARM


Code: ls /sys/bus/i2c/devices/
$ ls /sys/bus/i2c/devices/
9191-0c00


Code: ls /sys/bus/i2c/devices/9191-0c00/
$ ls /sys/bus/i2c/devices/9191-0c00/
alarms      fan3_input    in2_min    in6_max      pwm2_enable  temp3_input
bus         fan3_min      in3_input  in6_min      pwm3         temp3_max
cpu0_vid    hwmon:hwmon0  in3_max    in7_input    pwm3_enable  temp3_min
driver      in0_input     in3_min    in7_max      temp1_input  temp3_type
fan1_div    in0_max       in4_input  in7_min      temp1_max    uevent
fan1_input  in0_min       in4_max    in8_input    temp1_min    vrm
fan1_min    in1_input     in4_min    name         temp1_type
fan2_div    in1_max       in5_input  power        temp2_input
fan2_input  in1_min       in5_max    pwm1         temp2_max
fan2_min    in2_input     in5_min    pwm1_enable  temp2_min
fan3_div    in2_max       in6_input  pwm2         temp2_type

If you can't see this, then you have the wrong modules loaded. Try activating them all and call sensors-detect.

FAQ

  1. "My sensors do not show up!" or "My sensors are not detected!"
    • Read [4], [5] and [6], and check the bug reports bug reports. If this won't help, you can try experimenting with the modules and their parameters or send the lm_sensors' guys a bug report.
  2. "My sensors always show 10 degrees too much!"
    • You may need to edit /etc/sensors.conf as appropriate.
  3. "My sensor data needs to be divided by 2!"
    • If you installed lm_sensors and want to see the right output from sensors, then edit /etc/sensors.conf and find uncommented compute temp for cpu appropriate for your chip, then replace 2 with 1 after the letters @* in the same line. If you have problems with gkrellm, you can do this by entering values into the Offset and Factor boxes in the Properties window.
  4. "sensors-detect spits out No i2c device files found. Use prog/mkdev/mkdev.sh to create them!"
    • modprobe i2c-dev; sensors-detect
  5. "sensors-detect is unable to find some modules! Why are these modules missing?"
    • Make sure you activated the according option when configuring the kernel and be sure to read point 1.!
  6. "The w83627hf module triggers high fan speed."
    • try to solve this by modprobe w83627hf init=0

Update notes 2006

Ebuild|udev-081-r1 will cripple sensors and audio devices. Even reverting to udev-079-r1 will not automatically reactivate them.

You need to have some output from:

# ls /sys/bus/i2c/devices/

It may be necessary to modprobe the hardware modules and/or the I²C modules to get this to work, e.g.

# modprobe w83627hf

sensors-detect should now work.

Links

From Gentoo Forums:

Personal tools