KostyaEsmukov / afancontrol

Advanced Fan Control program, which controls PWM fans according to the current temperatures of the system components.
https://afancontrol.readthedocs.io/
MIT License
55 stars 3 forks source link

afancontrol.service error #2

Closed hammy283 closed 4 years ago

hammy283 commented 4 years ago

Hi, I have been having trouble with afancontrol. My laptop fan speed doesn't change with the load of the cpu. The fan is still spinning at 2493 RPM, but no speed increase. I also used afancontrol fantest, to use to help with the config. I also checked the service status of afancontrol and this is what the output was:

hammy@hammy-dell ~> systemctl status afancontrol.service ● afancontrol.service - Advanced Fan Control program Loaded: loaded (/usr/lib/systemd/system/afancontrol.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2020-05-23 00:19:20 PDT; 6h left Process: 907 ExecStartPre=/usr/bin/afancontrol daemon --test (code=exited, status=0/SUCCESS) Main PID: 1204 (afancontrol) Tasks: 1 (limit: 9419) Memory: 29.6M CGroup: /system.slice/afancontrol.service └─1204 /usr/bin/python /usr/bin/afancontrol daemon --pidfile /var/run/afancontrol.pid

May 23 00:19:26 hammy-dell afancontrol[1204]: Traceback (most recent call last): May 23 00:19:26 hammy-dell afancontrol[1204]: File "/usr/lib/python3.8/site-packages/afancontrol/report.py", line 15, in report May 23 00:19:26 hammy-dell afancontrol[1204]: exec_shell_command(rc) May 23 00:19:26 hammy-dell afancontrol[1204]: File "/usr/lib/python3.8/site-packages/afancontrol/exec.py", line 8, in exec_shell_command May 23 00:19:26 hammy-dell afancontrol[1204]: p = subprocess.run( May 23 00:19:26 hammy-dell afancontrol[1204]: File "/usr/lib/python3.8/subprocess.py", line 512, in run May 23 00:19:26 hammy-dell afancontrol[1204]: raise CalledProcessError(retcode, process.args, May 23 00:19:26 hammy-dell afancontrol[1204]: subprocess.CalledProcessError: Command 'printf "Subject: %s May 23 00:19:26 hammy-dell afancontrol[1204]: To: %s May 23 00:19:26 hammy-dell afancontrol[1204]: %b" "afancontrol daemon report: fan started: hdd" root "Fan 'hdd' which had previously been reported as failing has just started." | sendmail -t' returned non-zero exit status 127.

Attached is my afancontrol config. System: Dell Latitude E5430 Manjaro Cinnamon Linux 5.6.12-1-Manjaro 1 Cpu fan

I am not sure what to do to resolve this issue. Thanks. afancontrol_conf.txt

KostyaEsmukov commented 4 years ago

The CalledProcessError is probably due to missing sendmail, which is specified in the default report_cmd. Try to change this in your config, it should fix the error:

[actions]
report_cmd = printf "Reason: %s\nMessage: %s" "%REASON%" "%MESSAGE%" | wall

However, afancontrol fantest doesn't use report_cmd, so if it doesn't work with your fan, it probably means that pwm file for that fan doesn't affect its speed on your system (assuming that the file is correct).

Also I wouldn't recommend controlling a CPU fan with afancontrol. Most of the BIOSes (especially laptops) already contain a good enough fan speed control mechanism enabled by default, which is much faster to react to the CPU temperature changes than anything running in userspace. That might be the reason why the fan cannot be controlled in your case.

afancontrol is suited for use with case fans, which affect multiple system components and are not that critical as the fans located right at the radiators.