Thecus N2100 FanControl Code
Status: Abandoned
Brought to you by:
coldtobi
File | Date | Author | Commit |
---|---|---|---|
src | 2009-04-22 |
![]() |
[840c6a] Clarified build dependencies. |
.gitignore | 2009-03-07 |
![]() |
[531309] Initial Release |
LICENSE | 2009-03-07 |
![]() |
[531309] Initial Release |
README | 2009-03-07 |
![]() |
[531309] Initial Release |
TODO | 2009-03-10 |
![]() |
[c66e59] WELL, one should really commit the changes... |
changelog | 2009-04-22 |
![]() |
[840c6a] Clarified build dependencies. |
This is the initial version of the fan controlling tool "fanctrl" fanctrl controls the fan of a Thecus N2100 via hdd and chip temperature. LICENSE ======= /* * (c) copyright Tobias Frost, 2009. tobi@coldtobi.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., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ BUILDING & CONFIGURATION ========================= For configuration, plese see the source file src/fanctrl.c, as currently there is only compile-time configuration. However, this is only required if you like to fine-tune the configuration or encounter problems with the default one. See "fine tuning" below for hints For building, just "cd src" and "make". DEPENDENCIES ============ Runtime dependency is the availbilty of smartmontools, which are used to get the harddrives temperature. RUNNING ======= Just run "fanctrl". It currently does not take any arguments. fanctrl will output some statistics every some seconds. If you do not want them, pipe them to /dev/null. fanctrl will also put some statistics to /tmp/fanctrl/. However, this directory has to be manually created before running the program. CONTRIBUTING ============= fanctrl is is a "works for me" state. However, it is not pretty at length. I know that but that is surely improving over time. You are welcome to send bug reports, patches, whishes, enhancmentsi, hints, opinions, money, kudos .... Please send them via the sourceforge tracker or directly via mail to tobi ät coldtobi.de You can also leave me a message on my blog, http://blog.coldtobi.de/. I created a special category for the devlopment of this programm http://blog.coldtobi.de/1_coldtobis_blog/categories/21_fanctrl.html FINE TUNING =========== Note: Units for degrees C are 1/100 degrees C. This was to avoid expensive float calculations. In facntrl.c, several values are hard coded. Change them if desired. Array struct hd_info disks[] defines the drives to be checked. .device Linux device name, like "/dev/sda". .cooling_down_per_second = 50, If spun down, estimate this cool rate. Unit is "1/100 degress C per second" .sf_statusfile specifies the location, where the status-file should be stored. example: "/tmp/fanctrl/hdd_sda_stat" The same for the chip temps: Array ch_info chips[] .device = "/sys/bus/i2c/devices/0-002e/temp1_input", .sf_statusfile = "/tmp/fanctrl/chip_1_stat" The array fan_info fans[] configures all PWM outputs. Default is fine for the Thecus N2100. .device = "/sys/bus/i2c/devices/0-002e/pwm1" .device = "/sys/bus/i2c/devices/0-002e/pwm2" Controlling PWM vs temperatures: struct pwmctrl pwm[2] = { { 2500 , 5000 , 50, 10 }, /**< hdd: Minimum pwm at temp 25C, max PWM at 50C. Turn off if pwm lower than 30 */ { 5000 , 5500 , 50, 10 } /**< chip: Minimum pwm at temp 50C, max PWM at 55C. No Fan lower than 50 */ }; The first line is for hdd controlling, the second one is for the chips. The above example turns on the fans for the hdd at 25°C, full power at 50°C. If calculated pwm is lower than 50, the fan is stopped. The "10" is an internal value to store calculations results. NOTES: ====== If you are wondering, why after some time the temps for the hds are not updated anymore, or with a slow rate: This is intended, as the smartctl commands seems to restart the internal sleep time we do a backoff algorithm here, to get the drive a change to go to sleep. This also requires that we do only an estimation when the drives are spun down: We assume that the drives will cool down with a constant factor.