zocker-160 / thinkfan-ui

A small gui app for Linux to control the fan speed and monitor temps on a ThinkPad
GNU General Public License v3.0
88 stars 8 forks source link

tpfan-ui crashes if i try to do anything #8

Closed gnhartch closed 1 year ago

gnhartch commented 1 year ago

downloaded the dot deb file and installed everything fine, just keep getting this errror

buttx@mukitown:~$ sudo thinkfan-ui
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
set speed: 5
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/thinkfan-ui/fan.py", line 180, in <lambda>
    self.button_set.clicked.connect(lambda: app.setFanSpeed(self.slider.value()))
  File "/usr/lib/thinkfan-ui/fan.py", line 159, in setFanSpeed
    soc.write(f"level {speed}")
OSError: [Errno 22] Invalid argument
/usr/bin/thinkfan-ui: line 3:  5175 Aborted                 python3 /usr/lib/thinkfan-ui/fan.py
zocker-160 commented 1 year ago

This looks exactly like the problem described in #3 and #7.

I sadly have no idea what is causing this given that the launch script is perfectly valid bash syntax.

bootyberry commented 1 year ago

I ran into this problem, and it turns out you need to enable fan control on the thinkpad_acpi kernel module and reboot. echo 'options thinkpad_acpi fan_control=1' | sudo tee -a /etc/modprobe.d/thinkpad_acpi.conf

The actual error is it's failing to write to /proc/acpi/ibm/fan because fan control is disabled by default (with current kernels?)

File "/usr/lib/thinkfan-ui/fan.py", line 159, in setFanSpeed soc.write(f"level {speed}") OSError: [Errno 22] Invalid argument

zocker-160 commented 1 year ago

This issue should be fixed with the latest version. The problem is that both the DEB and the AUR package don't initialize the thinkpad_acpi kernel module correctly.