vmatare / thinkfan

The minimalist fan control program
GNU General Public License v3.0
534 stars 61 forks source link

Allow /sys/devices/platform/thinkpad_hwmon/hwmon/*/temp2_input #231

Open Bryantdl7 opened 1 year ago

Bryantdl7 commented 1 year ago

My thinkpad t495 likes to swap between

/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon5/temp2_input

and

/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon6/temp2_input

as it feels like it, when this happens thinkfan decided to unalive and I have no fan control.

I tried making it /sys/devices/platform/thinkpad_hwmon/hwmon/*/temp2_input but that just errors out, can we get this as a feature in the future?

Bryantdl7 commented 1 year ago

Here's my work around for the time being for other poor souls on a Thinkpad T495:

/etc/thinkfan.conf

hwmon /dev/hacked-cpu-temperature/temp6_input
hwmon /dev/hacked-cpu-temperature/temp3_input
hwmon /dev/hacked-cpu-temperature/temp7_input
hwmon /dev/hacked-cpu-temperature/temp4_input
hwmon /dev/hacked-cpu-temperature/temp1_input
hwmon /dev/hacked-cpu-temperature/temp5_input
hwmon /dev/hacked-cpu-temperature/temp2_input

(0,     0,      5)
(1,     5,      47)
(2,     47,     60)
(3,     60,     62)
(4,     62,     65)
(5,     65,     67)
(6,     67,     72)
(7,     72,     77)
(127,   77,     32767)

/home/hwmon-fix.sh

#!/bin/bash
temp1=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp1_input")
temp2=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp2_input")
temp3=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp3_input")
temp4=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp4_input")
temp5=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp5_input")
temp6=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp6_input")
temp7=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp7_input")
temp8=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp8_input")
temp9=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp9_input")
#temp1=$(find /sys/devices/platform/thinkpad_hwmon/ -type f -name "temp1_input")
mkdir /dev/hacked-cpu-temperature/

ln -s $temp1 /dev/hacked-cpu-temperature/
ln -s $temp2 /dev/hacked-cpu-temperature/
ln -s $temp3 /dev/hacked-cpu-temperature/
ln -s $temp4 /dev/hacked-cpu-temperature/
ln -s $temp5 /dev/hacked-cpu-temperature/
ln -s $temp6 /dev/hacked-cpu-temperature/
ln -s $temp7 /dev/hacked-cpu-temperature/
ln -s $temp8 /dev/hacked-cpu-temperature/
ln -s $temp9 /dev/hacked-cpu-temperature/
systemctl restart thinkfan

sudo crontab -e

@reboot sleep 1; /home/hwmon_fix.sh