You are not logged in.

#1 2020-01-26 14:32:36

4tmelDriver
Member
Registered: 2019-12-15
Posts: 8

Fan control issues

Hello,

I am trying to get fan control running (https://wiki.archlinux.org/index.php/Fa … m-sensors))

By typing these commands related to the asus-nb-wmi kernel module I get several errors:

# echo 255 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1           # Full fan speed (Value: 255)
# echo 0 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1             # Fan is stopped (Value: 0)
# echo 2 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[[:print:]]*/pwm1_enable     # Change fan mode to automatic
# echo 1 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1_enable      # Change fan mode to manual

First of all, I do not have a file called 'pwm1', that I can write to. So the first two commands do not work.
The third command in the wiki does work, but it does not change a lot because '2' is the default value. When I try to echo '1' into that file, it tells me that this is not a valid argument.

So I don't know why this is happening or how to proceed.

The contents of the folder are the following:

[ZenDriver hwmon4]# ls -la
insgesamt 0
drwxr-xr-x 3 root root    0 26. Jan 15:01 .
drwxr-xr-x 3 root root    0 26. Jan 15:01 ..
lrwxrwxrwx 1 root root    0 26. Jan 15:01 device -> ../../../asus-nb-wmi
-r--r--r-- 1 root root 4096 26. Jan 15:01 fan1_input
-r--r--r-- 1 root root 4096 26. Jan 15:01 fan1_label
-r--r--r-- 1 root root 4096 26. Jan 15:01 name
drwxr-xr-x 2 root root    0 26. Jan 15:17 power
-rw-r--r-- 1 root root 4096 26. Jan 15:22 pwm1_enable
lrwxrwxrwx 1 root root    0 26. Jan 15:01 subsystem -> ../../../../../class/hwmon
-rw-r--r-- 1 root root 4096 26. Jan 15:01 uevent

I have a Asus Zenbook UX331UN.

Thanks for the help.

Last edited by 4tmelDriver (2020-01-26 14:34:40)

Offline

#2 2020-01-26 14:36:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,233

Re: Fan control issues

Post exact commands and exact outputs instead or in addition to your interpretations of them.

Last edited by V1del (2020-01-26 14:37:26)

Online

#3 2020-01-26 14:52:49

4tmelDriver
Member
Registered: 2019-12-15
Posts: 8

Re: Fan control issues

[ZenDriver ~]# echo 255 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1           # Full fan spe
-bash: /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1: Datei oder Verzeichnis nicht gefunden
[ZenDriver ~]# echo 0 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1             # Fan is stopped (Value: 0)
-bash: /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1: Datei oder Verzeichnis nicht gefunden
[ZenDriver ~]# echo 2 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[[:print:]]*/pwm1_enable     # Change fan mode to automatic
[ZenDriver ~]# echo 1 > /sys/devices/platform/asus-nb-wmi/hwmon/hwmon[[:print:]]*/pwm1_enable      # Change fan mode to manual
-bash: echo: Schreibfehler: Das Argument ist ungültig.

Offline

#4 2020-01-26 15:00:41

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Fan control issues

What is that "[[:print:]]" part of your command lines? I don't understand it. This isn't part of a real filename, right?

About those "pwm1_enable" and "pwm1" files, things will not work if you don't have both. The "pwm1_enable" file is to switch the controller between different modes it can have. What exactly the numbers do depends on the chip, it can be very different. After you've switched the controller to a fixed speed mode, the "pwm1" file is then to set a different speed. If you don't have both of the file types, then I'd think there's nothing to control for you.

For laptops, there's a software named "notebook fan control" here: https://github.com/hirschmann/nbfc

Maybe see if that one can do something for you. If I look into the "Configs" folder on that github page, there's a whole bunch of configs there for ASUS laptops. You can find this "notebook fan control" software in the AUR if you search for "nbfc".

Last edited by Ropid (2020-01-26 15:01:21)

Offline

#5 2020-01-26 17:25:36

4tmelDriver
Member
Registered: 2019-12-15
Posts: 8

Re: Fan control issues

The commands are from the wiki. I don't understand that "[[:print:]]" either, but it seems to work, because the third command did work.

I have tried nbfc before, and it is able to control the speed of the fan. But when set to 0, the fan does not stop (I can hear it, although the current fan speed is outputting 0 in nbfc). When I execute the 'sensors' command, I can see that the fan speed is set to 3500rpm and with nbfc I can't turn it off, thats why I was about to switch to fan control.

Offline

#6 2020-01-26 17:35:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,233

Re: Fan control issues

If it doesn't work with neither, it could simply be that this is hard blocked within firmware. Which isn't surprising, most laptops don't allow you to override the BIOS set defaults for the fan.

Online

#7 2020-01-27 14:25:19

4tmelDriver
Member
Registered: 2019-12-15
Posts: 8

Re: Fan control issues

I eventually figured out, that the recommended config for nbfc reads and writes to ec register 0x97. Using this config I am able to set the speed of the fan to eg 100 or a low value, but 0 does not work.
I used the ec probe tool to monitor the registers for changes, when the fan gets faster or slower.
Register 0x98 seemed to have a correlation to the fan and indeed by changing the config to register 0x98, I was able to completly stop (and control) the fan as I wanted. I'm not sure, why this works or why register 0x97 did only partially work, but I will test the new config in the next few days.

Offline

#8 2020-01-29 06:40:17

Wild Penguin
Member
Registered: 2015-03-19
Posts: 399

Re: Fan control issues

About the [[:print:]]: it's explained in the Wiki. It is there because the order / names of hwmon/hwmon? might change. [[:print:]] expands to printable character by bash, unless I'm mistaken (haven't used that construct often; why not just use ?). See POSIX character classes.

However, doing it that way is still prone to error, as there may be several drivers which include fan control (pwmX + pwmX_enable). IMHO the scripts should parse hwmon/hwmon?/name - much more reliable, although there is even then there is the possibility there are two drivers with the same name.

Also, you need the exact driver for your H/W monitoring chip, but even if the driver exists, these days there indeed are a lot of blocks with ACPI and / or BIOS blocking the access to them. There are other (some proprietary?) ways to control the fans, but often there is no driver to control the fans via hwmon entries. For example my macbook fan can be controlled by S/W, however I'm not sure *how* the software actually does it.

Offline

Board footer

Powered by FluxBB