Page 1 of 1

Looking for Thinkpad Fan control (tpfancontrol) for Linux

Posted: Tue Aug 29, 2006 7:16 pm
by indessen
Hello,

I am looking for Thinkpad Fan control (tpfancontrol) for Linux... so that in the same way I can start the program and control the fan. I dont use Linux very often and am a total novice, i.e. I cant program or enter anything at the command line, i.e. use it like Windows.

Appreciate any help.

Louis

Posted: Tue Aug 29, 2006 11:59 pm
by yossarian
This link may be of service to you:
http://www.thinkwiki.org/wiki/ACPI_fan_control_script

Posted: Wed Aug 30, 2006 5:52 am
by indessen
yossarian wrote:This link may be of service to you:
http://www.thinkwiki.org/wiki/ACPI_fan_control_script
thanks!

I went there, downloaded the file, saved it on my HDD on C:\ , once as "tpfancontrol" and once as "tpfancontrol.php", as I wasnt sure which is right... (and *.php was the standard save option).

when I rant Knoppix, I clicked on the file, nothing happened.

I presume from what I saw on the webpage that it needs to be run from a command line with some knowledge of how Linux works? As I mentioned, I am totally clueless w.r.t. Linux....

Any other ideas?

Posted: Wed Aug 30, 2006 11:05 am
by Dead1nside
I highly doubt the script will be in PHP so it's extension probably shouldn't be that.

Posted: Wed Aug 30, 2006 11:26 am
by indessen
Dead1nside wrote:I highly doubt the script will be in PHP so it's extension probably shouldn't be that.
I thought so too, which is why I saved it without extension as well... but that didnt do anything either... :(

Posted: Wed Aug 30, 2006 11:31 am
by djpharoah
since its a script you have to first make it exectuable. Secondly you have to make sure your kernel is compiled properly with the right modules.

Posted: Wed Aug 30, 2006 11:35 am
by Dead1nside
But is it a PHP script? Or is it something more conventional? I didn't think PHP scripts had access to hardware monitoring etc.

Posted: Wed Aug 30, 2006 11:50 am
by indessen
djpharoah wrote:since its a script you have to first make it exectuable. Secondly you have to make sure your kernel is compiled properly with the right modules.

rriiiight... ;)

you mean to say I cannot just click and go? I'll repeat: I know nothing about Linux, but have a Knoppix CD that I would like to use to get to know Linux... but without the fan going constantly... ;)

Posted: Wed Aug 30, 2006 4:47 pm
by Dead1nside
Err... surely the nature of script is that it doesn't need to be compiled. Usually scripts are dynamic.

Posted: Thu Aug 31, 2006 8:45 am
by techflavor
Yes but if he is having problems running the script, chances are he needs to make it executable -- chmod +x scriptname

Posted: Thu Aug 31, 2006 9:02 am
by piquadrat
indessen wrote:I'll repeat: I know nothing about Linux
If I was you, I'd make myself a little more familiar with Linux before I'd start playing around with the hardware.

Anyway, the BIOS controls the fan even under Linux. I have around 3500rpm, which is more or less the same as in Windows. The tpfancontrol script doesn't lower the rpm.

Posted: Thu Aug 31, 2006 10:08 am
by Dead1nside
Surely the only way to get to know Linux is by playing around.

Posted: Thu Aug 31, 2006 4:16 pm
by piquadrat
Yes, sure, but that's not my point. It's just that I don't think that software that could brick your laptop is a good place to start learning. Quote from the thinkwiki article linked above:
These scripts rely on undocumented hardware features and override nominal hardware behavior. They may thus cause arbitrary damage to your laptop or data. Watch your temperatures!

Posted: Fri Sep 01, 2006 10:14 am
by Dead1nside
Yer, good point.

Posted: Sat Sep 02, 2006 12:21 am
by yossarian
The first line of the script reads:

Code: Select all

#!/bin/bash 
This means it's a bash script.

Linux doesn't differentiate suffixes so you can leave it as a .php if you want, but it would just look strange considering it's a bash script.

As techflavor said, you also need to give it execution permissions by issuing something along the lines of:
chmod +x scriptfilename

Posted: Wed Sep 06, 2006 10:54 am
by Zak Smith
Here's what I did--

saved tp-fancontrol to /usr/local/sbin/tp-fancontrol
chmod 755 /usr/local/sbin/tp-fancontrol
added it to /etc/inittab so it always runs, and is restarted if it dies

Code: Select all

fc:2345:respawn:/usr/local/sbin/tp-fancontrol
Note that I did NOT use the /etc/init.d and tp-fancontrol.conf setup.

Also, here is a script which reports on the current CPU frequencies, CPU temperature, and fan speed:

Code: Select all

#!/bin/sh
FAN=`grep speed /proc/acpi/ibm/fan | cut -d: -f2`

extra=`perl -ne 'm/^EC 0xc0: .(..) .(..) .(..) / or next; print hex($1)." ".hex($2)." ".hex($3)."\n"' < /proc/acpi/ibm/ecdump`

CPUT0=`cut -d: -f2 /proc/acpi/ibm/thermal| cut -d' ' -f1`

C0F=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`
C0FG=`expr $C0F / 1000000`
C0FS=`printf "%3.1f" $C0FG`

C1F=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq`
C1FG=`expr $C1F / 1000000`
C1FS=`printf "%3.1f" $C1FG`

echo $C0FS $C1FS
echo $CPUT0 C
echo $FAN rpm
On my Z61t, tp-fancontrol lowers the normal fan rate of around 2800 rpm to imperceptible (reported as about 1600rpm) when it's not running hot.

Posted: Mon Feb 26, 2007 1:01 am
by cb474
I just tried running tp-fancontrol on my T60 and it made the fan run much faster. Any thoughts about what's going on? Is there some way it needs to be configured? I'm pretty new to this Linux stuff.