| 1 | .TH FANCONTROL 8 "January 2009" "lm-sensors 3" |
|---|
| 2 | .SH NAME |
|---|
| 3 | fancontrol \- automated software based fan speed regulation |
|---|
| 4 | |
|---|
| 5 | .SH SYNOPSIS |
|---|
| 6 | .B fancontrol |
|---|
| 7 | .I [configfile] |
|---|
| 8 | |
|---|
| 9 | .SH DESCRIPTION |
|---|
| 10 | \fBfancontrol\fP is a shell script for use with lm_sensors. It reads its |
|---|
| 11 | configuration from a file, then calculates fan speeds from temperatures and |
|---|
| 12 | sets the corresponding PWM outputs to the computed values. |
|---|
| 13 | |
|---|
| 14 | .SH WARNING |
|---|
| 15 | Please be careful when using the fan control features of your mainboard, in |
|---|
| 16 | addition to the risk of burning your CPU, at higher temperatures there will be |
|---|
| 17 | a higher wearout of your other hardware components, too. So if you plan to use |
|---|
| 18 | these components in 50 years, \fBmaybe\fP you shouldn't use fancontrol |
|---|
| 19 | at all. Also please keep in mind most fans aren't designed to be |
|---|
| 20 | powered by a PWMed voltage. |
|---|
| 21 | |
|---|
| 22 | In practice it doesn't seem to be a major issue, the fans will get slightly |
|---|
| 23 | warmer, just be sure to have a temperature alarm and/or shutdown call, in case |
|---|
| 24 | some fan fails, because you probably won't hear it anymore ;) |
|---|
| 25 | |
|---|
| 26 | .SH CONFIGURATION |
|---|
| 27 | For easy configuration, there's a script |
|---|
| 28 | named \fBpwmconfig\fP(8) which lets you interactively write your |
|---|
| 29 | configuration file for \fBfancontrol\fP. Alternatively you can write this |
|---|
| 30 | file yourself using the information from this manpage. |
|---|
| 31 | |
|---|
| 32 | Since most of you are going to use \fBpwmconfig\fP(8) script, the config |
|---|
| 33 | file syntax will be discussed last. First I'm going to describe the various |
|---|
| 34 | variables available for changing \fBfancontrol\fP's behaviour: |
|---|
| 35 | |
|---|
| 36 | .TP |
|---|
| 37 | .B INTERVAL |
|---|
| 38 | This variable defines at which interval in seconds the main loop of |
|---|
| 39 | \fBfancontrol\fP will be executed |
|---|
| 40 | .TP |
|---|
| 41 | .B FCTEMPS |
|---|
| 42 | Maps PWM outputs to temperature sensors so \fBfancontrol\fP knows which |
|---|
| 43 | temperature sensors should be used for calculation of new values for |
|---|
| 44 | the corresponding PWM outputs. |
|---|
| 45 | .TP |
|---|
| 46 | .B FCFANS |
|---|
| 47 | FCFANS records the association between a PWM and a fan. |
|---|
| 48 | Then \fBfancontrol\fP can check the fan speed and restart it if it |
|---|
| 49 | stops unexpectedly. |
|---|
| 50 | .TP |
|---|
| 51 | .B MINTEMP |
|---|
| 52 | The temperature below which the fan gets switched to minimum speed. |
|---|
| 53 | .TP |
|---|
| 54 | .B MAXTEMP |
|---|
| 55 | The temperature over which the fan gets switched to maximum speed. |
|---|
| 56 | .TP |
|---|
| 57 | .B MINSTART |
|---|
| 58 | Sets the minimum speed at which the fan begins spinning. You should |
|---|
| 59 | use a safe value to be sure it works, even when the fan gets old. |
|---|
| 60 | .TP |
|---|
| 61 | .B MINSTOP |
|---|
| 62 | The minimum speed at which the fan still spins. Use a safe value here, |
|---|
| 63 | too. |
|---|
| 64 | .TP |
|---|
| 65 | .B MINPWM |
|---|
| 66 | The PWM value to use when the temperature is below MINTEMP. |
|---|
| 67 | Typically, this will be either 0 if it is OK for the fan to plain |
|---|
| 68 | stop, or the same value as MINSTOP if you don't want the fan to |
|---|
| 69 | ever stop. |
|---|
| 70 | If this value isn't defined, it defaults to 0 (stopped fan). |
|---|
| 71 | .TP |
|---|
| 72 | .B MAXPWM |
|---|
| 73 | The PWM value to use when the temperature is over MAXTEMP. |
|---|
| 74 | If this value isn't defined, it defaults to 255 (full speed). |
|---|
| 75 | .PP |
|---|
| 76 | The configuration file format is a bit strange: |
|---|
| 77 | .IP |
|---|
| 78 | .nf |
|---|
| 79 | VARIABLE=chip/pwmdev=value chip/pwmdev2=value2 |
|---|
| 80 | VARIABLE2=... |
|---|
| 81 | .fi |
|---|
| 82 | .PP |
|---|
| 83 | Each variable has its own line. The variable name is followed by an equal sign |
|---|
| 84 | and the device=value pairs. These consist of the path to the pwm output for |
|---|
| 85 | which the value is valid, equal sign followed by the value and are separated |
|---|
| 86 | by a blank. Path can be absolute or relative (from /sys/bus/i2c/devices or |
|---|
| 87 | /sys/class/hwmon depending on the kernel version). Example: |
|---|
| 88 | .IP |
|---|
| 89 | MINTEMP=hwmon0/device/pwm1=40 hwmon0/device/pwm2=54 |
|---|
| 90 | .PP |
|---|
| 91 | You have to play with the temperature values a bit to get happy. For initial |
|---|
| 92 | setup I recommend using the \fBpwmconfig\fP script. Small changes can be made by |
|---|
| 93 | editing the config file directly following the rules above. |
|---|
| 94 | |
|---|
| 95 | .SH THE ALGORITHM |
|---|
| 96 | |
|---|
| 97 | \fBfancontrol\fP first reads its configuration, writes it to arrays and loops its |
|---|
| 98 | main function. This function gets the temperatures and fanspeeds from |
|---|
| 99 | kernel driver files and calculates new speeds depending on temperature |
|---|
| 100 | changes, but only if the temp is between MINTEMP and MAXTEMP. After that, the |
|---|
| 101 | new values are written to the PWM outputs. Currently the speed increases |
|---|
| 102 | quadratically with rising temperature. This way you won't hear your fans most |
|---|
| 103 | of the time at best. |
|---|
| 104 | |
|---|
| 105 | .SH SEE ALSO |
|---|
| 106 | pwmconfig(8), sensors(1). |
|---|
| 107 | |
|---|
| 108 | .SH AUTHOR |
|---|
| 109 | .PP |
|---|
| 110 | Marius Reiner <marius.reiner@hdev.de> |
|---|