I noticed the other day (it was kind of hard to not notice, to be honest) that my laptop shut down abruptly when it overheated. This shouldn’t be the case, as the thermal controls on the mainboard should have spun up the fans.
After some poking around, I found that with the default ‘auto’ fan control, the top speed of ‘level 7′ only spins the fans around 4000RPM, even though when the feedback loop is disengaged (echo level disengaged > /proc/acpi/ibm/fan” they can spin up to 7000RPM, and bring the temperature down from the critical 100C mark.
This bug report suggests that something is completely amiss with the kernels thinkpad_acpi module, and nobody really knows why. The end result is that fans spin too slow on the Thinkpad range of laptops. This can, however, be resolved with a couple of edits and an additional package. The following instructions were tested on Ubuntu 12.10, most likely work exactly the same on all Debian versions and derivatives, and can be adapted for use on other Linux distros as well.
Firstly, enabled userland control of the Thinkpad fans with the following command -
echo options thinkpad_acpi fan_control=1 >> /etc/modprobe.d/thinkpad.conf
This will enable the new settings for your current session, and all future sessions too.
You should now be able to set the fan speed manually with commands such as –
echo level 0 > /proc/acpi/ibm/fan
echo level 7 > /proc/acpi/ibm/fan
echo level disengaged > /proc/acpi/ibm/fan
echo level auto > /proc/acpi/ibm/fan
The key bit here is to remember that ‘disengaged’ equates to ’127′ on the grand scale of speeds.
Next step is to install the thinkfan package, and enable automatic startup -
apt-get -y install thinkfan
sed -i s/START=no/START=yes/ /etc/default/thinkfan
Now, as above, the default fan speeds are too slow. So even if thinkfan commands a level 7 fan speed, it won’t be fast enough to keep your hardware cool. To make it run up to full speed, you have to disengage the feedback loop and let it run in failsafe mode. Don’t worry though, thinkfan will bring it back into ‘auto’ mode once temperatures are back to normal, so you can have normal battery life and normal noise levels once your compute process is complete.
Edit /etc/thinkfan.conf, and at the end adjust the endpoint for level 7, and insert a new line for fan speed 127. My thinkfan.conf is as below –
(0, 0, 55)
(1, 48, 60)
(2, 50, 61)
(3, 52, 63)
(4, 56, 65)
(5, 59, 66)
(7, 63, 66)
(127, 66, 32767)
Save thinkfan.conf, and start thinkfan with this
Once 66C is passed, it will enter disengaged mode, and run at full speed until it reaches 66C or below again.
My aging quad core i7 2.13GHz laptop will happily run BOINC now, at 97C, so I say it’s working
So, I had an itch. A variety of data coming in from a variety of sources, all over different protocols and methods, with different names, heirarchies, and paths. For a while I’d been pushing the data into MySQL, but this seemed a bit of a hack, and it still didn’t really cure the problem as it was more of a historical record than an attempt at mapping between the source and the destination, as it were.
I’d been fiddling with MQTT for a while, and had started publishing data over it via my personal broker. And then I read Roberts post over at http://blog.hekkers.net/2012/09/18/mqtt-about-dumb-sensors-topics-and-clean-code/ about republishing it in a logical way.
So simple! So, I wrote a republisher. It’s very simple, and it scratches my itch (and hopefully Roberts too). Data comes in via whatever naming scheme or topic you like, and it gets republished in whatever fashion you want. The map is maintained in map.csv, and items are separated by commas. The MQTT spec doesn’t reserve any characters for the topic name, so I’ve used a comma out of CSV convenience.
The code is over at https://github.com/kylegordon/mqtt-republisher
I’ve got a variety of Squeezebox Receivers dotted about the house, playing synchronized music and audio on demand. Due to the lack of a remote control requirement (using the Android controller), I opted to get the receivers on their own. However, the setup procedure is highly dependent on the remote control.
To work around this, grab a copy of net-udap from https://projects.robinbowes.com/Net-UDAP/trac. Switch user to root, and then fire up ./scripts/udap_shell.pl. Switch the receivers into init mode by holding down the front panel button until it blinks red slowly. If you end up with it flashing red quickly, you’ve just reset it to factory defaults. No great loss, as the procedure is mostly the same.
Once in the UDAP shell, run ‘discover’ to scan the network for devices. After a while it will come back to the prompt, and ‘list’ will show you the discovered devices. Pick one to configure with ‘configure X’ where X is the item number.
I found that the factory installed firmware was pretty poor at doing DHCP. This may due to my lack of expertise with this equipment, or actual bugs in the software. Whatever it may be, I found the best option was to give it some static network address settings first, let it update, and then switch to DHCP.
Due to the high demands I place on my home network, I have GigE ethernet to every device. Wireless is solely for laptops and mobile phones. Consequently, the settings below are for a wired connection.
Remember… run this AS ROOT!!
=== STATIC DETAILS ===
After you hit save_data, it will send the settings to the device, and the device will hopefully respond to confirm it. You should see “Raw msg:” followed by a hexadecimal dump. If that doesn’t appear, try save_data again after a short delay.
The flashing LED sequence will hint that it’s not configured, but it is. If it detects a firmware update is required, it will start pulling it down and installing it. It will indicate that this is happening by rapidly flashing the front panel LED a bright white colour until the process is complete. Once it’s in a safe state, and if it’s still not indicating its presence on the network correctly, pull the power connector out and reinsert and then visit the Logitech Media Server web interface. The device should then be listed in the player drop down.
Now that the device is on the network and working, it’s time to switch it over to DHCP mode. Yet again, hold down the front panel button until it slowly flashes red. Jump into the UDAP shell again, run a discover on the network, and then configure the device that it finds.
=== DHCP DETAILS ===
This probably also won’t give any visual indication on the front panel. Tail the DHCP server logs to make sure it gets an IP allocated. If it does, check the Media Server web interface again.
All being well, it should then be up and running using DHCP. Happy listening!
So, I’ve been busy hacking bits and bobs together. End result is a VPN endpoint with a weather station attached to it. Win!
It may not be much, but I stuck together a small article about how to remotely automate the startup of HP servers. We did this ages, and only now have I gotten around to tidying up the notes!