@20221210 看到lm-sensors社区的更新升级到最新版内核就不用编译了直接就内核集成了
某种原因导致目前畅网第四版n5105性价比爆棚,比第三版改变不大,也不用期待226比225网卡优秀多少,但数码界流行买新不买旧的道理,因此就和朋友一起趁多多摇到100的优惠就入了第四版n5105实惠版,在此顺道再次感谢朋友军军。
总体而言升级不大,但带来性能升级很明显,而且带来一个系统上优化的槽点,pwm温控形同虚设,(厂家在bios里写死了32度-40度的pwm温控参数,n5105发热不小基本40度-45度之间徘徊,通过pdd商家客服工程师反馈了下厂家人家根本不睬)。这也是本篇水一文,在其他地方找不到的如何在系统层面优化pwm风扇。(本篇基于proxmox ve 7.2,其他环境请自行参考编译与测试)
物理位置
pwm四针温控位置在主板sata供电口旁边(图片左侧黄色sata的旁边sata供电口的旁边)

基本原理
https://wiki.archlinux.org/index.php?title=Fan_speed_control
参考这个wiki觉得基本可以通用可行,于是上手准备开干。
想必各位使用pve的朋友都安装了lm-sensors用于网页端监控传感器问题。如果没有的朋友可以通过下面命令安装
apt install lm-sensers
实验前查看pwm风扇转速1288
通过命令sensors可以查看最终效果,(it8613就是文章核心,位于南桥的温控芯片包含pwm控制,默认大家可能没有这一项,可以参考下一章需要先编译下加载支持)
root@pve:~# sensors
it8613-isa-0a30
Adapter: ISA adapter
CPU Fan: 1288 RPM (min = 0 RPM)
CPU Temp: +36.0°C (low = -128.0°C, high = +127.0°C) sensor = thermistor
MB Temp: +38.0°C (low = -128.0°C, high = +127.0°C) sensor = thermistor
PCH Temp: +38.0°C (low = -128.0°C, high = +127.0°C)
acpitz-acpi-0
Adapter: ACPI interface
temp1: +45.0°C (crit = +119.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +41.0°C (high = +105.0°C, crit = +105.0°C)
Core 0: +37.0°C (high = +105.0°C, crit = +105.0°C)
Core 1: +37.0°C (high = +105.0°C, crit = +105.0°C)
Core 2: +37.0°C (high = +105.0°C, crit = +105.0°C)
Core 3: +37.0°C (high = +105.0°C, crit = +105.0°C)
nvme-pci-0100
Adapter: PCI adapter
Composite: +32.9°C (low = -273.1°C, high = +82.8°C)
(crit = +84.8°C)
编译支持it8613
参考如下项目github的a1wong(由于大妈限制说不让发github或百度网盘之类的网络连接所以再次欠奉,后续连接奉上或者自行去github的a1wong的it87项目下载下来)
解压后,make安装
cd it87/
make clean
*注:make命令可能这一步会报少一些预加载项,如下安装:
apt update -y
apt -y install dkms make gcc
apt -y install build-essential
apt -y install libelf-dev
根据自己的系统版本号来安装头文件
uname -r
apt search 5.15.39-4
apt install pve-headers-5.15.39-4-pve
然后就可以继续make clean
make
make install
modprobe it87
通过sensors-detect来加载it8613
sensors-detect
sensors
lsmod |grep it87
优化pwmconfig
root@pve:~# pwmconfig
#pwmconfig version 3.6.0
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 nvme
hwmon2 is it8613
hwmon3 is coretemp
Found the following PWM controls:
hwmon2/pwm2 current value: 255
hwmon2/pwm3 current value: 255
hwmon2/pwm4 current value: 255
hwmon2/pwm5 current value: 255
Giving the fans some time to reach full speed...
Found the following fan sensors:
hwmon2/fan2_input current speed: 1869 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/pwm2 ...
hwmon2/fan2_input ... speed was 1869 now 0
It appears that fan hwmon2/fan2_input
is controlled by pwm hwmon2/pwm2
Would you like to generate a detailed correlation (y)? n
Testing pwm control hwmon2/pwm3 ...
hwmon2/fan2_input ... speed was 1869 now 1869
no correlation
No correlations were detected.
There is either no fan connected to the output of hwmon2/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)? n
Testing pwm control hwmon2/pwm4 ...
hwmon2/fan2_input ... speed was 1869 now 1869
no correlation
No correlations were detected.
There is either no fan connected to the output of hwmon2/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)? n
Testing pwm control hwmon2/pwm5 ...
hwmon2/fan2_input ... speed was 1869 now 1869
no correlation
No correlations were detected.
There is either no fan connected to the output of hwmon2/pwm5,
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)? 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)?
Loading configuration from /etc/fancontrol ...
Select fan output to configure, or other action:
1) hwmon2/pwm2
2) Change INTERVAL
3) Just quit
4) Save and quit
5) Show configuration
select (1-n): 1
Devices:
hwmon0 is acpitz
hwmon1 is nvme
hwmon2 is it8613
hwmon3 is coretemp
Current temperature readings are as follows:
hwmon0/temp1_input 45
hwmon1/temp1_input 33
hwmon2/temp1_input 36
hwmon2/temp2_input 38
hwmon2/temp3_input 38
hwmon3/temp1_input 42
hwmon3/temp2_input 39
hwmon3/temp3_input 38
hwmon3/temp4_input 39
hwmon3/temp5_input 38
Select a temperature sensor as source for hwmon2/pwm2:
1) hwmon0/temp1_input 7) hwmon3/temp2_input
2) hwmon1/temp1_input 8) hwmon3/temp3_input
3) hwmon2/temp1_input 9) hwmon3/temp4_input
4) hwmon2/temp2_input 10) hwmon3/temp5_input
5) hwmon2/temp3_input 11) None (Do not affect this PWM output)
6) hwmon3/temp1_input
select (1-n): 6
Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 40
Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 50
Enter the minimum PWM value (0-255)
at which the fan STOPS spinning (press t to test) (100): t
Now we decrease the PWM value to figure out the lowest usable value.
(每个人的风扇型号不一样,这里可能会有差异,我的是12cm猫扇)
We will use a slightly greater value as the minimum speed.
PWM 255 -> 1864 RPM
PWM 240 -> 1790 RPM
PWM 225 -> 1695 RPM
PWM 210 -> 1595 RPM
PWM 195 -> 1500 RPM
PWM 180 -> 1394 RPM
PWM 165 -> 1288 RPM
PWM 150 -> 1188 RPM
PWM 135 -> 1090 RPM
PWM 120 -> 971 RPM
PWM 105 -> 853 RPM
PWM 90 -> 732 RPM
PWM 75 -> 622 RPM
PWM 60 -> 482 RPM
PWM 45 -> 350 RPM
PWM 30 -> 201 RPM
PWM 28 -> 153 RPM
PWM 26 -> 0 RPM
OK, using 30
Enter the minimum PWM value (30-255)
at which the fan STARTS spinning (press t to test) (150): 40
Enter the PWM value (0-30) to use when the temperature
is below the low temperature limit (0):
Enter the PWM value (30-255) to use when the temperature
is over the high temperature limit (255):
Select fan output to configure, or other action:
1) hwmon2/pwm2
2) Change INTERVAL
3) Just quit
4) Save and quit
5) Show configuration
select (1-n): 4
Saving configuration to /etc/fancontrol...
Configuration saved
root@pve:~# vi /etc/fancontrol
root@pve:~# /etc/init.d/fancontrol restart
Restarting fancontrol (via systemctl): fancontrol.service.
再次查看pwm风扇783
root@pve:~# sensors
it8613-isa-0a30
Adapter: ISA adapter
CPU Fan: 783 RPM (min = 0 RPM)
CPU Temp: +36.0°C (low = -128.0°C, high = +127.0°C) sensor = thermistor
MB Temp: +39.0°C (low = -128.0°C, high = +127.0°C) sensor = thermistor
PCH Temp: +39.0°C (low = -128.0°C, high = +127.0°C)
acpitz-acpi-0
Adapter: ACPI interface
temp1: +45.0°C (crit = +119.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +41.0°C (high = +105.0°C, crit = +105.0°C)
Core 0: +38.0°C (high = +105.0°C, crit = +105.0°C)
Core 1: +38.0°C (high = +105.0°C, crit = +105.0°C)
Core 2: +38.0°C (high = +105.0°C, crit = +105.0°C)
Core 3: +38.0°C (high = +105.0°C, crit = +105.0°C)
nvme-pci-0100
Adapter: PCI adapter
Composite: +33.9°C (low = -273.1°C, high = +82.8°C)
(crit = +84.8°C)
总结
这样猫扇真的很安静,偶尔docker的qinglong大批量运行上升到50度才会转速上升有声音。
后记:闲来无事偶作一篇仅供各位参考。如果本篇能够帮助大家或厂家,欢迎自愿打赏,谢谢。
作者声明本文无利益相关,欢迎值友理性交流,和谐讨论~

资深rhce粗粗看完,还是觉得usb 风扇简单
大佬,按照你说的编译完之后重启就没有
回家你还让我看代码,
之前听说pve装这些监测插件会不稳定,不知道是不是这样?
风扇的购买地址给一个吧
第一版可以用吗
你这温度就不高,我待机外壳就60度了
机器关了usb还在供电怎么关掉?
我买了第四版的,鲁大师跑分显卡每次只有3万多四万多分,和网友们测的7.8万分差距怎么这么大?显卡也跟新到最新的驱动了,这是咋回事
废物利用,直接cpu拆机小风扇放上面,外接5V充电器,一点声音没有,温度维持在40度左右。
5105在pve下ikuai断流啊咋办
PVE7.2下 pci直通界面 是不是只有地址没有设备名
第三版没有pwm4pin风扇口吧。。为啥说适用第三版?
同第四版,bios没有写死啊,可以自己调整的,按+- 可以调整温度
我没用pve就是觉得我看不太懂一堆代码 所以装了esxi
这个小机器的sata接口能带动3.5寸的机械硬盘么?
楼主你的风扇是哪个型号,主板的4pin应该是5v吧
里面配的风扇转接线,两个接口分别是啥呀?网上能买到的好像都不是
感谢分享,我试了有点问题,pwm可以控转速,但有下限,最低只能控到600多转,即便调到0,转速也还有600多,但往上调是可以到1800转,不知什么原因。
esxi 可以用吗?