THINKFAN.CONF.LEGACY(5) | File Formats Manual | THINKFAN.CONF.LEGACY(5) |
thinkfan.conf.legacy - the old, backwards-compatible config syntax for thinkfan thinkfan(1)
The thinkfan config file specifies one or more temperature input(s), exactly one fan to control and the fan levels. A fan level associates a certain fan speed to a lower and an upper temperature bound. If the temperature reaches the upper bound, we switch to the next fan level, and if it drops below the lower bound, we switch to the previous fan level. Temperature bounds can either be a single temperature (simple mode) or consist of multiple temperatures (complex mode). In simple mode, only the highest of all known temperature is compared to the upper & lower bound. If you have devices with very different temperature ratings (e.g. CPU vs. mechanical hard drives), you should specify correction values to equalize their temperature ranges, or better: use complex mode. In complex mode, the upper and lower bounds of each fan level are specified for each sensor individually. Thinkfan then switches to the next fan level if one of the upper bounds is reached, and to the previous fan level if all temperatures have dropped below their respective lower bounds.
Multiple sensor keywords can be combined in one config file, but note that the ordering is significant with respect to the upper and lower fan level bounds if you use complex mode. I.e. if /proc/acpi/ibm/thermal contains 16 temperatures and you specify an hwmon sensor after the tp_thermal statement, the hwmon sensor will be the 17th temperature. After each sensor path, an optional correction-value can be specified. This value (can be negative) is always added to the temperature reading from that sensor. Correction values should be specified if you use Simple Mode with components that have a different temperature rating, like hard disks and CPUs. Note though that Complex Mode is generally the better solution since it gives you full control over fan levels and temperature ranges for each sensor, instead of just adding a fixed value to equalize temperature ranges.
Currently, thinkfan can control only one fan at a time. In theory, you can run multiple instances of the program simultaneously (with multiple config files) to control multiple fans, but that requires enabling DANGEROUS mode and will likely break most init scripts. It is an error to have more than one fan statement per config file.
Defining the fan levels is the meat of the config file. Here you make use of your previously defined temperature inputs to set the lower and upper bounds for the fan speeds. You cannot mix simple fan levels with complex fan levels. The general syntax of a simple fan level is:
( fan-level [,] lower-bound [,] upper-bound )
The fan-level is either a numeric value (0-7 or 0-255, depending on whether a tp_fan or a pwm_fan is used) or a string enclosed in double quotes. When a tp_fan is used, specifying 0 has the same effect as specifying "level 0". In addition to the numeric fan levels, tp_fan also supports "level auto" and "level disengaged" or "level full-speed". See above for an explanation of what these mean. The format of lower-bound and upper-bound depends on whether you want to use Simple Mode or Complex Mode.
In simple mode, the lower-bound and upper-bound of a fan level are each specified as a single temperature value. Both are compared only to the highest temperature found in all of the configured thermal sensors. Using this mode of operation makes sense e.g. if all temperature readings come from the on-DIE thermal sensors of a multicore processor. The fan speed will affect all of these temperatures in the same way because they share a single thermal connection to the heatsink, so it makes sense to ignore all but the highest of these temperatures. As a rule of thumb, if your thermal sensors cover multiple devices you should use Complex Mode, or at least specify correction values to account for different temperature ratings.
In complex mode, both the lower-bound and upper-bound are lists of temperatures, the length of which must match the number of temperature readings thinkfan knows about. Each bound must be enclosed in braces, with individual values separated by commas or spaces, so the specific syntax of a complex mode fan level is:
{ fan-level ( lower-1 [lower-2 ...] ) ( upper-1 [upper-2 ...] ) }
The optional commas have been omitted here for readability, and the curly braces are interchangeable with round braces. Note that it is not possible to mix simple fan levels with complex fan levels.
Complex mode is generally the preferred mode of operation since it allows you to specify precisely what the fan should to to keep each component within its specified temperature range.
Example configs shipped with the source distribution, also available at https://github.com/vmatare/thinkfan/tree/master/examples.
2020-04-09 | thinkfan 1.3.1 |