Cannot configure Fan Speed with pwmconfig

6,843

Start out by man fancontrol to get a feel for what variables can be used in /etc/fancontrol. You will need the following when building the config: INTERVAL, FCTEMPS, FCFANS, MINTEMP, MAXTEMP, MINSTART, MINSTOP.

# Checks the temperature every 10 seconds.
INTERVAL=10
# Maps a fan to a temp sensor, each separated by a space 
FCTEMPS=fanpath=temppath fanpath2=temppath2
# Maps a fan to the fan speed sensor
FCFANS=fanpath=fanspeedpath fanpath2=fanspeedpath2
# The temperature below which the fan gets switched to minimum speed.
MINTEMP=fanpath=degreesC fanpath2=degreesC2
# The temperature over which the fan gets switched to maximum speed.
MAXTEMP=fanpath=degreesC fanpath2=degreesC2
# Sets the minimum speed at which the fan begins spinning.
MINSTART=fanpath=minspeed fanpath2=minspeed2
#The minimum speed at which the fan still spins.
MINSTOP=fanpath=minspeed fanpath2=minspeed2

Actual Sample:

INTERVAL=10
FCTEMPS=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm5=/sys/devices/platform/coretemp.0/hwmon/hwmon[[:print:]]*/temp3_input /sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm4=/sys/devices/platform/coretemp.0/hwmon/hwmon[[:print:]]*/temp3_input /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/pwm1=/sys/devices/platform/coretemp.0/hwmon/hwmon[[:print:]]*/temp3_input
FCFANS=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm5=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/fan5_input /sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm4=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/fan4_input /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/pwm1=
MINTEMP=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm5=55 /sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm4=50 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/pwm1=55
MAXTEMP=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm5=60 /sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm4=60 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/pwm1=60
MINSTART=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm5=70 /sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm4=70 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/pwm1=70
MINSTOP=/sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm5=90 /sys/devices/platform/nct6775.656/hwmon/hwmon[[:print:]]*/pwm4=90 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon[[:print:]]*/pwm1=90

The [[:print:]] represent the hwmon number. You can use the actual number or the [[:print:]], sometimes the number changes between boots and the [[:print:]] allows it to find the correct hwmon number.

The issue will be FCFANS, whether fan1_input has valid data, and if not, whether fancontrol will continue to work without that.

Alternatively, you could attempt to write your own script that would set the value of hwmon2/pwm1, it ranges between 0 and 255.

Share:
6,843
João Bravo
Author by

João Bravo

Hi!

Updated on September 18, 2022

Comments

  • João Bravo
    João Bravo over 1 year

    I have a ASUS TP301UJ laptop with dual-boot and my fan is quite loud all the time. I am trying to configure my fan speed in Ubuntu (I did it easily in Windows 10), but I am having problems.

    Here is what I did:

    1. I installed lm-sensors, psensor and fancontrol. psensor worked well, and read the fan speed and all temperatures.

    2. Ran sudo sensors-detect which only said that I needed to add coretemp to /etc/modules. coretemp was already in modules so I did not do anything.

    3. Rebooted. Ran sudo pwmconfig and it output:

      Found the following devices:
      hwmon0 is acpitz
      hwmon1 is coretemp
      hwmon2 is asus

      Found the following PWM controls:
      hwmon2/pwm1 current value: 0

      hwmon2/pwm1 is currently setup for automatic speed control.
      In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n)

    4. Entered "y" and the output was:

      Giving the fans some time to reach full speed...

      Found the following fan sensors:
      hwmon2/fan1_input current speed: 0 ... skipping!
      There are no working fan sensors, all readings are 0.

      Make sure you have a 3-wire fan connected.
      You may also need to increase the fan divisors.
      See doc/fan-divisors for more information.

    So my fan enters "manual mode" and starts running at full speed but pwmconfig exits, leaving my fan running at full speed. Changing the number in /sys/class/hwmon/hwmon2/pwm1_enable from 1 back to 2, makes it automatic again.

    Here is my problem (I think): When my fan is in "manual mode", sensors shows -1 as its speed. It is not detected! But in automatic mode, there is no problem at all. This makes it impossible for me to configure the fan with pwmconfig.

    I have already tried adding acpi_enforce_resources=lax to the variable GRUB_CMDLINE_LINUX_DEFAULT in the grub file. The result is the same.

    What should I do?

    • Nmath
      Nmath over 4 years
      can you not change the fan speeds in the motherboard BIOS settings? this would be greatly preferred to software IMO
    • João Bravo
      João Bravo over 4 years
      @Nmath I do not think I can change the fan speeds in my BIOS. At least, as it is, there is no option for such.
    • rtaft
      rtaft over 4 years
      Just to be clear, hwmon2/pwm1 is controlling your fan but pwm-config cannot detect the fan speed? What else is listed under /sys/class/hwmon/hwmon2/?
    • João Bravo
      João Bravo over 4 years
      @Nmath Yes, I have BIOS v303 since 04/2019
    • rtaft
      rtaft over 4 years
      @JoãoBravo if you can control the fan but not detect its speed, I believe you can configure fancontrol manually.
    • João Bravo
      João Bravo over 4 years
      @rtaft Yes, hwmon2/pwm1 controls my fan but the output, even in psensor, is -1 if the control of the fan is set to manual. Under /sys/class/hwmon/hwmon2/, there is: power/, fan1_input, name, pwm1_enable, temp1_input, device@, fan1_label, pwm1, subsystem@, uevent
    • João Bravo
      João Bravo over 4 years
      @rtaft Oh, do you know how to configure fancontrol manually?
  • João Bravo
    João Bravo over 4 years
    Thanks, that worked for automating the fan! My CPU temperature sensor jumps all over the place though... With INTERVAL=3, the readings jump from 55ºC to 65ºC to 75ºC, so it kind of sucks hearing the fan change every 3 seconds... Do you think these readings may be accurate at all? Should I just change INTERVAL to 10 or 15 or can I actually fix the readings?
  • João Bravo
    João Bravo over 4 years
    I do not really understand what is MINSTART and MINSTOP. How are they really used?
  • rtaft
    rtaft over 4 years
    @JoãoBravo Think static friction, the minimum start power is the power needed to get the fan moving from a dead stop. The minimum stop power is how low does the power need to go before the fan stops (kinetic friction).
  • rtaft
    rtaft over 4 years
    @JoãoBravo The jumpy temperatures are normal, because the CPU can generate heat pretty quickly and the thermometer is in each core, faster than the fan at low speeds can transfer the heat out. Even with liquid cooling, my cooler temp is at 30C but I can have my CPU over 60C by maxing the CPU and it kicks the fans on which doesn't affect the CPU temp. The fans don't really help much until the liquid gets warmer.
  • João Bravo
    João Bravo over 4 years
    Yup, that makes sense. So, should I test the fan manually and input the values I get, or does it make sense to set the values to my liking (taking the test into account)? For example, my fan starts spinning at 50 but I can barely hear it, it’s really slow and won’t do much. Does it make sense to set it to, say, 90 so the cooling is faster?
  • rtaft
    rtaft over 4 years
    The pwmconfig basically does that check for you, so unless you can see the fan spinning, it's hard to know what to use for exact values. Just monitor your temps at different speeds and make sure it can keep the temp reasonable. You can have the fun running slightly faster for its min value, that might help reduce the number of times it increases to a higher speed.
  • João Bravo
    João Bravo over 4 years
    That's what I thought. Thank you for the help!
  • rtaft
    rtaft over 3 years
    You could just go to the bios to configure it, much easier than setting these values manually from the command line. These would often reset on me back to the default config, which is why I use fancontrol with pwm.