debian下控制风扇转速记录(降噪神器)

家里有个双wan的mini主机用pve虚拟了一个lede+win10
但是一开win10风扇就嗷嗷叫,转速超高,噪音巨大
google了一圈回来终于搞定风扇转速控制。

首先:

https://wiki.archlinux.org/index.php/Fan_speed_control_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
维基百科教程走安装模块

lm-sensors

设置 lm_sensors。

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +29.0°C  (high = +76.0°C, crit = +100.0°C)  

[...]

it8718-isa-0290
Adapter: ISA adapter
Vcc:         +1.14 V  (min =  +0.00 V, max =  +4.08 V)   
VTT:         +2.08 V  (min =  +0.00 V, max =  +4.08 V)   
+3.3V:       +3.33 V  (min =  +0.00 V, max =  +4.08 V)   
NB Vcore:    +0.03 V  (min =  +0.00 V, max =  +4.08 V)   
VDRAM:       +2.13 V  (min =  +0.00 V, max =  +4.08 V)   
fan1:        690 RPM  (min =   10 RPM)
temp1:       +37.5°C  (low  = +129.5°C, high = +129.5°C)  sensor = thermistor
temp2:       +25.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode

运行sensors获得风扇转速接口位置fan2

root@host:~# sensors
nct6106-isa-0a10
Adapter: ISA adapter
in0:            +0.96 V  (min =  +0.00 V, max =  +1.74 V)
in1:            +1.54 V  (min =  +0.00 V, max =  +2.04 V)
in2:            +3.34 V  (min =  +0.00 V, max =  +4.08 V)
in3:            +3.20 V  (min =  +0.00 V, max =  +4.08 V)
in4:            +1.05 V  (min =  +0.00 V, max =  +2.04 V)
in5:            +1.04 V  (min =  +0.00 V, max =  +2.04 V)
in6:            +1.66 V  (min =  +0.00 V, max =  +2.04 V)
in7:            +3.12 V  (min =  +0.00 V, max =  +4.08 V)
in8:            +2.10 V  (min =  +0.00 V, max =  +4.08 V)
fan1:             0 RPM  (min =    0 RPM)
fan2:          1800 RPM  (min =    0 RPM)
fan3:             0 RPM  (min =    0 RPM)
SYSTIN:         +46.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM
                         (crit low = +127.0°C, crit = +127.0°C)  sensor = thermal diode
CPUTIN:        +127.0°C  (high = +80.0°C, hyst = +75.0°C)  ALARM
                         (crit low = +127.0°C, crit = +127.0°C)  sensor = thermistor
AUXTIN:         +24.0°C  (high = +80.0°C, hyst = +75.0°C)
                         (crit low = +127.0°C, crit = +127.0°C)  sensor = thermal diode
PECI Agent 0:   +64.0°C  (high = +80.0°C, hyst = +75.0°C)
                         (crit low = +127.0°C, crit = +75.0°C)
PECI Agent 1:    +0.0°C  (high = +80.0°C, hyst = +75.0°C)
                         (crit low = +127.0°C, crit = +127.0°C)
PCH_CHIP_TEMP:   +0.0°C
PCH_CPU_TEMP:    +0.0°C
intrusion0:    ALARM
beep_enable:   disabled

acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +92.0°C)
temp2:        +29.8°C  (crit = +92.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +64.0°C  (high = +87.0°C, crit = +91.0°C)
Core 0:        +64.0°C  (high = +87.0°C, crit = +91.0°C)
Core 1:        +64.0°C  (high = +87.0°C, crit = +91.0°C)

使用pwnconfig检测

root@host:~# pwmconfig
File /var/run/fancontrol.pid exists. This typically means that the
fancontrol deamon is running. You should stop it before running pwmconfig.
If you are certain that fancontrol is not running, then you can delete
/var/run/fancontrol.pid manually.
root@host:~# service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
root@host:~# service fancontrol stop
root@host:~# pwmconfig
# pwmconfig revision 6243 (2014-03-20)
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 is acpitz
   hwmon1 is coretemp
   hwmon2 is nct6106

Found the following PWM controls:
   hwmon2/pwm1           current value: 127
   hwmon2/pwm2           current value: 255

Giving the fans some time to reach full speed...

Found the following fan sensors:
   hwmon2/fan1_input     current speed: 0 ... skipping!
   hwmon2/fan2_input     current speed: 2749 RPM
   hwmon2/fan3_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 hwmon2/pwm1 ...
  hwmon2/fan2_input ... speed was 2749 now 2772
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon2/pwm1,
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)?#此时应该是测了风扇1,并没有听见停止,所以选n

Testing pwm control hwmon2/pwm2 ...
  hwmon2/fan2_input ... speed was 2749 now 1205
    It appears that fan hwmon2/fan2_input
    is controlled by pwm hwmon2/pwm2
Would you like to generate a detailed correlation (y)?
Note: If you had gnuplot installed, I could generate a graphical plot.
    PWM 255 FAN 2743  #风扇转速等级,后面会用到
    PWM 240 FAN 2721
    PWM 225 FAN 2657
    PWM 210 FAN 2571
    PWM 195 FAN 2495
    PWM 180 FAN 2385
    PWM 165 FAN 2268
    PWM 150 FAN 2142
    PWM 135 FAN 1982
    PWM 120 FAN 1809
    PWM 105 FAN 1601
    PWM 90 FAN 1383
    PWM 75 FAN 1259
    PWM 60 FAN 1201
    PWM 45 FAN 1201
    PWM 30 FAN 1201
    PWM 28 FAN 1198
    PWM 26 FAN 1193
    PWM 24 FAN 1195
    PWM 22 FAN 1201
    PWM 20 FAN 1200
    PWM 18 FAN 1208
    PWM 16 FAN 1208
    PWM 14 FAN 1206
    PWM 12 FAN 1197
    PWM 10 FAN 1203
    PWM 8 FAN 1207
    PWM 6 FAN 1215
    PWM 4 FAN 1204
    PWM 2 FAN 1203
    PWM 0 FAN 1194

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)? y#百度英文意思
What should be the path to your fancontrol config file (/etc/fancontrol)?#风扇控制文件位置
Loading configuration from /etc/fancontrol ...

设置自定义风扇模块参数

Select fan output to configure, or other action:
1) hwmon2/pwm2         3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 1 #开始自定义

Devices:
hwmon0 is acpitz
hwmon1 is coretemp
hwmon2 is nct6106

Current temperature readings are as follows:
hwmon0/temp1_input      27
hwmon0/temp2_input      29
hwmon1/temp1_input      63
hwmon1/temp2_input      61
hwmon1/temp3_input      63
hwmon2/temp1_input      45
hwmon2/temp2_input      127
hwmon2/temp3_input      24
hwmon2/temp7_input      61
hwmon2/temp8_input      0
hwmon2/temp9_input      0

Select a temperature sensor as source for hwmon2/pwm2:
 1) hwmon0/temp1_input   #选择一个连接的温度,因为我想得到一个较低的转速,所以选择了一个较低的温度
 2) hwmon0/temp2_input
 3) hwmon1/temp1_input
 4) hwmon1/temp2_input
 5) hwmon1/temp3_input
 6) hwmon2/temp1_input
 7) hwmon2/temp2_input
 8) hwmon2/temp3_input
 9) hwmon2/temp7_input
10) hwmon2/temp8_input
11) hwmon2/temp9_input
12) None (Do not affect this PWM output)
select (1-n): 1  #选择低温的1)hwmon0/tem1_input

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 25
#风扇应以最低速度旋转
Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 90
#风扇应以最大速度旋转
Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255): 90
#输入PWM值(0-255),以便在温度超过温度极限时使用.此处就用到了之前说的风扇等级转速
#我选择的90对应的转速即为:1383  这个应该就是降低转速的重点    
Select fan output to configure, or other action:
1) hwmon2/pwm2         3) Just quit           5) Show configuration
2) Change INTERVAL     4) Save and quit
select (1-n): 4
#选择4 保存退出
Saving configuration to /etc/fancontrol...
Configuration saved
root@host:~# vim /etc/fancontrol #检查一下文件内容
root@host:~# service fancontrol start  #开始运行风扇控制,风扇速度立马降下来了!

贴一下fancontrol配置文件内容:

root@host:~# cat /etc/fancontrol
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon0= hwmon2=devices/platform/nct6775.2576
DEVNAME=hwmon0=acpitz hwmon2=nct6106
FCTEMPS= hwmon2/pwm2=hwmon0/temp1_input
FCFANS= hwmon2/pwm2=hwmon2/fan2_input
MINTEMP= hwmon2/pwm2=25
MAXTEMP= hwmon2/pwm2=90
MINSTART= hwmon2/pwm2=150
MINSTOP= hwmon2/pwm2=0
MAXPWM=hwmon2/pwm2=90
root@host:~#

你可能感兴趣的:(debian下控制风扇转速记录(降噪神器))