10 Aug

Thinkfan and Lenovo E545.

On this post i will show how to install Thinkfan on Lenovo with Ubuntu 14.04 (and Ubuntu 14.10) and its settings. Thinkfan its software for Thinkpad Laptops to control fan speed with temperature.
Lm-sensors – essential tools for monitoring the hardware health of Linux systems and containing hardware health monitoring.

This settings can save you battary live. Another post ist here.
Instal thinkfun and lm-sensors:

1
$sudo aptitude install thinkfan lm-sensors

Load module thinkpad_acpi with thinkfan changes:

1
$echo "options thinkpad_acpi fan_control=1" | sudo tee /etc/modprobe.d/thinkfan.conf

Restar module:

1
2
$sudo modprobe -rv thinkpad_acpi
sudo modprobe -v thinkpad_acpi

On Intel Processors use coretemp module:

1
$sudo modprobe -v coretemp

Make autostart. Change in /etc/default/thinkfan :

1
START=yes

Edit /etc/thinkfan.conf and set temp level to change fan speed:

1
2
3
4
5
6
7
8
9
(0, 0,  42)
(1, 40, 47)
(2, 45, 52)
(3, 50, 57)
(4, 55, 62)
(5, 60, 67)
(6, 65, 72)
(7, 70, 77)
(127,   75, 32767) # Wichtig: diese Zeile (127 = "disengaged" d.h. ungeregelt) sorgt für volle Lüfterdrehzahl

Add to /etc/thinkfan.conf your sensors path on Ubuntu 10.04:

1
2
sensor /sys/class/hwmon/hwmon1/device/temp1_input
fan /sys/class/hwmon/hwmon0/device/pwm1

———————————————————
Some changings in /etc/thinkfan.conf on Ubuntu 14.10.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
biotin@ThinkPad:~$ sudo thinkfan -n
[sudo] password for biotin:

/etc/thinkfan.conf:39:sensor /sys/devices/pci0000:00/0000:00:01.0/hwmon/hwmon2/temp1_input
WARNING: The `sensor' keyword is deprecated. Please use the `hwmon' or `tp_thermal' keywords instead!

/etc/thinkfan.conf:40:sensor /sys/devices/pci0000:00/0000:00:18.3/temp1_input
WARNING: The `sensor' keyword is deprecated. Please use the `hwmon' or `tp_thermal' keywords instead!

WARNING: Using default fan control in /proc/acpi/ibm/fan.

/sys/devices/pci0000:00/0000:00:01.0/hwmon/hwmon2/temp1_input: No such file or directory
readconfig: Error getting temperature.
Refusing to run without usable config file!

First i will tray to find the temp1_input:

1
2
3
biotin@ThinkPad:~$ find /sys/ -name temp1_input
/sys/devices/pci0000:00/0000:00:18.3/temp1_input
find: `/sys/kernel/debug': Permission denied

Now some changing in /etc/thinkfan.conf: changing “sensor” to “hwmon” and adding temp1_input file direction.

1
hwmon /sys/devices/pci0000:00/0000:00:18.3/temp1_input

And now:

1
2
3
4
5
6
7
8
9
10
biotin@ThinkPad:~$ sudo thinkfan -n                                          

WARNING: Using default fan control in /proc/acpi/ibm/fan.

WARNING: You're using simple temperature limits without correction values, and your fan will only start at 55 °C. This can be dangerous for your hard drive.

sleeptime=5, tmax=40, last_tmax=40, biased_tmax=40 -> fan="level 0"
sleeptime=2, tmax=52, last_tmax=50, biased_tmax=55 -> fan="level 1"
sleeptime=5, tmax=47, last_tmax=49, biased_tmax=47 -> fan="level 0"
sleeptime=2, tmax=52, last_tmax=46, biased_tmax=61 -> fan="level 3"

And fan level is changed from 0 to 3 :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
biotin@ThinkPad:~$ cat /proc/acpi/ibm/fan
status:         enabled
speed:          0 ------!!!!-----
level:          auto
commands:       level <level> (<level> is 0-7, auto, disengaged, full-speed)
commands:       enable, disable
commands:       watchdog <timeout> (<timeout> is 0 (off), 1-120 (seconds))
biotin@ThinkPad:~$ cat /proc/acpi/ibm/fan
status:         enabled
speed:          0 ------!!!!-----
level:          3
commands:       level <level> (<level> is 0-7, auto, disengaged, full-speed)
commands:       enable, disable
commands:       watchdog <timeout> (<timeout> is 0 (off), 1-120 (seconds))

Not working on ThinkPad Edge E545, E520, E330/E530, L440, S531 and E545, E540.
———————————————————
Testing. Stop module:

1
$sudo /etc/init.d/thinkfan stop

Start module with testlog:

1
2
3
4
5
6
$sudo thinkfan -n
sleeptime=5, tmax=50, last_tmax=55, biased_tmax=50 -> fan="level 2"
sleeptime=2, tmax=56, last_tmax=51, biased_tmax=66 -> fan="level 5"
sleeptime=3, tmax=53, last_tmax=56, biased_tmax=60 -> fan="level 4"
sleeptime=5, tmax=50, last_tmax=53, biased_tmax=54 -> fan="level 3"
sleeptime=5, tmax=49, last_tmax=50, biased_tmax=50 -> fan="level 2"

Not working on E545, E520, E330/E530, L440, S531 and E545, E540, but fan level is sensible to temp:

1
2
3
4
5
6
7
8
9
biotin@thinkpad:~$ sensors
thinkpad-isa-0000
Adapter: ISA adapter
fan1:           0 RPM ------!!!!-----

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +46.4°C  (high = +70.0°C)
                       (crit = +100.0°C, hyst = +99.0°C)

Start normally:

1
$sudo /etc/init.d/thinkfan start

Source: http://thinkwiki.de/Thinkfan

Tweet about this on TwitterShare on FacebookShare on Google+Share on RedditShare on VK
  • PatrizioTufarolo

    Hi,
    I’ve got a thinkpad E540, and I have the same 0 RPM output when launching lm-sensors.
    Even changing level /proc/acpi/ibm/fan to higher value, does not cause benefits to my laptop’s temperature. In Windows I have about 40-45° C, in Linux i touch 70°C with cpu intensive processes. What do you think about that?

    • biotin

      Hi Patrizio. Thanks for Question.
      Unfortunately, on E330/E530, L440, S531 and i think + E545, E540 its not working. You can read this here http://thinkwiki.de/Thinkfan :
      “Nicht unterstützte ThinkPad-Modelle: E330/E530, L440, S531: /proc/acpi/ibm/fan ohne Funktion, keine Rückmeldung der Lüfterdrehzahl (=0)”, this means that fan controller shows 0 RPM and it’s not working. You can test it with “thinkfan -n” command in terminal and look at the level changings depending on the temperature as on the top in my post. But in reality it’s not regulates the fan speed. I hope it will be corrected in the future.

      • PatrizioTufarolo

        Hi, thanks for answering.
        What temperatures are you getting on your laptop? (That i supposed to be E545)
        Thanks

        • biotin

          Hi. Now with active browser surfing and YouTube video playing on Debian its “temp1: +39.9°C ” and hard disk temp “/dev/sda: 42°C”.
          Linux Kernel 3.19 bring new performance for ATI Radeon and ThinkPad acpi controller. I think this can save temp and battery usage on ThinkPad Laptops in norm area.