【用Ubuntu构建家庭服务器】02 风扇自动风速配置

1 硬件配置

1.1 主板

主板: 华擎 ASRock H77 Pro4-M

1.2 风扇常识

风扇大小风扇边长对角孔距平行孔距
4cm4.0cm4.5cm3.2cm
5cm5.0cm5.7cm4.1cm
6cm6.0cm7.6cm5.1cm
7cm7.0cm8.6cm6.1cm
8cm8.0cm10.1cm7.2cm
9cm9.0cm11.2cm8.2cm
12cm12.0cm15.0cm10.5cm
14cm14.0cm17.7cm12.5cm

风扇尺寸定义

2 传感器配置

2.1 传感器检测软件安装

lm-sensors

sudo apt install lm-sensors # 传感器配置程序
sudo apt install smartmontools # 硬盘监控工具

2.2 硬件设备温度传感器

# sudo sensors-detect # 传感器内核配置,检测额外的传感器
sensors # 查看hwmon传感器状态(不含硬盘)

## 直接从系统读取信息
cat /sys/class/hwmon/hwmon1/name # 获取温度监控设备名
# coretemp
cat /sys/class/hwmon/hwmon1/temp1_input # 获取温度监控值
# 31000
cat /sys/class/thermal/thermal_zone2/temp # 获取温度域的值

硬件硬件号设备名传感器设备号
固态硬盘hwmon0nvmenvme-pci-0100
CPUhwmon1coretempcoretemp-isa-0000
主板hwmon2nct6776nct6776-isa-0290

逐步添加风扇,看风扇转速对应风扇关系

2.3 硬盘温度读取

sudo smartctl -a /dev/sda | grep Temperature # 获取硬盘温度
sudo smartctl -A /dev/sda # 硬盘SMART属性
sudo smartctl -i /dev/sdX #硬盘基本信息

2.4 风扇转速传感器

使用sensors命令,逐步添加风扇,看风扇对应关系

主板接口Pin风扇型号尺寸位置Linux设备转速采集设备号
CHA_FAN144Pin风扇后背板、硬盘阵列架fan1hwmon2/fan1_input
CPU_FAN14CPU风扇CPUfan2hwmon2/fan2_input
CPU_FAN23fan3hwmon2/fan3_input
PWR_FAN133Pin风扇前盖上风扇、硬盘阵列架fan4hwmon2/fan4_input
CHA_FAN233Pin风扇前盖下风扇、电源fan5hwmon2/fan5_input

3 控制器配置

3.1 PWM值对比风扇转速做对应关系

cat /sys/class/hwmon/hwmon2/pwm3 # 获取PWM设置
sensors # 读取风扇值
风扇控制风扇转速采集设备号
hwmon2/pwm1255CHA_FAN1hwmon2/fan1_input1518
hwmon2/pwm2228CPU_FAN1hwmon2/fan2_input2235
CPU_FAN2hwmon2/fan3_input
hwmon2/pwm3255CHA_FAN2hwmon2/fan5_input1506
PWR_FAN1hwmon2/fan4_input1573

3.2 PWM与风扇转速对照表

sudo apt install fancontrol # 风扇控制器
sudo pwmconfig
Found the following devices:
   hwmon0 is nvme
   hwmon1 is coretemp
   hwmon2 is nct6776
   hwmon3 is hidpp_battery_0

Found the following PWM controls:
   hwmon2/pwm1           current value: 255
   hwmon2/pwm2           current value: 228
hwmon2/pwm2 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) 
   hwmon2/pwm3           current value: 255

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon2/fan1_input     current speed: 1518 RPM
   hwmon2/fan2_input     current speed: 2235 RPM
   hwmon2/fan3_input     current speed: 0 ... skipping!
   hwmon2/fan4_input     current speed: 1573 RPM
   hwmon2/fan5_input     current speed: 1506 RPM


PWM125524022521019518016515013512010590756045302826242220181614121086420
fan1_input151814511404135513191248118611271062994936895895877876877891878895895881882895898898882884885902903903

PWM3与fan5转速对照表

PWM325524022521019518016515013512010590756045
fan5_input15051562150015051434131112441168113110409148477166210

3.3 风扇控制策略

风扇主板接口温控位置传感器ID策略
CPUCPU_FAN1hwmon2/pwm2主板自动控制
硬盘阵列CHA_FAN1hwmon2/pwm1hwmon0/temp1_inputnvme固态稳定
电源&硬盘仓CHA_FAN2hwmon2/pwm3hwmon1/temp1_inputCPU温度控制
机箱上部&硬盘阵列PWR_FAN1电源风扇无法控制

3.4 fancontrol配置参数

参数名意义
FCTEMPSThe temperature input device to read for CPU temperature. The above example corresponds to /sys/class/hwmon/hwmon0/device/temp1_input.
FCFANSThe current fan speed, which can be read (like the temperature) in /sys/class/hwmon/hwmon0/device/fan1_input
MINTEMP风扇启动温度,低于该温度关闭风扇
MAXTEMP最大风速温度,对于CPU要求低于最大容忍温度10~20度
MINSTOP风扇停转时候的PWM值,通常在0~255
MINSTART风扇启动PWM,一般高于MINSTOP,因为启动电流要求更高
grass@grassLinux:~$ cat /etc/fancontrol 
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon0=devices/pci0000:00/0000:00:1c.0/0000:01:00.0/nvme/nvme0 hwmon1=devices/platform/coretemp.0 hwmon2=devices/platform/nct6775.656
DEVNAME=hwmon0=nvme hwmon1=coretemp hwmon2=nct6776
FCTEMPS=hwmon2/pwm1=hwmon0/temp1_input hwmon2/pwm3=hwmon1/temp1_input
FCFANS=hwmon2/pwm1=hwmon2/fan1_input hwmon2/pwm3=hwmon2/fan5_input
MINTEMP=hwmon2/pwm1=32 hwmon2/pwm3=35
MAXTEMP=hwmon2/pwm1=50 hwmon2/pwm3=55
MINSTART=hwmon2/pwm1=150 hwmon2/pwm3=60
MINSTOP=hwmon2/pwm1=0 hwmon2/pwm3=45
MAXPWM=hwmon2/pwm1=255 hwmon2/pwm3=240
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值