Fannyd - control the temperature and fan of your LinkStation
fannyd - a simple daemon for controlling fan speed and temperature on PPC LinkStations
Tested only on a KuroHG running OpenEmbedded/OpenLink, but should run on any PPC LinkStation that that has avr_evtd and hddtemp installed, perhaps with some modifications for the paths to the executables.
The code for it is listed below. If you are suggesting modifications to it, please perform those on the discussion page on the back, and also please comment your changes. Thank you.
Package for download: A ipk package is available for anyone who wants it - it has been tested on the OpenEmbedded/OpenLink beta distro, running on a KuroHG. Send me (Davy gravy) a PM and I'll email you a copy.
fannyd is a daemon that controls the fan speed on a PPC LinkStation by checking the temperature (hddtemp -n /dev/sda, for instance) and comparing that against a user-determined temperature limit. If that limit is exceeded, then it sends a command such as
echo -n "]]]]" > /dev/ttyS0
to the AVR chip to switch the fan to high speed. This check is done periodically, according to a time-check period defined by the user. If the temperature is less than or equal to the set limit, fannyd lets the fan run a bit longer, and then drops the fan to lower speed.
fannyd produces no output.
Settings for fannyd are sourced from /etc/fannyd.conf , which is a readable, well-commented file. The default values are as follows:
DEVICES = /dev/sda1 CHECKPERIOD=600 TEMPLIMIT=40 UARTPORT=/dev/ttyS0
Note that CHECKPERIOD is in seconds and TEMPLIMIT is in Celsius. Also note that the UARTPORT value will vary depending on which distro you are running.
There are no options, but fannyd also comes with fanny , which is a non-daemon form of fannyd that performs a temperature check and fan adjust a single time when it is executed. In addition, it produces output that shows the hard drive temperature and which UART port is set.
/usr/sbin/fannyd /usr/sbin/fanny /etc/fannyd.conf /etc/init.d/fannyd
I wrote the scripts/code below up because of heat problems in on of my boxes. I noticed how hot the air comming out from the back was - much hotter than from my LS-HG. The KuroHG has a Maxtor HD, which brandwise seem to run hot. Knowing that heat decreases component life, I naturally saw the need to crank up the fan - but it made sense to have it on high only when needed - based on temp.
Since the HD is the greatest contributor to heat in our boxes I felt like smartmontools might have some interface. Researching it I saw hddtemp, which is much cleaner for this purpose.
After writing it up and testing it, a few conversations with other members here made me wonder if anyone else had stumbled upon the need for this type of functionality. Certainly there have been others, like this one listed at Kurobox.com.
Thanks to lb_worm for avr_evtd and Emmanuel Varagnat for avr_evtd and hddtemp, respectively - they did all of the hard work that made this so easy for me.