Linux – How to manually control a fan from the terminal

acpicentos-6linuxlm-sensorssensors

I'm trying to control the fan speed on my desktop, and I'd appreciate your help.

Goal: Use a script to control the fan speed on my computer.

Motivation: The embedded BIOS "Smart Fan" settings isn't smart enough to speed up the fan when the system gets hot, resulting in a crash when the one of the temps passes the threshold.

Configuration:

  • Centos 6.3
  • Acer Veriton VN281G-UA425L
  • abbreviated lspci output

    00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge
    00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
    00:1c.2 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 3 (rev 02)
    00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 02)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
    00:1f.0 ISA bridge: Intel Corporation NM10 Family LPC Controller (rev 02)
    00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA Controller [IDE mode] (rev 02)
    00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)
    
  • abbreviated /proc/cpuinfo

    processor   : 0
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 28
    model name  : Intel(R) Atom(TM) CPU D425   @ 1.80GHz
    
  • Grub configuration

    title CentOS (2.6.32-279.5.1.el6.x86_64)
            root (hd0,0)
            kernel /vmlinuz-2.6.32-279.5.1.el6.x86_64 ro root=/dev/mapper/vg_hadean-lv_root rd_NO_LUKS rd_LVM_LV=vg_hadean/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_hadean/lv_swap  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
            initrd /initramfs-2.6.32-279.5.1.el6.x86_64.img
    

Previous attempts:

  • Run lm_sensors lm_sensors could only find the temperature output
  • Run yum search fan no matches
  • add acpi and acpi=strict to kernel opts nothing happened
  • check /proc/acpi/fan the directory is empty

I ran acer_ec.pl regs and the output was this:

        00  01  02  03  04  05  06  07  |   08  09  0A  0B  0C  0D  0E  0F
        __  __  __  __  __  __  __  __  |   __  __  __  __  __  __  __  __
00 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
10 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
20 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
30 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
40 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
50 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
60 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
70 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
80 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
90 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
A0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
B0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
C0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
D0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
E0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
F0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 

I don't know if that's what it's supposed to look like, but something seems amiss here.


I found a link that inspired me to try pwmconfig. The output was: There are no pwm-capable sensor modules installed I'm going to try to find out how I can install those modules.


I reset the "Smart Fan" setting and it isn't causing me any more problems, for now. I don't know how that could affect it, but we'll see what happens when I start putting a load back on the system.

I still haven't found the right patches for the kernel (or if that's even the problem). If the problem continues, I'll try to update the kernel to include the acpi support. Using the hardware tool from an arch linux iso, I found out that I'm using the P01-A3L BIOS, release 4/6/2011, revision 8.16 on an Acer Veriton N281G motherboard.

If that doesn't work, I might just scrap it and move to Debian or Arch.

Best Answer

Look for the acer_ec.pl script it can control the fan through the register of the embedded controller. It works on other pc, too.