ファンコントロール(fancontrol)導入

BIOSでFAN ControlがAutoになっていたのでManualにする

最低回転数を2000にした

インストール
$ sudo aptitude search fancontrol
p   fancontrol                      - utilities to read temperature/voltage/fan
$ sudo aptitude install fancontrol
以下の新規パッケージがインストールされます:
  fancontrol
以下のパッケージは『削除』されます:
  linux-headers-3.2.0-40{u} linux-headers-3.2.0-40-generic{u}
0 個のパッケージを更新、 1 個を新たにインストール、 2 個を削除予定、0 個が更新されていない。
20.9 k バイトのアーカイブを取得する必要があります。 展開後に 67.5 M バイトのディスク領域が解放されます。
先に進みますか? [Y/n/?] y
取得: 1 http://jp.archive.ubuntu.com/ubuntu/ precise/universe fancontrol all 1:3.3.1-2ubuntu1 [20.9 kB]
Fetched 20.9 kB in 0秒 (108 kB/s)
(データベースを読み込んでいます ... 現在 103587 個のファイルとディレクトリがインストールされています。)
linux-headers-3.2.0-40-generic を削除しています ...
linux-headers-3.2.0-40 を削除しています ...
以前に未選択のパッケージ fancontrol を選択しています。
(データベースを読み込んでいます ... 現在 81573 個のファイルとディレクトリがイン ストールされています。)
(.../fancontrol_1%3a3.3.1-2ubuntu1_all.deb から) fancontrol を展開しています...
man-db のトリガを処理しています ...
ureadahead のトリガを処理しています ...
fancontrol (1:3.3.1-2ubuntu1) を設定しています ...

$
コンフィグ

デーモンを停止(インストールすると起動している)

$ sudo service fancontrol stop
 * Stopping fan speed regulator fancontrol                               [ OK ]
$

コンフィグではFAN回転数を調整のため変更する(停止もさせる)のでPCに負荷が掛かってない状態で行う

$ sudo pwmconfig
# pwmconfig revision 5857 (2010-08-22)
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
   hwmon0/device is coretemp
   hwmon1/device is w83627dhg

Found the following PWM controls:
   hwmon1/device/pwm1
   hwmon1/device/pwm2
   hwmon1/device/pwm3
   hwmon1/device/pwm4

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon1/device/fan1_input     current speed: 2812 RPM
   hwmon1/device/fan2_input     current speed: 0 ... skipping!
   hwmon1/device/fan3_input     current speed: 0 ... skipping!
   hwmon1/device/fan4_input     current speed: 0 ... skipping!
   hwmon1/device/fan5_input     current speed: 0 ... skipping!

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue:

Testing pwm control hwmon1/device/pwm1 ...
  hwmon1/device/fan1_input ... speed was 2812 now 1278
    It appears that fan hwmon1/device/fan1_input
    is controlled by pwm hwmon1/device/pwm1
Would you like to generate a detailed correlation (y)?
    PWM 255 FAN 3013
    PWM 240 FAN 3013
    PWM 225 FAN 2812
    PWM 210 FAN 2812
    PWM 195 FAN 2812
    PWM 180 FAN 2812
    PWM 165 FAN 2636
    PWM 150 FAN 2636
    PWM 135 FAN 2343
    PWM 120 FAN 2343
    PWM 105 FAN 2109
    PWM 90 FAN 2109
    PWM 75 FAN 1917
    PWM 60 FAN 1757
    PWM 45 FAN 1757
    PWM 30 FAN 1562
    PWM 28 FAN 1406
    PWM 26 FAN 1406
    PWM 24 FAN 1360
    PWM 22 FAN 1360
    PWM 20 FAN 1360
    PWM 18 FAN 1318
    PWM 16 FAN 1240
    PWM 14 FAN 1205
    PWM 12 FAN 1205
    PWM 10 FAN 1205
    PWM 8 FAN 1171
    PWM 6 FAN 1171
    PWM 4 FAN 1110
    PWM 2 FAN 1110
    PWM 0 FAN 1110


Testing pwm control hwmon1/device/pwm2 ...
  hwmon1/device/fan1_input ... speed was 2812 now 2812
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon1/device/pwm2,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)?

Testing pwm control hwmon1/device/pwm3 ...
  hwmon1/device/fan1_input ... speed was 2812 now 3013
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon1/device/pwm3,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)?

Testing pwm control hwmon1/device/pwm4 ...
  hwmon1/device/fan1_input ... speed was 2812 now 3013
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon1/device/pwm4,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)?

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)?
What should be the path to your fancontrol config file (/etc/fancontrol)?

Select fan output to configure, or other action:
1) hwmon1/device/pwm1  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 5

Common Settings:
INTERVAL=10

Settings of hwmon1/device/pwm1:
  Depends on
  Controls
  MINTEMP=
  MAXTEMP=
  MINSTART=
  MINSTOP=


Select fan output to configure, or other action:
1) hwmon1/device/pwm1  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 1

Devices:
hwmon0/device is coretemp
hwmon1/device is w83627dhg

Current temperature readings are as follows:
hwmon0/device/temp2_input       40
hwmon0/device/temp3_input       40
hwmon1/device/temp1_input       50
hwmon1/device/temp2_input       110
hwmon1/device/temp3_input       40

Select a temperature sensor as source for hwmon1/device/pwm1:
1) hwmon0/device/temp2_input
2) hwmon0/device/temp3_input
3) hwmon1/device/temp1_input
4) hwmon1/device/temp2_input
5) hwmon1/device/temp3_input
6) None (Do not affect this PWM output)
select (1-n): 1

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 30

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60):

Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255):


Select fan output to configure, or other action:
1) hwmon1/device/pwm1  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 5

Common Settings:
INTERVAL=10

Settings of hwmon1/device/pwm1:
  Depends on hwmon0/device/temp2_input
  Controls hwmon1/device/fan1_input
  MINTEMP=30
  MAXTEMP=60
  MINSTART=150
  MINSTOP=0


Select fan output to configure, or other action:
1) hwmon1/device/pwm1  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 2

Current interval is 10 seconds.
Enter the interval at which fancontrol should update PWM values (in s): 20

Select fan output to configure, or other action:
1) hwmon1/device/pwm1  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 5

Common Settings:
INTERVAL=20

Settings of hwmon1/device/pwm1:
  Depends on hwmon0/device/temp2_input
  Controls hwmon1/device/fan1_input
  MINTEMP=30
  MAXTEMP=60
  MINSTART=150
  MINSTOP=0


Select fan output to configure, or other action:
1) hwmon1/device/pwm1  3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 4

Saving configuration to /etc/fancontrol...
Configuration saved
$

設定ファイルを参照してみる

$ cat /etc/fancontrol
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=20
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon1=devices/platform/w83627ehf.656
DEVNAME=hwmon0=coretemp hwmon1=w83627dhg
FCTEMPS=hwmon1/device/pwm1=hwmon0/device/temp2_input
FCFANS= hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm1=30
MAXTEMP=hwmon1/device/pwm1=60
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0
$

直接起動(通常はデーモン)してみる

$ sudo fancontrol
Loading configuration from /etc/fancontrol ...

Common settings:
  INTERVAL=20

Settings for hwmon1/device/pwm1:
  Depends on hwmon0/device/temp2_input
  Controls hwmon1/device/fan1_input
  MINTEMP=30
  MAXTEMP=60
  MINSTART=150
  MINSTOP=0
  MINPWM=0
  MAXPWM=255

Enabling PWM on fans...
Starting automatic fan control...
^CAborting, restoring fans...
Verify fans have returned to full speed
$

デーモンで起動

$ sudo service fancontrol start
 * Starting fan speed regulator fancontrol                               [ OK ]
$

監視温度とFAN回転数をチェックしてみると、最低温度~最高温度に比例してFAN回転数を変化させているようだ(fancontrolはshスクリプトなので参照すれば判る)

最低:30→25、最高:60→55に修正

$ cat /etc/fancontrol
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=20
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon1=devices/platform/w83627ehf.656
DEVNAME=hwmon0=coretemp hwmon1=w83627dhg
FCTEMPS=hwmon1/device/pwm1=hwmon0/device/temp2_input
FCFANS= hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm1=25
MAXTEMP=hwmon1/device/pwm1=55
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0
$

(変更:20130528-1)→ 範囲25℃~55℃を30℃~50℃に変更

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=20
DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon1=devices/platform/w83627ehf.656
DEVNAME=hwmon0=coretemp hwmon1=w83627dhg
FCTEMPS=hwmon1/device/pwm1=hwmon0/device/temp2_input
FCFANS= hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm1=30
MAXTEMP=hwmon1/device/pwm1=50
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0

(変更:20130528-2)→ 監視温度をCPU0からVRに変更、更に範囲を25℃~45℃に変更

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=20
DEVPATH=hwmon1=devices/platform/w83627ehf.656
DEVNAME=hwmon1=w83627dhg
FCTEMPS= hwmon1/device/pwm1=hwmon1/device/temp3_input
FCFANS= hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP= hwmon1/device/pwm1=25
MAXTEMP= hwmon1/device/pwm1=45
MINSTART= hwmon1/device/pwm1=150
MINSTOP= hwmon1/device/pwm1=0