The purpose of these two programs is to allow the user to control the fan speeds through the pwm control provided by chips such as the w83782d. While the w83782d provides 4 different pwm controls, the user will only be able to control the speed of two fans (the CPU fan headers) because the program depends on having a tach output for reading the speed of the fan. I guess it is possible to control the third fan header as well (provided that it is connected to a pwm output) but playing around with this can also result in the fan being turned off which could of course have disasterous effect so it is not advisable.
So how do these programs work? There is almost no documentation so I did some digging and messing about. As my two fan headers are dead I cannot give you an idea of how well this works but hopefully some brave soul from the forums can help me out here
Before I begin describing how to get this working I want to mention a few things about versions. Pwmconfig and fancontrol are new programs and were added to lm_sensors in version 2.8.0. However, it wasn't until version 2.8.3 that support for kernel versions 2.6 was added. It was in version 2.8.7 of lm_sensors that support for the new sysfs naming scheme was added. So in short, if you have sensors working and you are running version 2.8.3 of sensors or above then this will most probably work. If you are running version 2.8.7 or above then I am sure it will work just fine.
The fancontrol program won't run right off without some user intervention. If you try to run the program it will complain that a config file (/etc/fancontrol) is missing. This is where the pwmconfig program comes in. This program probes for pwm controllers in your sensors configuration and (probably) builds this file. I haven't been able to verify this as I don't have working fan headers. If I run the pwmconfig program I get this output:
[root@loki root]# pwmconfig
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 PWM controls:
Found the following fan sensors:
0-002d/fan1_input current speed: 0 ... skipping!
0-002d/fan2_input current speed: 0 ... skipping!
0-002d/fan3_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 as you can see, the program does identify everything correctly on my BP6 but it refuses to continue because of the lack of tach feedback (because I don't have any fans connected). So I assume that pwmconfig will build the configuration file that fancontrol will use to control your fans. I am not sure how fancontrol works either because I haven't found any documentation on it, but if someone tests this and sends me the config file then I am pretty sure I can work it out.
A word of warning: I found this text below embedded into a script that works pwmconfig:
# Warning!!! This program will stop your fans, one at a time,
# for approximately 5 seconds each!!!
# This may cause your processor temperature to rise!!!
# Verify that all fans are running at normal speed after this
# program has exited!!!
In other words, take precautions when testing this out. Make sure your processors are idle and that you can check to make sure that your fans are working as they should after running the program.
Wanna be a real hardware hacker? Wanna control fanspeed without fanspeed? It is possible by passing information right into the kernel as root.
Here is how it works: Each pwm controller accepts a value between 0 and 255 where 255 represents full speed (which is also default). This value can be changed in the kernel by user root. Please note that changing values in the kernel at runtime doesn't leave room for errors!
The values for sensors that the kernel works with are found (on my BP6 at least) here (I am running a 2.6.5 kernel):
- Code: Select all
If you take a look into that directory you will recognise some of the parameters you find in your sensors.conf file. The ones that contain the values for the pwm controller are "fanX_pwm" parameters. If you do:
- Code: Select all
You will get the value "255" in return.
So lowering this value will in effect lower the speed of your fans! You can do that like so:
- Code: Select all
echo "200" > /sys/bus/i2c/devices/0-002d/fan1_pwm
Try the "cat" command above again and see that the value has been changed to 200. Your fan should be running slower now.
I have not been able to test this on my own. My fan headers are not working so I haven't been able to run this to see if it works as advertised. I have tried changing other parameters at runtime to see if "sensors" would report the change and it did.
Also: Don't set this value too low! The motors that the fans use are brushless DC motors and they need a certain speed to operate properly (how much depends on construction and quality). Risk is, if you try to slow them down too much then they might stop! Try setting a value between 200 and 255 to begin with. If you want to go lower, make sure that you can monitor the fans properly before doing so.
I would of course like to hear from someone with working fan headers who can test this out