Control fan speeds? lm_sensors isn't working


Recommended Posts

I'm trying to use Linux Mint on my desktop pc now, but it (or the bios) runs the CPU fan faster than it needs to.  I use Speedfan in windows to control CPU and chassis fan speeds just fine with pwm, so I know it's possible.  

 

First I installed lm_sensors

Then I did sudo sensors-detect to update the module with all available sensors, answered "yes" to every prompt, and it found a couple.

Then I restarted to load the new module.

Then I did sudo pwmconfig to test the fan speed controllers, but it said there were no PWM controllers found.

 

What am I doing wrong?  Is there any simpler, GUI way to set up CPU fan speeds in Linux?

Link to comment
Share on other sites

You probably arent doing anything wrong, I could never get it to work on my MBP.
 

sudo apt-get install lm-sensors
sudo sensors-detect

just follow the prompts. Add the recommended lines to /etc/modules.

Now, if you don't want to reboot, you'll have to manually activate the modules.

sudo modprobe module1 module2

where module1 etc. = the module names provided from sensors-detect.

Next, you need to create your fancontrol file. The easiest way is to run pwmconfig.

sudo pwmconfig

and work your way through the instructions there.

Finally, run sensors -s to make your fan configuration take effect.

sudo sensors -s

Now, you can check your temps.

sensors

Now to run fan control, type:

sudo /usr/sbin/fancontrol &

A nice way to visually inspect temps is with  gkrellm. To get it:

sudo apt-get install gkrellm
Link to comment
Share on other sites

Yeah, I did all that, but I'm stuck at sudo pwmconfig , it says there aren't any PWM sensors to use.  And I answered 'yes' to all the prompts in sudo sensor-detect.  It finds a few temperature sensors fine, just not fan controllers.  Is there anything else I can try?  Could it be because I am using the LiveUSB, and not installed on the HD?

Link to comment
Share on other sites

I dont believe running off USB should cause that problem, but hopefully someone more linux savy can answer, i found this info though

 

First, try running pwmconfig:

$ pwmconfig
if that gives you the following error:
/usr/sbin/pwmconfig: There are no pwm-capable sensor modules installed
than you need to apply this fix. If not, proceed to the next step.

Backup:

$ sudo cp /usr/sbin/pwmconfig /usr/sbin/pwmconfig_original
Open pwmconfig:

$ sudo gedit /usr/sbin/pwmconfig
and go to line 68. Delete these three lines:

MATCH='*/fan[1-9]_pwm'
else
MATCH='*/pwm[1-9]'
and replace with:

MATCH='*/pwm[1-9]'
else
MATCH='*/fan[1-9]_pwm'
You just turned the if/else around! Now pwmconfig should work.

Run pwmconfig

$ sudo pwmconfig
One by one, all fans will be tested for 'speedcontrol' (Pulse Width Modulation, actually). Follow the onscreen help. Pwmconfig will write a config file in /etc. I set the interval to 5 seconds, just to be safe, but 10 should be fine too. Let the script run until you see "Select fan output to configure, or other action:" (all default options are fine, you can basically enter you way through the script).

Now press 5 to look at the configuration file. Press 1 to edit settings. Select a temperature that matches your CPU temp (usually the same number as the fan number, but check and double check!). Go with the defaults until you see: "Enter the minimum PWM value (0-255)
at which the fan STARTS spinning (press t to test) (150):"
Here, press t.
Keep pressing enter until you hear (or better: see) the fan spinning up. Then, press y and enter.
Same for the next step, but the other way around. If you see the fan stops spinning, press y and enter.

Press 5 again to display the config file one more time, then press 4 to save and quit. Almost there!

My /etc/fancontrol config looks like this:

INTERVAL=5
FCTEMPS= 1-0290/pwm2=1-0290/temp2_input
FCFANS= 1-0290/pwm2=1-0290/fan2_input
MINTEMP= 1-0290/pwm2=43
MAXTEMP= 1-0290/pwm2=53
MINSTART= 1-0290/pwm2=120
MINSTOP= 1-0290/pwm2=105

this is an example!


 

http://ubuntuforums.org/archive/index.php/t-42737.html

Link to comment
Share on other sites

neowin wont let me edit but here is another set of directions taken from here http://ubuntuforums.org/archive/index.php/t-2780.html

Howto Install and Configure lm-sensors
========================

1. Install lm-sensors using apt-get or the Synaptic GUI.

sudo apt-get install lm-sensors


2. Run the mkdev.sh script in the lm-sensors source. It is extacted below:

a. Copy the script file below to a text editor and save it to a file named mkdev.sh.

#!/bin/bash

# Here you can set several defaults.

# The number of devices to create (max: 256)
NUMBER=32

# The owner and group of the devices
OUSER=root
OGROUP=root
# The mode of the devices
MODE=600

# This script doesn't need to be run if devfs is used
if [ -r /proc/mounts ] ; then
if grep -q "/dev devfs" /proc/mounts ; then
echo "You do not need to run this script as your system uses devfs."
exit;
fi
fi

i=0;

while [ $i -lt $NUMBER ] ; do
echo /dev/i2c-$i
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
i=$[$i + 1]
done
#end of file

b. Make the file executable:

chmod 755 mkdev.sh

c. Run mkdev.sh from the current directory

sudo ./mkdev.sh


3. Now run sensors-detect and answer YES to all YES/no questions. I generally use the ISA bus rather than the SMBus bus, your choice to this question!. At the end of the detection phase, a list of modules that needs to be loaded will displayed. You will need to write these down or print the list for the next steps.

sudo sensors-detect

Below is an example of results from sensors-detect:
#************************************************* *****************************
To make the sensors modules behave correctly, add these lines to
/etc/modules:

#----cut here----
# I2C adapter drivers
i2c-viapro
i2c-isa
# I2C chip drivers
eeprom
it87
#----cut here----

Then, run /etc/init.d/module-init-tools

To make the sensors modules behave correctly, add these lines to
/etc/modprobe.d/local and run update-modules:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----
#************************************************* *******************************


4. In this example, we add the modules in reverse order (order is critical!) in "/etc/modules".

#************************************************* ***********************
# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a "#", and everything on the line after them are ignored.

psmouse
mousedev
ide-cd
ide-disk
ide-generic
lp

#For lm-sensors, i2c modules
it87
i2c-viapro
i2c-isa

#end of file!
#************************************************* ****************


4. I found that there was no "/etc/modprobe.d/local" and that "alias char-major-89 i2c-dev" was already listed in "/etc/modprobe.d/aliases". So, nothing to do here.


5.Now load the modules manually using modprobe and update the dependencies.

sudo modprobe i2c-sensor
sudo modprobe i2c-viapro
sudo modprobe i2c-isa
sudo modprobe it87

sudo depmod -a <may not be needed!>
sudo update-modules <may not be needed!>


6. Now test the sensor output using the lm-sensors utility "sensors".

sensors

************************************************** *****************
it87-isa-0290
Adapter: ISA adapter
VCore 1: +1.57 V (min = +1.42 V, max = +1.57 V) ALARM
VCore 2: +2.66 V (min = +2.40 V, max = +2.61 V) ALARM
+3.3V: +6.59 V (min = +3.14 V, max = +3.46 V) ALARM
+5V: +5.11 V (min = +4.76 V, max = +5.24 V)
+12V: +11.78 V (min = +11.39 V, max = +12.61 V)
-12V: -19.14 V (min = -12.63 V, max = -11.41 V) ALARM
-5V: +0.77 V (min = -5.26 V, max = -4.77 V) ALARM
Stdby: +5.00 V (min = +4.76 V, max = +5.24 V)
VBat: +3.12 V
fan1: 3668 RPM (min = 0 RPM, div = :cool:
fan2: 0 RPM (min = 664 RPM, div = :cool: ALARM
fan3: 0 RPM (min = 2657 RPM, div = 2) ALARM
M/B Temp: +39?C (low = +15?C, high = +40?C) sensor = thermistor
CPU Temp: +36?C (low = +15?C, high = +45?C) sensor = thermistor
Temp3: +96?C (low = +15?C, high = +45?C) sensor = diode
************************************************** ********************

7. Reboot Ubuntu and the sensors should now be detected during the boot process properly!

8. The sensor output may be tweaked by editing the "/etc/sensors.conf" file. It is possible to correct inacurate scaling too. For details check "man sensors.conf.

Link to comment
Share on other sites

No dice.  sudo sensors-detect just isn't finding any fan controllers, only temperature sensors.  Here's the result:

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

Driver `it87':
  * ISA bus, address 0xe80
    Chip `ITE IT8720F Super IO Sensors' (confidence: 9)

Driver `k10temp' (autoloaded):
  * Chip `AMD Family 10h thermal sensors' (confidence: 9)

To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
it87
#----cut here----
If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones!

And the sudo sensors output:

mint@mint ~/Desktop $ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +43.0?C  (crit = +127.0?C)
temp2:        +39.0?C  (crit = +127.0?C)

radeon-pci-0100
Adapter: PCI adapter
temp1:        +68.0?C  

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +46.0?C  (high = +70.0?C)

I have no idea what that second PCI adapter temp is, all I have in there are a PCIe video card and a PCI sound card.  The top one is my CPU for sure, and the radeon is definitely my GPU temp.  No idea what the others are.  Also missing all my CPU core temps, which are way more accurate and precise than my mobo CPU temp sensor.  And my HD temps, but I don't really care about those.  I just want the fan controller synced to that first temperature there.

 

edit: WHOOPS! This might have been entirely pointless.  The extra noise was coming from my GPU fan, not my CPU fan, which I never bothered to manually control.  Installing the latest Catalyst drivers might fix that, if it's possible on Lubuntu.  While it would be nice to also manually control my CPU fan like I could with SpeedFan in Windows, it seems the BIOS is doing a fine job of that on its own.

Link to comment
Share on other sites

what radeon is in there?

 

HD 5770.  I downloaded the drivers from AMD, it's in a "run" file.  I'm just trying to figure out how to execute a .run file now...  and doubt any of this will work on a liveusb.

Link to comment
Share on other sites

To install the AMD Catalyst proprietary driver using the

Automatic

option, follow these

steps:

1

Launch the Terminal Application/Window

and navigate to the AMD Catalyst

proprietary driver download.

2

Enter the command

sh ./ati-driver-installer-x86.x86_64.run

to launch the AMD

Catalyst proprietary driver installer.


Note:

If a previous installation of AMD Catalyst proprietary driver is

detected and required to be uninstalled, the below message appears

instead of the AMD License Agreement. You must uninstall the older

driver before installing this version. Optionally, you can force the

installation of this driver by entering the command

sh ./ati-driver-

installer-x86.x86_64.run --force

. Forcing install is NOT

recommended.


Launch the Terminal Application/Window and run:

For versions of X.Org newer than 7,

/usr/bin/aticonfig --initial

to configure the

driver for your AMD product.

For versions of X.Org older than 7,

/usr/X11R6/bin/aticonfig --initial

to configure

the driver for your AMD product

Link to comment
Share on other sites

Success!  My GPU fan is now running nice and quietly, and a quiet PC is a happy PC!  Although, like infants, a quiet PC could also mean it's not breathing, so I'd expect it to be breathing heavily when it's playing a 3D game, but I assume it will.

 

I had to install Linux Mint to the HD to get the ATI drivers to install, but it worked just fine, and I was probably going to install it anway.  So are ".run" files like Linux's ".exe" files now, or what?

 

The ONLY thing holding me back from switching from windows completely is one obscure device that isn't officially supported in Linux. It's my CrystalFontz CFA633 LCD screen for my PC case, connected via USB internally.  A few people on the forums have written c programs that can interface with it, but I wouldn't know how to do that.

Link to comment
Share on other sites

Man this is so weird.  I installed a little temperature sensor applet, and it is displaying a temperature that lm_sensors doesn't detect!  I think it is my CPU core temp by AMD, although there should be 4 of those.  It says it is a "pci" sensor, but the values don't match anything that lm_sensors sees.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.