Possible to control case fan?

Is it possible to control case fan pwm? I want to add 3 6200RPM to the rig but would like to control the rpm speed. Is it possible in HiveOS or would I need to get a third party physical tool to control it?

The fan
pwm controller

1 Like

Did that today.

First you have to make sure your fans show up in “sensors”

Execute sensors

nct6798-isa-0290
Adapter: ISA adapter
in0:                       +0.61 V  (min =  +0.00 V, max =  +1.74 V)
. 
.
.
fan1:                     1640 RPM  (min =    0 RPM)
fan2:                      894 RPM  (min =    0 RPM)
fan3:                     1630 RPM  (min =    0 RPM)
fan4:                        0 RPM  (min =    0 RPM)
fan5:                        0 RPM  (min =    0 RPM)
fan6:                        0 RPM  (min =    0 RPM)
fan7:                        0 RPM  (min =    0 RPM)

My chassi fans are fan1 and fan3.

If you can’t see the fan states in sensors you have to detect them first and load a kernel module that fits to your chip. The following command can damage your system! The chance is low but it can happen. Be careful and abort with CTRL+C after seeing the following output.

Execute sensors-detect and follow the instructions until you see this:

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): 
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
Found unknown chip with ID 0xd42b
    (logical device B has address 0x290, could be sensors)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No

In my case a Super I/O chip of the type VIA/Winbond/Nuvoton/Fintek found.
But sensors-detect fails with “unknown chip with ID 0xd42b”

Google your chip id and there is a good chance to find what kernel module you have to load.
In my case it was nct6775.

Execute modprobe nct6775 to load the kernel module
Add the line nct6775 to the file /etc/modules-load.d/modules.conf

Make sure the instruction acpi_enforce_resources=lax is set in your grub configuration (/etc/default/grub). Otherwise add it to GRUB_CMDLINE_LINUX:

GRUB_CMDLINE_LINUX=‘acpi_enforce_resources=lax’

Afterwards execute grub-config

Restart your system.

Hopefully your fans now show up in sensors. If so you can control your fans by setting the PWM type to manual and setting a PWM value from 0-255. Be aware of that the fans stop around under 100 depending on your fan.

I have a script to set my fans to 50% on startup

echo 1 > /sys/class/hwmon/hwmon2/pwm1_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm3_enable
echo 125 > /sys/class/hwmon/hwmon2/pwm1
echo 125 > /sys/class/hwmon/hwmon2/pwm3

Good Luck!

2 Likes

Hi G11,

Thank you for awesome guide!
I would like to add one note for grub config update, it should be update-grub not grub-config :wink:
Have you changed BIOS setup anyhow regarding M/B (chasis) fan control? What is your chasis fan mode?
I couldn’t control M/B (chasis) fan even when enabled pwm (/sys/class/hwmon/hwmon1/pwm1_enable in my case):

root@xxx:~# echo 1 > /sys/class/hwmon/hwmon1/pwm1_enable
root@xxx:~# cat /sys/class/hwmon/hwmon1/pwm1_enable
0

chek my detected sensors readings (chasis fan is red marked):

Thanks once more.

1 Like

Hi there,

update-grub is better. Unfortunately I can not edit my post?

No. BIOS Settings are pretty default. Did only couple of changes for mining.

I just checked the content of my pwm1_enable and it is 1 …
Not sure what is preventing your setting but you are right - imo - can only be a setting in the BIOS.

Sensor readings look good. Mine are similar…

Thanks for reply.
There is mode for chasis fan in BIOS: custom/silent/standard/performance/full.
What is your settings for that?
I have tried custom and standard.
There are 2 fans for chasis. What is the one you are using for PWM control?

I use Nr.1. This could be the clue, as your hw mon is labeled 2 (hwmon2) and mine is 1 (hwmon1)

I am on the Asus TUF H470-PRO Board which has a lot of connections for fans.
Ah and according to my manual some of them are not PWM controllable. Maybe thats the problem?


Can anyone help me on the modprobe step?

Thank you for this guide. I am a complete noob to Linux and I am wondering if you could give a little bit more guidance. I managed to get to the modprobe nct6775 part, but I am not sure how to edit the modules.conf file.

I tried to install gedit, but there were some error messages at the download stage (Failed to fetch [URL])

How exactly do I add the line nct6775 and how do I add the acpi_enforce_resources=lax?

1 Like

i can’t send “sensors” command,

i got this error

bash: line 2: sensors: command not found

what i’m doing wrong?

2 Likes

try installing lm-sensors

apt install lm-sensors

This topic was automatically closed 416 days after the last reply. New replies are no longer allowed.