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

<article class="post Card typo indexCard" itemscope="" itemtype="http://schema.org/BlogPosting">

家里有个双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:~#

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,490评论 6 508
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,581评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 165,830评论 0 356
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,957评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,974评论 6 393
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,754评论 1 307
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,464评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,357评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,847评论 1 317
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,995评论 3 338
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,137评论 1 351
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,819评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,482评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,023评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,149评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,409评论 3 373
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,086评论 2 355