You are not logged in.
Guys im using arch and my laptop is ASUS N550JV cn240h i tried everything on the wiki. I want my fans to work in full speed everytime but after shutting down and powering it back it just goes to stock settings cuz it doesn't start my config but if i reboot my computer nothing happens to fans.I followed 1 for making fans work properly, 2 for configuring them, 3 for making them start on every boot but it doesn't work even tho i can't manually make it working i need to run pwmconfig everytime but not need to complete it just typing sudo pwmconfig after that giving time to reach them to max speed when they reach that point i don't need to do anything else just pressing ctrl+c and quitting from that part i got my config working. I also 4 tried this and it didn't worked too. I used this and i hoped really hard 5 on this because this is specialized for my model but this didn't worked too. My install process is here. And my Hardware probe is here. My settings are
Common settings:
INTERVAL=10
Settings for hwmon3/pwm1:
Depends on hwmon0/temp1_input
Controls hwmon3/fan1_input
MINTEMP=20
MAXTEMP=50
MINSTART=150
MINSTOP=0
MINPWM=0
MAXPWM=255
AVERAGE=1
Last edited by Welt (2020-09-04 18:20:59)
Offline
Thanks for the information, this is much improved from the previous post.
When you boot and it is not working properly, please post the ouput of `systemctl status fancontrol`. And try `systemctl restart fancontrol` and report on whether that helps.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks for the information, this is much improved from the previous post.
When you boot and it is not working properly, please post the ouput of `systemctl status fancontrol`. And try `systemctl restart fancontrol` and report on whether that helps.
My status of fancontrol
* fancontrol.service - Start fan control, if configured
Loaded: loaded (/usr/lib/systemd/system/fancontrol.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-09-04 16:41:43 +03; 3h 50min ago
Process: 384 ExecStart=/usr/sbin/fancontrol (code=exited, status=1/FAILURE)
Main PID: 384 (code=exited, status=1/FAILURE)
Sep 04 16:41:43 aras fancontrol[384]: MINSTART=150
Sep 04 16:41:43 aras fancontrol[384]: MINSTOP=0
Sep 04 16:41:43 aras fancontrol[384]: MINPWM=0
Sep 04 16:41:43 aras fancontrol[384]: MAXPWM=255
Sep 04 16:41:43 aras fancontrol[384]: AVERAGE=1
Sep 04 16:41:43 aras fancontrol[384]: Device path of hwmon3 has changed
Sep 04 16:41:43 aras fancontrol[384]: Device name of hwmon3 has changed
Sep 04 16:41:43 aras fancontrol[384]: Configuration appears to be outdated, please run pwmconfig again
Sep 04 16:41:43 aras systemd[1]: fancontrol.service: Main process exited, code=exited, status=1/FAILURE
Sep 04 16:41:43 aras systemd[1]: fancontrol.service: Failed with result 'exit-code'.
And restarting fancontrol didn't worked out. I see hwmon3 path changed and tried on it. Every time i shutdown and turning it back on it's path changes. So that's why i need to run pwm config everytime.
Last edited by Welt (2020-09-04 17:35:49)
Offline
I have no experience with fancontrol, but it looks like you just need to add the pwmconfig command to the service file so it runs before fancontrol. You may want to also check whether lm_sensors service would be sufficient: on boot, try `systemctl restart lm_sensors.service` and see if that helps.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Welt: have you read this:
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Offline
@Welt: have you read this:
Yeah forgot to mention i will try Trilby's tactic.
Edit=Trilby's tactic didn't worked.
Last edited by Welt (2020-09-05 08:10:56)
Offline
Hi Welt,
It would be more helpful if you tell what you actually did (post your new configuration files here) and how does it fail.
Anyways, for everyone not familiar with the problem (or perhaps coming to this thread by search) I will try to explain what is going on.
The issue: lm-sensors fancontrol script was originally written with the mindset, that the paths in /sys/class/hwmon# do not change. I.e. # is a number (0...N) and will be the same number on every boot for a given device. This was true back in the days when there was 1 or maybe max 2(3) ISA devices, and Kernel always initialized them in the same order, or, more likely, not initialize them at all unless the modules needed were loaded as configured by the user - hence, the order is usually determined (vs. loading them automatically). This meant, that software could be written so that it relies on these numbers (despite it might not have been a correct way to do it in the first place).
But with a bit more modern H/W (well, anything <15 years old) and newer software under the fancontrol layer, this order can not be relied on at all anymore. There are two alternatives linked my merlock: 1) make sure the modules populating /sys/class/hwmon are loaded in the same order in every boot or 2) do not rely on them being in the same order in the first place, but to something else. 1) does not work always, since some of the sensor directories != populated by a single module (and detectable by sensors-detect). For option 2) they (who wrote the wiki page) decided to read the link in /sys/class/hwmon/hwmon#/device, and write rules accordingly in the configuration file.
IIRC I've seen a bug report about this somewhere; IMHO the right approach would be to update fan-control so that it parses the names in /sys/class/hwmon/hwmon?/name. I'm not even sure that would work in all cases, as there might be cases where there are several devices with the same name, but for most setups there probably aren't. For vast majority of current setups the current scripts are not really working in the intended way (i.e., it is broken).
Example in my situation:
$ readlink -f /sys/class/hwmon/hwmon?/device
/sys/devices/virtual/thermal/thermal_zone0
/sys/devices/pci0000:00/0000:00:1c.2/0000:05:00.0
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:00.0/0000:03:00.0
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-10/2-10:1.1/0003:046D:C087.0008/power_supply/hidpp_battery_0
/sys/devices/platform/coretemp.0
/sys/devices/platform/nct6775.656
So, there are 6 different sensor devices! Only two of them are traditional modules (and, IIRC they get loaded automatically even without lm-sensors service started!). Rest three are loaded automatically, and there is even one USB device (wireless mouse). There is no way the order of these could be relied on.
Some more information about my sensor devices:
$ ls -l /sys/class/hwmon/hwmon?
lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0
lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon1 -> ../../devices/pci0000:00/0000:00:1c.2/0000:05:00.0/hwmon/hwmon1
lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/hwmon/hwmon2
lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon3 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-10/2-10:1.1/0003:046D:C087.0008/power_supply/hidpp_battery_0/hwmon3
lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon4 -> ../../devices/platform/coretemp.0/hwmon/hwmon4
lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon5 -> ../../devices/platform/nct6775.656/hwmon/hwmon5
and:
$ cat /sys/class/hwmon/hwmon?/name
acpitz
nvme
amdgpu
hidpp_battery_0
coretemp
nct6791
(personally, I don't use the fancontrol service; it can not do hysteresis among other things I find useful, so I've written my own script and a little bit of stupid C code; FWIW my script parses the hwmon?/name entries instead)
For OP: I believe the easiest way to make fan control working is the following: re-run sensors detect one more time (this is to make sure we don't make a mistake, but not strictly necessary if you can determine which paths to but in the configuration file). Before rebooting, you need to put the right paths in the form you get from readlink to your /etc/fancontrol - but along concatenated with the right bash glob. Also, comment out the required code in the service script to prevent the error message. This is exactly like the steps in the link posted by Merlock.
I can see this can be a bit daunting. Post your /etc/fancontrol here once more after you've made the changes. Also post your 'readlink' and 'ls -l' outputs.
EDIT: A few clarifications, restructuring: moved one paragraph
Last edited by Wild Penguin (2020-09-05 10:48:02)
Offline
Hi Welt,
It would be more helpful if you tell what you actually did (post your new configuration files here) and how does it fail.
Anyways, for everyone not familiar with the problem (or perhaps coming to this thread by search) I will try to explain what is going on.
The issue: lm-sensors fancontrol script was originally written with the mindset, that the paths in /sys/class/hwmon# do not change. I.e. # is a number (0...N) and will be the same number on every boot for a given device. This was true back in the days when there was 1 or maybe max 2(3) ISA devices, and Kernel always initialized them in the same order, or, more likely, not initialize them at all unless the modules needed were loaded as configured by the user - hence, the order is usually determined (vs. loading them automatically). This meant, that software could be written so that it relies on these numbers (despite it might not have been a correct way to do it in the first place).
But with a bit more modern H/W (well, anything <15 years old) and newer software under the fancontrol layer, this order can not be relied on at all anymore. There are two alternatives linked my merlock: 1) make sure the modules populating /sys/class/hwmon are loaded in the same order in every boot or 2) do not rely on them being in the same order in the first place, but to something else. 1) does not work always, since some of the sensor directories != populated by a single module (and detectable by sensors-detect). For option 2) they (who wrote the wiki page) decided to read the link in /sys/class/hwmon/hwmon#/device, and write rules accordingly in the configuration file.
IIRC I've seen a bug report about this somewhere; IMHO the right approach would be to update fan-control so that it parses the names in /sys/class/hwmon/hwmon?/name. I'm not even sure that would work in all cases, as there might be cases where there are several devices with the same name, but for most setups there probably aren't. For vast majority of current setups the current scripts are not really working in the intended way (i.e., it is broken).
Example in my situation:
$ readlink -f /sys/class/hwmon/hwmon?/device /sys/devices/virtual/thermal/thermal_zone0 /sys/devices/pci0000:00/0000:00:1c.2/0000:05:00.0 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:00.0/0000:03:00.0 /sys/devices/pci0000:00/0000:00:14.0/usb2/2-10/2-10:1.1/0003:046D:C087.0008/power_supply/hidpp_battery_0 /sys/devices/platform/coretemp.0 /sys/devices/platform/nct6775.656
So, there are 6 different sensor devices! Only two of them are traditional modules (and, IIRC they get loaded automatically even without lm-sensors service started!). Rest three are loaded automatically, and there is even one USB device (wireless mouse). There is no way the order of these could be relied on.
Some more information about my sensor devices:
$ ls -l /sys/class/hwmon/hwmon? lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0 lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon1 -> ../../devices/pci0000:00/0000:00:1c.2/0000:05:00.0/hwmon/hwmon1 lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/hwmon/hwmon2 lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon3 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-10/2-10:1.1/0003:046D:C087.0008/power_supply/hidpp_battery_0/hwmon3 lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon4 -> ../../devices/platform/coretemp.0/hwmon/hwmon4 lrwxrwxrwx 1 root root 0 5. 9. 12:56 /sys/class/hwmon/hwmon5 -> ../../devices/platform/nct6775.656/hwmon/hwmon5
and:
$ cat /sys/class/hwmon/hwmon?/name acpitz nvme amdgpu hidpp_battery_0 coretemp nct6791
(personally, I don't use the fancontrol service; it can not do hysteresis among other things I find useful, so I've written my own script and a little bit of stupid C code; FWIW my script parses the hwmon?/name entries instead)
For OP: I believe the easiest way to make fan control working is the following: re-run sensors detect one more time (this is to make sure we don't make a mistake, but not strictly necessary if you can determine which paths to but in the configuration file). Before rebooting, you need to put the right paths in the form you get from readlink to your /etc/fancontrol - but along concatenated with the right bash glob. Also, comment out the required code in the service script to prevent the error message. This is exactly like the steps in the link posted by Merlock.
I can see this can be a bit daunting. Post your /etc/fancontrol here once more after you've made the changes. Also post your 'readlink' and 'ls -l' outputs.
EDIT: A few clarifications, restructuring: moved one paragraph
Thanks for this detailed paragraph firstly These are the info's you will need.
readlink -f /sys/class/hwmon/hwmon?/device
/sys/devices/virtual/thermal/thermal_zone0
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/ACPI0003:00/power_supply/AC0
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/PNP0C0A:00/power_supply/BAT0
/sys/devices/platform/asus-nb-wmi
/sys/devices/platform/coretemp.0
ls -l /sys/class/hwmon/hwmon?
lrwxrwxrwx 1 root root 0 Sep 5 15:15 /sys/class/hwmon/hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0/
lrwxrwxrwx 1 root root 0 Sep 5 15:15 /sys/class/hwmon/hwmon1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/ACPI0003:00/power_supply/AC0/hwmon1/
lrwxrwxrwx 1 root root 0 Sep 5 15:15 /sys/class/hwmon/hwmon2 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/PNP0C0A:00/power_supply/BAT0/hwmon2/
lrwxrwxrwx 1 root root 0 Sep 5 15:15 /sys/class/hwmon/hwmon3 -> ../../devices/platform/asus-nb-wmi/hwmon/hwmon3/
lrwxrwxrwx 1 root root 0 Sep 5 16:50 /sys/class/hwmon/hwmon4 -> ../../devices/platform/coretemp.0/hwmon/hwmon4/
cat /sys/class/hwmon/hwmon?/name
acpitz
AC0
BAT0
asus
coretemp
sudo pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.
We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.
Found the following devices:
hwmon0 is acpitz
hwmon1 is AC0
hwmon2 is BAT0
hwmon3 is asus
hwmon4 is coretemp
Found the following PWM controls:
hwmon3/pwm1 current value: 255
Giving the fans some time to reach full speed...
Found the following fan sensors:
cat: hwmon3/fan1_input: No such device or address
hwmon3/fan1_input current speed: RPM
Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue:
Testing pwm control hwmon3/pwm1 ...
cat: hwmon3/fan1_input: No such device or address
hwmon3/fan1_input ... speed was now
/usr/bin/pwmconfig: line 455: let: threshold=3*/4: syntax error: operand expected (error token is "/4")
It appears that fan hwmon3/fan1_input
is controlled by pwm hwmon3/pwm1
cat: hwmon3/fan1_input: No such device or address
Fan hwmon3/fan1_input has not returned to speed, please investigate!
Testing is complete.
Please verify that all fans have returned to their normal speed.
The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)? y
What should be the path to your fancontrol config file (/etc/fancontrol)? /etc/fancontrol
Loading configuration from /etc/fancontrol ...
Select fan output to configure, or other action:
1) hwmon3/pwm1
2) Change INTERVAL
3) Just quit
4) Save and quit
5) Show configuration
select (1-n): 1
Devices:
hwmon0 is acpitz
hwmon1 is AC0
hwmon2 is BAT0
hwmon3 is asus
hwmon4 is coretemp
Current temperature readings are as follows:
hwmon0/temp1_input 67
hwmon3/temp1_input 67
hwmon4/temp1_input 68
hwmon4/temp2_input 65
hwmon4/temp3_input 63
hwmon4/temp4_input 62
hwmon4/temp5_input 63
Select a temperature sensor as source for hwmon3/pwm1:
1) hwmon0/temp1_input 4) hwmon4/temp2_input 7) hwmon4/temp5_input
2) hwmon3/temp1_input 5) hwmon4/temp3_input 8) None (Do not affect this PWM output)
3) hwmon4/temp1_input 6) hwmon4/temp4_input
select (1-n): 2
Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 20
Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 50
/usr/bin/pwmconfig: line 942: [: -eq: unary operator expected
/usr/bin/pwmconfig: line 968: [: -eq: unary operator expected
Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255): 255
Select fan output to configure, or other action:
1) hwmon3/pwm1
2) Change INTERVAL
3) Just quit
4) Save and quit
5) Show configuration
select (1-n): 4
Saving configuration to /etc/fancontrol...
Configuration saved
to see what i do when i configure my fans. Actually hwmon3's path changing in every boot and it goes between 2 and 5 so thats why fancontrol doesn't works for me. I was using an app named notebook fan control while i was using windows and it was working for me. And my laptop is 8 years old that's why i can't use bios to configure my fans. And my arch and my bios is up-to-date. I hope i didn't missed anything. You can get more info from my first post under this topic.
Last edited by Welt (2020-09-05 14:06:47)
Offline
@Welt: have you read this:
Yeah i read this if i didn't metioned i will add it to first paragraph.
Edit= Sorry guys i didn't read the absolute paths part i will try that. If it works i will ping you up.
Edit2= I did everything in troubleshooting fan control but it didn't worked.
After absolute paths this is the pwmconfig it is so ironic
sudo pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.
We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.
Found the following devices:
hwmon0 is acpitz
hwmon1 is AC0
hwmon2 is BAT0
hwmon3 is asus
hwmon4 is coretemp
Found the following PWM controls:
hwmon3/pwm1 current value: 85
hwmon3/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) y
Giving the fans some time to reach full speed...
Found the following fan sensors:
cat: hwmon3/fan1_input: No such device or address
hwmon3/fan1_input current speed: RPM
Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue:
Testing pwm control hwmon3/pwm1 ...
cat: hwmon3/fan1_input: No such device or address
hwmon3/fan1_input ... speed was now
/usr/bin/pwmconfig: line 455: let: threshold=3*/4: syntax error: operand expected (error token is "/4")
It appears that fan hwmon3/fan1_input
is controlled by pwm hwmon3/pwm1
cat: hwmon3/fan1_input: No such device or address
Fan hwmon3/fan1_input has not returned to speed, please investigate!
Testing is complete.
Please verify that all fans have returned to their normal speed.
The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)? y
What should be the path to your fancontrol config file (/etc/fancontrol)? /etc/fancontrol
Loading configuration from /etc/fancontrol ...
Select fan output to configure, or other action:
1) hwmon3/pwm1
2) Change INTERVAL
3) Just quit
4) Save and quit
5) Show configuration
select (1-n): 1
Devices:
hwmon0 is acpitz
hwmon1 is AC0
hwmon2 is BAT0
hwmon3 is asus
hwmon4 is coretemp
Current temperature readings are as follows:
hwmon0/temp1_input 68
hwmon3/temp1_input 68
hwmon4/temp1_input 69
hwmon4/temp2_input 65
hwmon4/temp3_input 63
hwmon4/temp4_input 61
hwmon4/temp5_input 67
Select a temperature sensor as source for hwmon3/pwm1:
1) hwmon0/temp1_input 4) hwmon4/temp2_input 7) hwmon4/temp5_input
2) hwmon3/temp1_input 5) hwmon4/temp3_input 8) None (Do not affect this PWM output)
3) hwmon4/temp1_input 6) hwmon4/temp4_input
select (1-n): 2
Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 20
Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 50
/usr/bin/pwmconfig: line 942: [: -eq: unary operator expected
/usr/bin/pwmconfig: line 968: [: -eq: unary operator expected
Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255): 255
Select fan output to configure, or other action:
1) hwmon3/pwm1
2) Change INTERVAL
3) Just quit
4) Save and quit
5) Show configuration
select (1-n): 4
Saving configuration to /etc/fancontrol...
Configuration saved
Even tho it says that
Fan hwmon3/fan1_input has not returned to speed, please investigate!
but it returned to it's speed. But still i should run pwmconfig everytime i shutdown my laptop.
Last edited by Welt (2020-09-05 14:21:02)
Offline
I don't know much about laptops, but every 10-15 boots my hwmon IDs change.
Rather than frakk around with the changes, I just set fan curves up in my BIOS. Haven't looked back.
@Welt...does your BIOS do fan curves?
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Offline
I don't know much about laptops, but every 10-15 boots my hwmon IDs change.
Rather than frakk around with the changes, I just set fan curves up in my BIOS. Haven't looked back.
@Welt...does your BIOS do fan curves?
As i said i don't have cuz my rig is too old.
Offline
cat /etc/conf.d/lm_sensors
# Generated by sensors-detect on Sat Sep 5 16:50:44 2020
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded.
#
# The format of this file is a shell script that simply defines variables:
# HWMON_MODULES for hardware monitoring driver modules, and optionally
# BUS_MODULES for any required bus driver module (for example for I2C or SPI).
HWMON_MODULES="coretemp"
Offline
Example in my situation:
/sys/devices/platform/nct6775.656
HWMON_MODULES="coretemp"
I wonder why your Super-IO chip is not being loaded.
sudo modprobe nct6775
Mine:
cat /etc/conf.d/lm_sensors
# Generated by sensors-detect on Wed Nov 27 17:41:44 2019
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded.
#
# The format of this file is a shell script that simply defines variables:
# HWMON_MODULES for hardware monitoring driver modules, and optionally
# BUS_MODULES for any required bus driver module (for example for I2C or SPI).
HWMON_MODULES="coretemp nct6775"
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Offline
Welt wrote:Example in my situation:
/sys/devices/platform/nct6775.656
HWMON_MODULES="coretemp"
I wonder why your Super-IO chip is not being loaded.
sudo modprobe nct6775
Mine:
cat /etc/conf.d/lm_sensors # Generated by sensors-detect on Wed Nov 27 17:41:44 2019 # This file is sourced by /etc/init.d/lm_sensors and defines the modules to # be loaded/unloaded. # # The format of this file is a shell script that simply defines variables: # HWMON_MODULES for hardware monitoring driver modules, and optionally # BUS_MODULES for any required bus driver module (for example for I2C or SPI). HWMON_MODULES="coretemp nct6775"
sudo modprobe nct6775
modprobe: ERROR: could not insert 'nct6775': No such device
Offline
Well, I'm out of ideas. Sorry...
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Offline
Well, I'm out of ideas. Sorry...
I have hopes from wild penguin.
Offline
Guys i found a way. If i can start these codes automaticly in the boot my fans gonna ramp up to full speed.
modprobe asus_fan
echo 255 > /sys/devices/platform/asus_fan/hwmon/hwmon[[:print:]]*/pwm1
echo 255 > /sys/devices/platform/asus_fan/hwmon/hwmon[[:print:]]*/pwm2
but they need root privilages and bash cmd.
Last edited by Welt (2020-09-06 10:10:37)
Offline
Hey guys i'm trying to do absolute paths again cuz i think i made some mistake while doing it beforehands.
cat /usr/bin/fancontrol
#!/bin/bash
#
# Simple script implementing a temperature dependent fan speed control
# Supported Linux kernel versions: 2.6.5 and later
#
# Version 0.71
#
# Usage: fancontrol [CONFIGFILE]
#
# Dependencies:
# bash, grep, sed, cut, sleep, readlink, lm_sensors :)
#
# Please send any questions, comments or success stories to
# marius.reiner@hdev.de
# Thanks!
#
# For configuration instructions and warnings please see fancontrol.txt, which
# can be found in the doc/ directory or at the website mentioned above.
#
#
# Copyright 2003 Marius Reiner <marius.reiner@hdev.de>
# Copyright (C) 2007-2014 Jean Delvare <jdelvare@suse.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
#
#
PIDFILE="/var/run/fancontrol.pid"
#DEBUG=1
MAX=255
function LoadConfig
{
local fcvcount fcv
echo "Loading configuration from $1 ..."
if [ ! -r "$1" ]
then
echo "Error: Can't read configuration file" >&2
exit 1
fi
# grep configuration from file
INTERVAL=$(grep -E '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL=//g')
DEVPATH=$(grep -E '^DEVPATH=.*$' $1 | sed -e 's/DEVPATH= *//g')
DEVNAME=$(grep -E '^DEVNAME=.*$' $1 | sed -e 's/DEVNAME= *//g')
FCTEMPS=$(grep -E '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS=//g')
MINTEMP=$(grep -E '^MINTEMP=.*$' $1 | sed -e 's/MINTEMP=//g')
MAXTEMP=$(grep -E '^MAXTEMP=.*$' $1 | sed -e 's/MAXTEMP=//g')
MINSTART=$(grep -E '^MINSTART=.*$' $1 | sed -e 's/MINSTART=//g')
MINSTOP=$(grep -E '^MINSTOP=.*$' $1 | sed -e 's/MINSTOP=//g')
# optional settings:
FCFANS=$(grep -E '^FCFANS=.*$' $1 | sed -e 's/FCFANS=//g')
MINPWM=$(grep -E '^MINPWM=.*$' $1 | sed -e 's/MINPWM=//g')
MAXPWM=$(grep -E '^MAXPWM=.*$' $1 | sed -e 's/MAXPWM=//g')
AVERAGE=$(grep -E '^AVERAGE=.*$' $1 | sed -e 's/AVERAGE=//g')
# Check whether all mandatory settings are set
if [[ -z ${INTERVAL} || -z ${FCTEMPS} || -z ${MINTEMP} || -z ${MAXTEMP} || -z ${MINSTART} || -z ${MINSTOP} ]]
then
echo "Some mandatory settings missing, please check your config file!" >&2
exit 1
fi
if [ "$INTERVAL" -le 0 ]
then
echo "Error in configuration file:" >&2
echo "INTERVAL must be at least 1" >&2
exit 1
fi
# write settings to arrays for easier use and print them
echo
echo "Common settings:"
echo " INTERVAL=$INTERVAL"
let fcvcount=0
for fcv in $FCTEMPS
do
if ! echo $fcv | grep -E -q '='
then
echo "Error in configuration file:" >&2
echo "FCTEMPS value is improperly formatted" >&2
exit 1
fi
AFCPWM[$fcvcount]=$(echo $fcv |cut -d'=' -f1)
AFCTEMP[$fcvcount]=$(echo $fcv |cut -d'=' -f2)
AFCFAN[$fcvcount]=$(echo $FCFANS |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
AFCMINTEMP[$fcvcount]=$(echo $MINTEMP |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
AFCMAXTEMP[$fcvcount]=$(echo $MAXTEMP |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
AFCMINSTART[$fcvcount]=$(echo $MINSTART |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
AFCMINSTOP[$fcvcount]=$(echo $MINSTOP |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
AFCMINPWM[$fcvcount]=$(echo $MINPWM |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
[ -z "${AFCMINPWM[$fcvcount]}" ] && AFCMINPWM[$fcvcount]=0
AFCMAXPWM[$fcvcount]=$(echo $MAXPWM |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
[ -z "${AFCMAXPWM[$fcvcount]}" ] && AFCMAXPWM[$fcvcount]=255
AFCAVERAGE[$fcvcount]=$(echo $AVERAGE |sed -e 's/ /\n/g' |grep -E "${AFCPWM[$fcvcount]}" |cut -d'=' -f2)
[ -z "${AFCAVERAGE[$fcvcount]}" ] && AFCAVERAGE[$fcvcount]=1
# verify the validity of the settings
if [ "${AFCMINTEMP[$fcvcount]}" -ge "${AFCMAXTEMP[$fcvcount]}" ]
then
echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2
echo "MINTEMP must be less than MAXTEMP" >&2
exit 1
fi
if [ "${AFCMAXPWM[$fcvcount]}" -gt 255 ]
then
echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2
echo "MAXPWM must be at most 255" >&2
exit 1
fi
if [ "${AFCMINSTOP[$fcvcount]}" -ge "${AFCMAXPWM[$fcvcount]}" ]
then
echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2
echo "MINSTOP must be less than MAXPWM" >&2
exit 1
fi
if [ "${AFCMINSTOP[$fcvcount]}" -lt "${AFCMINPWM[$fcvcount]}" ]
then
echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2
echo "MINSTOP must be greater than or equal to MINPWM" >&2
exit 1
fi
if [ "${AFCMINPWM[$fcvcount]}" -lt 0 ]
then
echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2
echo "MINPWM must be at least 0" >&2
exit 1
fi
if [ "${AFCAVERAGE[$fcvcount]}" -lt 1 ]
then
echo "Error in configuration file (${AFCPWM[$fcvcount]}):" >&2
echo "AVERAGE must be at least 1" >&2
exit 1
fi
declare -a PREVIOUSTEMP_$fcvcount
echo
echo "Settings for ${AFCPWM[$fcvcount]}:"
echo " Depends on ${AFCTEMP[$fcvcount]}"
echo " Controls ${AFCFAN[$fcvcount]}"
echo " MINTEMP=${AFCMINTEMP[$fcvcount]}"
echo " MAXTEMP=${AFCMAXTEMP[$fcvcount]}"
echo " MINSTART=${AFCMINSTART[$fcvcount]}"
echo " MINSTOP=${AFCMINSTOP[$fcvcount]}"
echo " MINPWM=${AFCMINPWM[$fcvcount]}"
echo " MAXPWM=${AFCMAXPWM[$fcvcount]}"
echo " AVERAGE=${AFCAVERAGE[$fcvcount]}"
let fcvcount=fcvcount+1
done
echo
}
function DevicePath()
{
if [ -h "$1/device" ]
then
readlink -f "$1/device" | sed -e 's/^\/sys\///'
fi
}
function DeviceName()
{
if [ -r "$1/name" ]
then
cat "$1/name" | sed -e 's/[[:space:]=]/_/g'
elif [ -r "$1/device/name" ]
then
cat "$1/device/name" | sed -e 's/[[:space:]=]/_/g'
fi
}
function ValidateDevices()
{
local OLD_DEVPATH="$1" OLD_DEVNAME="$2" outdated=0
local entry device name path
for entry in $OLD_DEVPATH
do
device=$(echo "$entry" | sed -e 's/=[^=]*$//')
path=$(echo "$entry" | sed -e 's/^[^=]*=//')
if [ "$(DevicePath "$device")" != "$path" ]
then
echo "Device path of $device has changed" >&2
outdated=1
fi
done
for entry in $OLD_DEVNAME
do
device=$(echo "$entry" | sed -e 's/=[^=]*$//')
name=$(echo "$entry" | sed -e 's/^[^=]*=//')
if [ "$(DeviceName "$device")" != "$name" ]
then
echo "Device name of $device has changed" >&2
outdated=1
fi
done
return $outdated
}
function FixupDeviceFiles
{
local DEVICE="$1"
local fcvcount pwmo tsen fan
let fcvcount=0
while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
do
pwmo=${AFCPWM[$fcvcount]}
AFCPWM[$fcvcount]=${pwmo//$DEVICE\/device/$DEVICE}
if [ "${AFCPWM[$fcvcount]}" != "$pwmo" ]
then
echo "Adjusing $pwmo -> ${AFCPWM[$fcvcount]}"
fi
let fcvcount=$fcvcount+1
done
let fcvcount=0
while (( $fcvcount < ${#AFCTEMP[@]} )) # go through all temp inputs
do
tsen=${AFCTEMP[$fcvcount]}
AFCTEMP[$fcvcount]=${tsen//$DEVICE\/device/$DEVICE}
if [ "${AFCTEMP[$fcvcount]}" != "$tsen" ]
then
echo "Adjusing $tsen -> ${AFCTEMP[$fcvcount]}"
fi
let fcvcount=$fcvcount+1
done
let fcvcount=0
while (( $fcvcount < ${#AFCFAN[@]} )) # go through all fan inputs
do
fan=${AFCFAN[$fcvcount]}
AFCFAN[$fcvcount]=${fan//$DEVICE\/device/$DEVICE}
if [ "${AFCFAN[$fcvcount]}" != "$fan" ]
then
echo "Adjusing $fan -> ${AFCFAN[$fcvcount]}"
fi
let fcvcount=$fcvcount+1
done
}
# Some drivers moved their attributes from hard device to class device
function FixupFiles
{
local DEVPATH="$1"
local entry device
for entry in $DEVPATH
do
device=$(echo "$entry" | sed -e 's/=[^=]*$//')
if [ -e "$device/name" ]
then
FixupDeviceFiles "$device"
fi
done
}
# Check that all referenced sysfs files exist
function CheckFiles
{
local outdated=0 fcvcount pwmo tsen fan
let fcvcount=0
while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
do
pwmo=${AFCPWM[$fcvcount]}
if [ ! -w $pwmo ]
then
echo "Error: file $pwmo doesn't exist" >&2
outdated=1
fi
let fcvcount=$fcvcount+1
done
let fcvcount=0
while (( $fcvcount < ${#AFCTEMP[@]} )) # go through all temp inputs
do
tsen=${AFCTEMP[$fcvcount]}
if [ ! -r $tsen ]
then
echo "Error: file $tsen doesn't exist" >&2
outdated=1
fi
let fcvcount=$fcvcount+1
done
let fcvcount=0
while (( $fcvcount < ${#AFCFAN[@]} )) # go through all fan inputs
do
# A given PWM output can control several fans
for fan in $(echo ${AFCFAN[$fcvcount]} | sed -e 's/+/ /')
do
if [ ! -r $fan ]
then
echo "Error: file $fan doesn't exist" >&2
outdated=1
fi
done
let fcvcount=$fcvcount+1
done
if [ $outdated -eq 1 ]
then
echo >&2
echo "At least one referenced file is missing. Either some required kernel" >&2
echo "modules haven't been loaded, or your configuration file is outdated." >&2
echo "In the latter case, you should run pwmconfig again." >&2
fi
return $outdated
}
if [ -f "$1" ]
then
LoadConfig $1
else
LoadConfig /etc/fancontrol
fi
# Detect path to sensors
if echo "${AFCPWM[0]}" | grep -E -q '^/'
then
DIR=/
elif echo "${AFCPWM[0]}" | grep -E -q '^hwmon[0-9]'
then
DIR=/sys/class/hwmon
elif echo "${AFCPWM[0]}" | grep -E -q '^[1-9]*[0-9]-[0-9abcdef]{4}'
then
DIR=/sys/bus/i2c/devices
else
echo "$0: Invalid path to sensors" >&2
exit 1
fi
if [ ! -d $DIR ]
then
echo $0: 'No sensors found! (did you load the necessary modules?)' >&2
exit 1
fi
cd $DIR
# Check for configuration change
if [ "$DIR" != "/" ] && [ -z "$DEVPATH" -o -z "$DEVNAME" ]
then
echo "Configuration is too old, please run pwmconfig again" >&2
exit 1
fi
if [ "$DIR" = "/" -a -n "$DEVPATH" ]
then
echo "Unneeded DEVPATH with absolute device paths" >&2
exit 1
fi
#if ! ValidateDevices "DEVPATH" "DEVNAME"
# then
# echo "Configuration appears to be outdated, please run pwmconfig again" >&2
# exit 1
#fi
if [ "$DIR" = "/sys/class/hwmon" ]
then
FixupFiles "$DEVPATH"
fi
CheckFiles || exit 1
if [ -f "$PIDFILE" ]
then
echo "File $PIDFILE exists, is fancontrol already running?" >&2
exit 1
fi
echo $$ > "$PIDFILE"
# associative arrays to hold pwmN device name as key, and as value the
# pwmN_enable and pwmN values as they were before fancontrol was started
declare -A PWM_ENABLE_ORIG_STATE
declare -A PWM_ORIG_STATE
# $1 = pwm file name
function pwmdisable()
{
local ENABLE=${1}_enable
# No enable file? Just set to max
if [ ! -f $ENABLE ]
then
echo $MAX > $1
return 0
fi
# Try to restore pwmN and pwmN_enable value to the same state as before
# fancontrol start. Restoring the pwmN value is tried first, before the
# pwmN_enable mode switch.
# Some chips seem to need this to properly restore fan operation,
# when activating automatic (2) mode.
if [ ${PWM_ENABLE_ORIG_STATE[${1}]} ]
then
#restore the pwmN value
if [ "$DEBUG" != "" ]
then
echo "Restoring ${1} original value of ${PWM_ORIG_STATE[${1}]}"
fi
echo ${PWM_ORIG_STATE[${1}]} > ${1} 2> /dev/null
# restore the pwmN_enable value, if it is not 1.
# 1 is already set through fancontrol and setting it again might just
# reset the pwmN value.
if [ ${PWM_ENABLE_ORIG_STATE[${1}]} != 1 ]
then
if [ "$DEBUG" != "" ]
then
echo "Restoring $ENABLE original value of ${PWM_ENABLE_ORIG_STATE[${1}]}"
fi
echo ${PWM_ENABLE_ORIG_STATE[${1}]} > $ENABLE 2> /dev/null
# check if setting pwmN_enable value was successful. Checking the
# pwmN value makes no sense, as it might already have been altered
# by the chip.
if [ "$(cat $ENABLE)" = ${PWM_ENABLE_ORIG_STATE[${1}]} ]
then
return 0
fi
# if pwmN_enable is manual (1), check if restoring the pwmN value worked
elif [ "$(cat ${1})" = ${PWM_ORIG_STATE[${1}]} ]
then
return 0
fi
fi
# Try pwmN_enable=0
echo 0 > $ENABLE 2> /dev/null
if [ "$(cat $ENABLE)" -eq 0 ]
then
# Success
return 0
fi
# It didn't work, try pwmN_enable=1 pwmN=255
echo 1 > $ENABLE 2> /dev/null
echo $MAX > $1
if [ "$(cat $ENABLE)" -eq 1 -a "$(cat $1)" -ge 190 ]
then
# Success
return 0
fi
# Nothing worked
echo "$ENABLE stuck to" "$(cat $ENABLE)" >&2
return 1
}
# $1 = pwm file name
function pwmenable()
{
local ENABLE=${1}_enable
if [ -f $ENABLE ]
then
# save the original pwmN_control state, e.g. 1 for manual or 2 for auto,
# and the value from pwmN
local PWM_CONTROL_ORIG=$(cat $ENABLE)
local PWM_ORIG=$(cat ${1})
if [ "$DEBUG" != "" ]
then
echo "Saving $ENABLE original value as $PWM_CONTROL_ORIG"
echo "Saving ${1} original value as $PWM_ORIG"
fi
#check for degenerate case where these values might be empty
if [ $PWM_CONTROL_ORIG ] && [ $PWM_ORIG ]
then
PWM_ENABLE_ORIG_STATE[${1}]=$PWM_CONTROL_ORIG
PWM_ORIG_STATE[${1}]=$PWM_ORIG
fi
# enable manual control by fancontrol
echo 1 > $ENABLE 2> /dev/null
if [ $? -ne 0 ]
then
return 1
fi
fi
echo $MAX > $1
}
function restorefans()
{
local status=$1 fcvcount pwmo
echo 'Aborting, restoring fans...'
let fcvcount=0
while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
do
pwmo=${AFCPWM[$fcvcount]}
pwmdisable $pwmo
let fcvcount=$fcvcount+1
done
echo 'Verify fans have returned to full speed'
rm -f "$PIDFILE"
exit $status
}
trap 'restorefans 0' SIGQUIT SIGTERM
trap 'restorefans 1' SIGHUP SIGINT
# main function
function UpdateFanSpeeds
{
local fcvcount
local pwmo tsens fan mint maxt minsa minso minpwm maxpwm
local tval tlastval pwmpval fanval min_fanval one_fan one_fanval
local -i pwmval
let fcvcount=0
while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
do
#hopefully shorter vars will improve readability:
pwmo=${AFCPWM[$fcvcount]}
tsens=${AFCTEMP[$fcvcount]}
fan=${AFCFAN[$fcvcount]}
let mint="${AFCMINTEMP[$fcvcount]}*1000"
let maxt="${AFCMAXTEMP[$fcvcount]}*1000"
minsa=${AFCMINSTART[$fcvcount]}
minso=${AFCMINSTOP[$fcvcount]}
minpwm=${AFCMINPWM[$fcvcount]}
maxpwm=${AFCMAXPWM[$fcvcount]}
avg=${AFCAVERAGE[$fcvcount]}
read tlastval < ${tsens}
if [ $? -ne 0 ]
then
echo "Error reading temperature from $DIR/$tsens"
restorefans 1
fi
read pwmpval < ${pwmo}
if [ $? -ne 0 ]
then
echo "Error reading PWM value from $DIR/$pwmo"
restorefans 1
fi
# copy PREVIOUSTEMP_$fcvcount array to prevtemp
declare -a 'prevtemp=(${'"PREVIOUSTEMP_$fcvcount"'[@]})'
# add new element to the end of the array
prevtemp+=($tlastval)
# if needed, remove the first element of the array
if [ "${#prevtemp[@]}" -gt $avg ]
then
prevtemp=("${prevtemp[@]:1}")
fi
# calculate the average value of all elements
tval=$(( ( ${prevtemp[@]/%/+}0 ) / ${#prevtemp[@]} ))
# copy prevtemp back to PREVIOUSTEMP_$fcvcount
eval "PREVIOUSTEMP_$fcvcount=(\"${prevtemp[@]}\")"
# If fanspeed-sensor output shall be used, do it
if [[ -n ${fan} ]]
then
min_fanval=100000
fanval=
# A given PWM output can control several fans
for one_fan in $(echo $fan | sed -e 's/+/ /')
do
read one_fanval < ${one_fan}
if [ $? -ne 0 ]
then
echo "Error reading Fan value from $DIR/$one_fan" >&2
restorefans 1
fi
# Remember the minimum, it only matters if it is 0
if [ $one_fanval -lt $min_fanval ]
then
min_fanval=$one_fanval
fi
if [ -z "$fanval" ]
then
fanval=$one_fanval
else
fanval="$fanval/$one_fanval"
fi
done
else
min_fanval=1 # set it to a non zero value, so the rest of the script still works
fi
# debug info
if [ "$DEBUG" != "" ]
then
echo "pwmo=$pwmo"
echo "tsens=$tsens"
echo "fan=$fan"
echo "mint=$mint"
echo "maxt=$maxt"
echo "minsa=$minsa"
echo "minso=$minso"
echo "minpwm=$minpwm"
echo "maxpwm=$maxpwm"
echo "tlastval=$tlastval"
echo "prevtemp=${prevtemp[@]}"
echo "tval=$tval"
echo "pwmpval=$pwmpval"
echo "fanval=$fanval"
echo "min_fanval=$min_fanval"
fi
if (( $tval <= $mint ))
then pwmval=$minpwm # below min temp, use defined min pwm
elif (( $tval >= $maxt ))
then pwmval=$maxpwm # over max temp, use defined max pwm
else
# calculate the new value from temperature and settings
pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
if [ $pwmpval -eq 0 -o $min_fanval -eq 0 ]
then # if fan was stopped start it using a safe value
echo $minsa > $pwmo
# Sleep while still handling signals
sleep 1 &
wait
fi
fi
echo $pwmval > $pwmo # write new value to pwm output
if [ $? -ne 0 ]
then
echo "Error writing PWM value to $DIR/$pwmo" >&2
restorefans 1
fi
if [ "$DEBUG" != "" ]
then
echo "new pwmval=$pwmval"
fi
let fcvcount=$fcvcount+1
done
}
echo 'Enabling PWM on fans...'
let fcvcount=0
while (( $fcvcount < ${#AFCPWM[@]} )) # go through all pwm outputs
do
pwmo=${AFCPWM[$fcvcount]}
pwmenable $pwmo
if [ $? -ne 0 ]
then
echo "Error enabling PWM on $DIR/$pwmo" >&2
restorefans 1
fi
let fcvcount=$fcvcount+1
done
echo 'Starting automatic fan control...'
# main loop calling the main function at specified intervals
while true
do
UpdateFanSpeeds
# Sleep while still handling signals
sleep $INTERVAL &
wait
done
Last edited by Welt (2020-09-06 10:19:10)
Offline
Guys i found a way. If i can start these codes automaticly in the boot my fans gonna ramp up to full speed.
modprobe asus_fan echo 255 > /sys/devices/platform/asus_fan/hwmon/hwmon[[:print:]]*/pwm1 echo 255 > /sys/devices/platform/asus_fan/hwmon/hwmon[[:print:]]*/pwm2
but they need root privilages and bash cmd.
This is, essentially, what the lm_sensors service does (assuming you have properly set up configs in /etc). Have you enabled the lm_sensors service and set up /etc/conf.d/lm_sensors and /etc/sensors{,3}.conf?
Last edited by Trilby (2020-09-06 12:46:54)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Welt wrote:Guys i found a way. If i can start these codes automaticly in the boot my fans gonna ramp up to full speed.
modprobe asus_fan echo 255 > /sys/devices/platform/asus_fan/hwmon/hwmon[[:print:]]*/pwm1 echo 255 > /sys/devices/platform/asus_fan/hwmon/hwmon[[:print:]]*/pwm2
but they need root privilages and bash cmd.
This is, essentially, what the lm_sensors service does (assuming you have properly set up configs in /etc). Have you enabled the lm_sensors service and set up /etc/conf.d/lm_sensors and /etc/sensors{,3}.conf?
Yeah actually but something goes really wrong and can't spot it.
Offline
How have you configured it? What's in the configs? What's the output of `systemctl status lm_sensors`?
Last edited by Trilby (2020-09-06 16:38:20)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
How have you configured it? What's in the configs? What's the output of `systemctl status lm_sensors`?
* lm_sensors.service - Initialize hardware monitoring sensors
Loaded: loaded (/usr/lib/systemd/system/lm_sensors.service; enabled; vendor preset: disabled)
Active: active (exited) since Sun 2020-09-06 13:00:37 +03; 10h ago
Process: 392 ExecStart=/sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES (code=exited, status=0/SUCCESS)
Process: 416 ExecStart=/usr/bin/sensors -s (code=exited, status=0/SUCCESS)
Main PID: 416 (code=exited, status=0/SUCCESS)
Sep 06 13:00:37 aras systemd[1]: Starting Initialize hardware monitoring sensors...
Sep 06 13:00:37 aras systemd[1]: Finished Initialize hardware monitoring sensors.
/etc/sensors3.conf
# libsensors configuration file
# -----------------------------
#
# This default configuration file only includes statements which do not
# differ from one mainboard to the next. Only label, compute and set
# statements for internal voltage and temperature sensors are included.
#
# In general, local changes should not be added to this file, but rather
# placed in custom configuration files located in /etc/sensors.d. This
# approach makes further updates much easier.
#
# Such custom configuration files for specific mainboards can be found in
# "configs" directory of lm-sensors package.
#
# Please contribute back a configuration of your board so other users with
# the same hardware won't need to recreate it again and again.
chip "lm78-*" "lm79-*" "lm80-*" "lm96080-*"
label temp1 "M/B Temp"
chip "w83792d-*"
label in0 "VcoreA"
label in1 "VcoreB"
label in6 "+5V"
label in7 "5VSB"
label in8 "Vbat"
set in6_min 5.0 * 0.90
set in6_max 5.0 * 1.10
set in7_min 5.0 * 0.90
set in7_max 5.0 * 1.10
set in8_min 3.0 * 0.90
set in8_max 3.0 * 1.10
chip "w83793-*"
label in0 "VcoreA"
label in1 "VcoreB"
label in7 "+5V"
label in8 "5VSB"
label in9 "Vbat"
set in7_min 5.0 * 0.90
set in7_max 5.0 * 1.10
set in8_min 5.0 * 0.90
set in8_max 5.0 * 1.10
set in9_min 3.0 * 0.90
set in9_max 3.0 * 1.10
chip "w83795g-*" "w83795adg-*"
label in12 "+3.3V"
label in13 "3VSB"
label in14 "Vbat"
set in12_min 3.3 * 0.90
set in12_max 3.3 * 1.10
set in13_min 3.3 * 0.90
set in13_max 3.3 * 1.10
set in14_min 3.0 * 0.90
set in14_max 3.3 * 1.10
chip "via686a-*"
label in0 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in4_min 12.0 * 0.90
set in4_max 12.0 * 1.10
chip "adm1025-*" "ne1619-*"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
label in5 "VCC"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in5_min 3.3 * 0.90
set in5_max 3.3 * 1.10
# Depending on how your chip is hardwired, you may or may not have
# +12V readings.
# set in4_min 12.0 * 0.90
# set in4_max 12.0 * 1.10
label temp1 "CPU Temp"
label temp2 "M/B Temp"
chip "pc87365-*" "pc87366-*"
# Voltage inputs
label in7 "3VSB"
label in8 "VDD"
label in9 "Vbat"
label in10 "AVDD"
compute in7 @*2, @/2
compute in8 @*2, @/2
compute in10 @*2, @/2
# These are the operating conditions as recommended by National
# Semiconductor
set in7_min 3.0
set in7_max 3.6
set in8_min 3.0
set in8_max 3.6
set in10_min 3.0
set in10_max 3.6
# Depending on the hardware setup, the battery voltage may or may not
# be monitored.
# set in9_min 2.4
# set in9_max 3.6
label temp3 "SIO Temp"
set temp3_min 0
set temp3_max 70
set temp3_crit 85
chip "adm1030-*" "adm1031-*"
label temp1 "M/B Temp"
chip "w83627thf-*"
label in3 "+5V"
label in7 "5VSB"
label in8 "Vbat"
# Internal resistors
compute in3 @ * (1 + 34/51), @ / (1 + 34/51)
compute in7 @ * (1 + 34/51), @ / (1 + 34/51)
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in7_min 5.0 * 0.90
chip "lm87-*" "adm1024-*"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in4_min 12.0 * 0.90
set in4_max 12.0 * 1.10
label temp1 "M/B Temp"
label temp2 "CPU Temp"
chip "it87-*" "it8712-*" "it8716-*" "it8718-*" "it8720-*"
label in8 "Vbat"
chip "fscpos-*" "fscher-*"
#FSC "Hermes"
label in0 "+12V"
label in1 "+5V"
label in2 "Vbat"
label temp1 "CPU Temp"
label temp2 "M/B Temp"
label temp3 "Aux Temp"
chip "fscscy-*"
#FSC "Scylla"
label in0 "+12V"
label in1 "+5V"
label in2 "+3.3V"
label temp1 "CPU0 Temp"
label temp2 "CPU1 Temp"
label temp3 "M/B Temp"
label temp4 "Aux Temp"
chip "fschds-*"
# Fujitsu Technology Solutions, "Hades"-Chip
# Temperatures
label temp1 "CPU Temp"
label temp2 "Super I/O Temp"
label temp3 "System Temp"
# Fans
label fan1 "PSU Fan"
label fan2 "CPU Fan"
label fan3 "System FAN2"
label fan4 "System FAN3"
label fan5 "System FAN4"
# Voltages
label in0 "+12V"
label in1 "+5V"
label in2 "Vbat"
chip "fscsyl-*"
# Fujitsu Technology Solutions, "Syleus"-Chip
# Temperatures
label temp1 "CPU Temp"
label temp4 "Super I/O Temp"
label temp5 "Northbridge Temp"
# Fans
label fan1 "CPU Fan"
label fan2 "System FAN2"
label fan3 "System FAN3"
label fan4 "System FAN4"
label fan7 "PSU Fan"
# Voltages
label in0 "+12V"
label in1 "+5V"
label in2 "Vbat"
label in3 "+3.3V"
label in5 "+3.3V-Aux"
chip "vt1211-*"
label in5 "+3.3V"
label temp2 "SIO Temp"
chip "vt8231-*"
label in5 "+3.3V"
chip "smsc47m192-*"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
label in5 "VCC"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in4_min 12.0 * 0.90
set in4_max 12.0 * 1.10
set in5_min 3.3 * 0.90
set in5_max 3.3 * 1.10
label temp1 "SIO Temp"
chip "lm85-*" "lm85b-*" "lm85c-*" "adm1027-*" "adt7463-*" "adt7468-*" \
"emc6d100-*" "emc6d102-*" "emc6d103-*" "emc6d103s-*"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
# Depending on how your chip is hardwired, you may or may not have
# +12V readings.
# set in4_min 12.0 * 0.90
# set in4_max 12.0 * 1.10
label temp2 "M/B Temp"
chip "emc6w201-*"
label in2 "+3.3V"
label in3 "+5V"
label temp6 "M/B Temp"
chip "pc87365-*" "pc87366-*"
# Voltage inputs
label in7 "3VSB"
label in8 "VDD"
label in9 "Vbat"
label in10 "AVDD"
compute in7 @*2, @/2
compute in8 @*2, @/2
compute in10 @*2, @/2
# These are the operating conditions as recommended by National
# Semiconductor
set in7_min 3.0
set in7_max 3.6
set in8_min 3.0
set in8_max 3.6
set in10_min 3.0
set in10_max 3.6
# Depending on the hardware setup, the battery voltage may or may not
# be monitored.
# set in9_min 2.4
# set in9_max 3.6
label temp3 "SIO Temp"
set temp3_min 0
set temp3_max 70
set temp3_crit 85
chip "adm1030-*" "adm1031-*"
label temp1 "M/B Temp"
chip "w83627thf-*"
label in3 "+5V"
label in7 "5VSB"
label in8 "Vbat"
# Internal resistors
compute in3 @ * (1 + 34/51), @ / (1 + 34/51)
compute in7 @ * (1 + 34/51), @ / (1 + 34/51)
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in7_min 5.0 * 0.90
set in7_max 5.0 * 1.10
# The battery voltage may or may not be monitored.
# set in8_min 3.0 * 0.90
# set in8_max 3.0 * 1.10
chip "w83627ehf-*" "w83627dhg-*" "w83667hg-*" "nct6775-*" "nct6776-*" \
"nct6779-*" "nct6791-*" "nct6795-*" "nct6796-*"
label in0 "Vcore"
label in2 "AVCC"
label in3 "+3.3V"
label in7 "3VSB"
label in8 "Vbat"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 3.3 * 0.90
set in3_max 3.3 * 1.10
set in7_min 3.3 * 0.90
set in7_max 3.3 * 1.10
set in8_min 3.0 * 0.90
set in8_max 3.3 * 1.10
chip "w83627uhg-*"
label in2 "AVCC"
label in3 "+5V"
label in7 "5VSB"
label in8 "Vbat"
set in2_min 5.0 * 0.90
set in2_max 5.0 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in7_min 5.0 * 0.90
set in7_max 5.0 * 1.10
set in8_min 3.0 * 0.90
set in8_max 3.3 * 1.10
chip "f71805f-*"
label in0 "+3.3V"
set in0_min 3.3 * 0.90
set in0_max 3.3 * 1.10
chip "f71872f-*"
label in0 "+3.3V"
label in9 "Vbat"
label in10 "3VSB"
set in0_min 3.3 * 0.90
set in0_max 3.3 * 1.10
set in9_min 3.0 * 0.90
set in9_max 3.0 * 1.10
set in10_min 3.3 * 0.90
set in10_max 3.3 * 1.10
chip "k8temp-*"
label temp1 "Core0 Temp"
label temp2 "Core0 Temp"
label temp3 "Core1 Temp"
label temp4 "Core1 Temp"
chip "dme1737-*"
label in0 "5VSB"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
label in5 "3VSB"
label in6 "Vbat"
label temp2 "SIO Temp"
set in0_min 5.0 * 0.90
set in0_max 5.0 * 1.10
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in4_min 12.0 * 0.90
set in4_max 12.0 * 1.10
set in5_min 3.3 * 0.90
set in5_max 3.3 * 1.10
set in6_min 3.0 * 0.90
set in6_max 3.0 * 1.10
chip "sch311x-*"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
label in5 "3VSB"
label in6 "Vbat"
label temp2 "SIO Temp"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
set in4_min 12.0 * 0.90
set in4_max 12.0 * 1.10
set in5_min 3.3 * 0.90
set in5_max 3.3 * 1.10
set in6_min 3.0 * 0.90
set in6_max 3.0 * 1.10
chip "sch5027-*"
label in0 "5VSB"
label in1 "Vcore"
label in2 "+3.3V"
label in5 "3VSB"
label in6 "Vbat"
label temp2 "SIO Temp"
set in0_min 5.0 * 0.90
set in0_max 5.0 * 1.10
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in5_min 3.3 * 0.90
set in5_max 3.3 * 1.10
set in6_min 3.0 * 0.90
set in6_max 3.0 * 1.10
chip "sch5127-*"
label in2 "+3.3V"
label in5 "3VSB"
label in6 "Vbat"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in5_min 3.3 * 0.90
set in5_max 3.3 * 1.10
set in6_min 3.0 * 0.90
set in6_max 3.0 * 1.10
chip "f71808e-*" "f71808a-*" "f71862fg-*" "f71869-*" "f71869a-*" "f71882fg-*" \
"f71889fg-*" "f71889ed-*" "f71889a-*"
label in0 "+3.3V"
label in7 "3VSB"
label in8 "Vbat"
compute in0 @*2, @/2
compute in7 @*2, @/2
compute in8 @*2, @/2
chip "f71858fg-*" "f8000-*"
label in0 "+3.3V"
label in1 "3VSB"
label in2 "Vbat"
compute in0 @*2, @/2
compute in1 @*2, @/2
compute in2 @*2, @/2
chip "f71868a-*"
label in0 "+3.3V"
label in7 "3VSB"
label in8 "Vbat"
label in9 "5VSB"
compute in0 @*2, @/2
compute in7 @*2, @/2
compute in8 @*2, @/2
compute in9 @*3, @/3
chip "f81865f-*"
label in0 "+3.3V"
label in5 "3VSB"
label in6 "Vbat"
compute in0 @*2, @/2
compute in5 @*2, @/2
compute in6 @*2, @/2
chip "adt7473-*" "adt7475-*"
label in2 "+3.3V"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
label temp2 "Board Temp"
chip "adt7476-*" "adt7490-*"
label in1 "Vcore"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.90
set in3_max 5.0 * 1.10
# Depending on how your ADT7476 is hardwired, you may or may not have
# +12V readings.
# set in4_min 12.0 * 0.90
# set in4_max 12.0 * 1.10
label temp2 "M/B Temp"
conf.d lmsensor as i posted before i did lot of thing but this file still stays the same
# Generated by sensors-detect on Sun Sep 6 11:37:19 2020
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded.
#
# The format of this file is a shell script that simply defines variables:
# HWMON_MODULES for hardware monitoring driver modules, and optionally
# BUS_MODULES for any required bus driver module (for example for I2C or SPI).
HWMON_MODULES="coretemp"
Offline
You could add "asus_fan" to the modules in /etc/conf.d/lm_sensors which would then take care of one of the commands you are running manually at boot to get this working.
The other two should be covered by the "sensors -s" call from the lm_sensors service assuming /etc/sensors3.conf and any /etc/sensors.d/* files are properly configured (though I am not equipped to read/interpret those). From my reading of it, settings for your asus_fans should be in an /etc/sensors.d/* file. But there are supposed to be examples / templates included with the package which seem to be missing from the arch package.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You could add "asus_fan" to the modules in /etc/conf.d/lm_sensors which would then take care of one of the commands you are running manually at boot to get this working.
The other two should be covered by the "sensors -s" call from the lm_sensors service assuming /etc/sensors3.conf and any /etc/sensors.d/* files are properly configured (though I am not equipped to read/interpret those). From my reading of it, settings for your asus_fans should be in an /etc/sensors.d/* file. But there are supposed to be examples / templates included with the package which seem to be missing from the arch package.
Sorry for newbieness but how to add my asus_fan to that modules should i just edit it in nano ?
Offline
Yes, just edit it in any text editor and add asus_fan inside the quotes:
HWMON_MODULES="coretemp asus_fan"
This will result in the asus_fan module being loaded by the lm_sensors service file during boot.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline