Skip to content

Instantly share code, notes, and snippets.

@d-rk
Last active June 20, 2022 20:13
Show Gist options
  • Save d-rk/5e61a457eaafbd932000227f60223c80 to your computer and use it in GitHub Desktop.
Save d-rk/5e61a457eaafbd932000227f60223c80 to your computer and use it in GitHub Desktop.
Helios64 - Fix fan speed regulation (fancontrol)

Links

Problem

fancontrol does not control fan speed:

systemctl status fancontrol.service 
● fancontrol.service - fan speed regulator
     Loaded: loaded (/lib/systemd/system/fancontrol.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/fancontrol.service.d
             └─pid.conf
     Active: failed (Result: exit-code) since Mon 2022-06-20 21:46:11 CEST; 3s ago
       Docs: man:fancontrol(8)
             man:pwmconfig(8)
    Process: 18286 ExecStartPre=/usr/sbin/fancontrol --check (code=exited, status=0/SUCCESS)
    Process: 18419 ExecStart=/usr/sbin/fancontrol (code=exited, status=1/FAILURE)
   Main PID: 18419 (code=exited, status=1/FAILURE)

fancontrol[18419]: Error: file /dev/thermal-cpu/temp1_input doesn't exist

/dev/thermal-cpu/temp1_input should be created via udev rule

Solution

The problem is the following line in /etc/udev/rules.d/90-helios64-hwmon.rules:

ATTR{type}=="soc-thermal", ENV{HWMON_PATH}="/sys%p/temp", ENV{HELIOS64_SYMLINK}="/dev/thermal-cpu/temp1_input", RUN+="/usr/bin/mkdir /dev/thermal-cpu/"

The type soc-thermal is not matched:

# get the actual type
$ find /sys/ -name type | grep thermal_zone0 | xargs -I % cat %
cpu-thermal

So, we have to change the type from soc-thermal to cpu-thermal.

Afterwards run:

# reload udev devices
udevadm control --reload-rules && udevadm trigger

# restart fancontrol
systemctl restart fancontrol.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment