Work around a configuration problem of Marius Reiner's temperature dependent fan speed control with special notes on ASUS EeePC 1000H

by Stephan K.H. Seidl

Version 1, Wed, 11 Jun 2014 11:49:10 +0200

ASUS EeePC 1000H

Introduction

Inheriting an ASUS EeePC 1000H is quite an exciting thing, especially if it comes in pink with snowflakes. The hardware is rugged, is economical with respect to the power consumption, and can directly be supplied from the 12 V car battery. After configuring some Linux on a Gateworks Cambria GW2358-4 single board computer with its Intel IXP435 667 MHz processor it seemed to be clear that the 1000H will be a very fresh Linux host, supposed that the resources are not dissipated by inadequate software monsters. What was not clear at the beginning was whether the machine with its Intel Atom N270 1.6 GHz single-core hyper-threading processor, where Linux's /proc/cpuinfo shows two processing units, is able to smoothly reproduce DVD resolution level videos when running on battery. Today we know that the latter is not a problem. The N270 CPU runs at 40 % in total when converting DVD data into the 1024x600 pixel frames under X11, and 1 GB RAM seems to be more than sufficient. So it makes sense to replace the original 160 GB hard drive by a larger one. The Hitachi Travelstar 5K1000 1 TB (HGST HTE541010A9E680) has been chosen so far, to have important data always handy, plus the classic movies that should have been watched in original language for a couple of years, but never were. When playing back movies, the system takes about 12 W and the fan runs with somewhat more than 1300 RPM to maintain 30 °C core temperature if some fan control parameters are chosen as described below. A value of 30 °C here too ensures the wellness of the remaining components as the chipset and the disk, and lets the machine appear to be sufficiently silent.

Firmware

In this context, the firmware for the ASUS EeePC 1000H is quite a critical point. The BIOS version 2102 seems to be a good choice. With the version 2204, it was not possible to correctly access the hardware anymore. So it is believed that the latter version is no longer compatible with the EeePC modules provided with the Linux kernel. ASUS, on the other side, prevents BIOS downgrades from the version 2204 for some reason. Anyway, to install 2102 from any given BIOS version the following steps can be passed. Firstly, one stores three files into a temporary directory


-rwxr-xr-x ... root root ... CreateBootableMedia (click here for download)
-rw-r--r-- ... root root ... fdboot.img          (click here for download)
-rw-r--r-- ... root root ... md5sums.ref         (click here for download)

where fdboot.img is a FreeDOS 1.0 floppy image that has been taken from www.freedos.org. Secondly, the script CreateBootableMedia has to be executed, as root. The best way to do that is running the script line by line, by hand. This second step finishes really copying the new diskette image created just now onto a USB pen drive. Pay attention, the script CreateBootableMedia only echoes the appropriate copy command. The created diskette image looks as


-rwxr-xr-x  1 root root 524288 ... . .... 1000H.ROM
-rwxr-xr-x  1 root root  53345 ... . .... AFUDOS.EXE
-rwxr-xr-x  1 root root  66945 Sep 3 2006 command.com
drwxr-xr-x  2 root root   1024 Sep 3 2006 driver
-rwxr-xr-x  1 root root   1768 Sep 3 2006 fdconfig.sys
drwxr-xr-x  2 root root   1024 Sep 3 2006 freedos
-rwxr-xr-x  1 root root  45341 Sep 3 2006 kernel.sys .

Thirdly, one installs the BIOS 2102 on the 1000H, resetting the current BIOS to the factory defaults, preparing the current BIOS for booting from the pen drive, booting from the pen drive, executing the command sequence


2
dir
afudos
afudos /i1000H.ROM

where the 2 should be given within 120 seconds, and setting up the new BIOS in accordance with the needs.

The fancontrol configuration problem

Executing the command sequence


cd /sys/class/hwmon
ls -al
ls -al hwmon?/pwm1

may yield


lrwxrwxrwx ... root root ... hwmon0 -> ../../devices/virtual/hwmon/hwmon0
lrwxrwxrwx ... root root ... hwmon1 -> ../../devices/platform/coretemp.0/hwmon/hwmon1
lrwxrwxrwx ... root root ... hwmon2 -> ../../devices/platform/eeepc/hwmon/hwmon2

-rw-r--r-- ... root root ... hwmon2/pwm1

or


lrwxrwxrwx ... root root ... hwmon0 -> ../../devices/virtual/hwmon/hwmon0
lrwxrwxrwx ... root root ... hwmon1 -> ../../devices/platform/eeepc/hwmon/hwmon1
lrwxrwxrwx ... root root ... hwmon2 -> ../../devices/platform/coretemp.0/hwmon/hwmon2

-rw-r--r-- ... root root ... hwmon1/pwm1 .

The fan interface here is implemented by the module eeepc and it cannot be ensured that eeepc appears as hwmon1 or hwmon2, respectively. An imagined, zero based case index, describing whether eeepc appears as hwmon1 or hwmon2, does in fact not depend on the number of somatic cells the administrator consisted of just at the moment when he was switching on the machine, taking that number modulo 2, but that case index may silently change with software updates and other things that can affect the module loading sequence. On the other hand, the file /etc/fancontrol statically defines paths to files as pwm1, for example. So, whatever is configured in /etc/fancontrol, it may work or even not after a while.

The quick hack as the solution

Instead of doing a good job, namely, redesigning and reimplementing fancontrol from scratch, a quick hack has been performed to make it working so far.

/etc/init.d/fancontrol got a line such that fancontrol only runs on srosa, though the package is installed everywhere. /etc/fancontrol is now a stub that is still processed but that does not contain relevant configuration data. Configuration data is now dynamically obtained by some code section that has been added to /usr/sbin/fancontrol, analyzing the contents of the directories /sys/class/hwmon/hwmon[0-9]. Fan PWM configuration data also went from /etc/fancontrol to /usr/sbin/fancontrol such that it is easy now to configure the fan speed control system for other hosts, too, only adding further code sections. Here is the list of the files as they are involved.


-rw-r--r-- ... root root ... /etc/fancontrol             (click here for download)
-rwxr-xr-x ... root root ... /etc/init.d/fancontrol      (click here for download)
-rwxr-xr-x ... root root ... /etc/init.d/fancontrol-DIFF (click here for download)
-rwxr-xr-x ... root root ... /etc/init.d/fancontrol-ORG  (click here for download)
-rwxr-xr-x ... root root ... /usr/sbin/fancontrol        (click here for download)
-rwxr-xr-x ... root root ... /usr/sbin/fancontrol-DIFF   (click here for download)
-rwxr-xr-x ... root root ... /usr/sbin/fancontrol-ORG    (click here for download)

Conclusion

While the quick hack works fine so far, it should be tried to qualify the present software in such a manner that one comes back to a clean solution that finds the interfaces to control the fans automatically at run time and that determines sensible fan operating points, too.


Wed, 11 Jun 2014 11:49:10 +0200
Stephan K.H. Seidl