Saturday, May 30, 2009

This blog is dead

I have moved all content to Zentience.org now.

Please update your links and especially your feeds, the new feed URL is now http://zentience.org/feed.

Unfortunately I can't make HTTP redirects from here, so you'll have to do the work manually.

Thank you.

Sunday, April 5, 2009

OpenBSD on my Soekris net4801

I finally got OpenBSD installed on my Soekris net4801. The problems I'd had was because I for some reason thought it was 9600 baud serial console, when in fact it is 19200 baud. Setting the speed wrong gives a lot of gibberish on the screen.

Here's the outline:

  1. Set up a OpenBSD PXE boot environment.
  2. Get a serial console to the Soekris.
  3. Install OpenBSD.
  4. Geek out!

OpenBSD PXE Environment

You need a server running dhcpd(8) and tftpd(8). I have my OpenBSD gateway on 172.16.0.1, and this is the relevant parts of my configuration in dhcpd.conf(5):

shared-network LAN {
    option domain-name "zentience.org";
    option domain-name-servers 172.16.0.1;
    option routers 172.16.0.1;
    option ntp-servers 172.16.0.1;
    # For PXE booting clients.  Will be ignored otherwise.
    filename "pxeboot";

    # Default.
    subnet 172.16.0.0 netmask 255.255.255.0 {
        range 172.16.0.32 172.16.0.254;
    }
}

Edit IPs to fit your network setup. I also have static leases configured for all my other clients, but they're not relevant in this context.

Setting up tftpd(8) is very easy. Make sure you have inetd(8) running, then add this line to inetd.conf(5):

172.16.0.1:tftp dgram udp wait root /usr/libexec/tftpd tftpd -ls /tftpboot

Then ‘pkill -HUP inetd’. Of course you should change 172.16.0.1 to whatever is relevant in your network setup.

Create the /tftpboot directory and copy the bsd.rd and pxeboot files from the closest OpenBSD mirror into it. Then create a etc directory in /tftpboot and create the file /tftpboot/etc/boot.conf containing these three lines:

set tty com0
stty com0 19200
boot bsd.rd

That's it.

Get a Serial Console

I will describe how to do it on Mac OS X using a Keyspan USA-19HS USB→Serial adapter, if you're using something else details will certainly vary.

  1. Install Keyspan drivers.
  2. Connect cables, USB→Serial→Soekris, and connect the 1st Soekris network interface to the LAN.
  3. Open a Terminal.app and execute ‘sudo cu -l /dev/tty.USA19H41P1.1 -s 19200’. The exact /dev/tty.* name may vary.
  4. Power on the Soekris and type Control-P when prompted to enter monitor.
  5. In the Soekris monitor, enter the command ‘boot f0’ to PXE boot.

Install OpenBSD

It is very easy, just follow the instructions. In my opinion OpenBSD have the best installer of any operating system I've tried, easy, simple, fast and easily customizable if you need to.

Of course you have no use for the x*.tgz packages on a headless system with only a serial console, but I am sure you can install it if you want to.

Geek Out!

So far I have geeked out on my NET4801 kernel configuration file and pared the kernel down to 1.9 MB instead of the normal 6.5 MB.

# uname -ap
OpenBSD net.zentience.org 4.5 NET4801#1 i386 Geode(TM) Integrated Processor by National Semi ("Geode by NSC" 586-class)
# ls -l /bsd
-rw-r--r--  1 root  wheel  2014242 Apr  4 18:50 /bsd
#

I've created a github repository for whatever I do with it.

Thursday, March 26, 2009

Aerobic Run Test 2009-03-25

Had been up for almost an hour before. Had a banana and a very small bowl of full grain müsli (around 60-70 g I'd say) 30-40 minutes before I started. Normal run routine is a triple espresso and an apple and/or banana, but espresso wasn't available today.

Took yesterday off from training, I had a strong need to hang out with my family instead of going for a swim.

Weather at CPH airport, ~10 km away:
05:50: -3.1ºC, 2 m/s SE, 1004.9 hPa, no clouds.
07:30: -2.3ºC, 3 m/s SE, 1004.0 hPa, no clouds.

It was a beautiful sunny morning.

Start at 06:08:55, ran (and walked) for a total of 1:13'29".

Test course was four laps around “Solstriben”, and the protocol was one lap each at 130 bpm, 145 bpm, 160 bpm and 175 bpm.

Missed the lap button on my watch on the first lap in the first try, so that lap got a little longer, ~4 m, and the next a little shorter.

  1. 2.290 km: avg. HR 133 bpm, lap time 17'11", pace: 7'30"/km.
  2. 2.282 km: avg. HR 144 bpm, lap time 14'43", pace: 6'27"/km.
  3. 2.286 km: avg. HR 161 bpm, lap time 12'24", pace: 5'25"/km.
  4. 2.286 km: avg. HR 176 bpm, lap time 11'05", pace: 4'51"/km.

On lap #1 I was thinking “OMG I'm running so slow, and I'm freezing. Go slow, go slow... keep the heart rate down.” It's extremely challenging running at 70+ bpm below max heart rate for me. On lap #2 I was still cold, but it almost started to feel like running. Lap #3 was nice. It was how I'd run if I'd “just run” like most people do. On lap #4 I thought “Gee, I can't remember the last time I went this fast” to myself. Fun & hard.

Very neat line between the first three points, but the last one is a little too low. I think I could almost finish a ½ marathon at that speed though.

Good aerobic test. Coach Gordo says I have a lot to gain at the low end of the spectrum, and I agree, so I'll keep plugging away at that.

Saturday, March 21, 2009

Garmin or Suunto?

I'd like to upgrade to something that feels less like a dead end than a Polar heart rate monitor. First, let me explain why I think Polar is a dead end:

I'm a triathlete, and a huge nerd, so I like to record all data. Including power on the bike as soon as I can afford a good powermeter. I also use Mac OS X, and I'm constantly annoyed that I have to run Windows in a VMWare Fusion virtual machine to use my data from Polar. Polar doesn't interface with bike powermeters, except for their own, which, apart from being terribly ugly, isn't terribly precise either. I had the first version of the Polar Power Sensor (I think I still have it somewhere), and I never got it to work well. I basically hate it.

So I'm looking for a system that will work as a running computer and with the latest generation of ANT+ compatible powermeters, Saris PowerTap, SRM and the Quarq CinQo.

The contenders:

Garmin Edge 705 + ForeRunner 405

The Edge 705 is a cycling computer/heart rate monitor/powermeter computer/GPS map device, and the ForeRunner 405 is a more traditional running watch with GPS, heartrate and a footpod (ooh, and a new model is underway it seems) as extra equipment.

Both of the Garmins are Mac OS X compatible now. It took a while the get the software for the 405 ported to Mac, but they came through eventually. The 405 use a special wireless dongle to transmit the data, while the 705 use a USB cable and works as a mass storage device.

Both devices, being Garmins, have GPS built in, which is really neat.

Pros:

  • Mac compatible.
  • Simple and easy to understand XML file format (.tcx files).
  • Uncoded ANT+ data channels, no proprietary bullshit.
  • Documented communication protocols, so lots of compatible third party software.
  • GPS built in.
  • The 705 works with all powermeters worth having.

Cons:

  • Old school plastic heart rate chest strap.
  • Bulky, especially the 705.
  • Can't record a full triathlon, the 405 isn't swim proof (IPX7).

Suunto Triathlon Pack

The Suunto Triathlon Pack consists of a Suunto T6c, a Foot POD, a Road Bike POD + Cadence POD and a Memory Belt. The Road Bike POD is a great idea, it looks very clean, but it doesn't work on a turbotrainer where only the rear wheel rotates, so I'd have to get an additional Bike POD (which I'm not 100% sure will work from the left chainstay).

The Suunto coded ANT+ channels is what the SRM PowerControl VI use, so in a race you can use the same heart rate chest strap for both the T6c and SRM computer. Unfortunately Suunto gear can't use power input, only the chest strap can communicate with the powermeter computer, and only the latest iteration of SRMs are compatible.

The Memory Belt works as a standard heart rate chest belt, but can also record all heartbeats in its internal memory, which is essential for swimming, as the 2.4 GHz frequency of the ANT+ protocol doesn't go through water. It is made of solid plastic though, not textile as the Suunto Comfort Belt is. It could prove very interesting to get heartrate data for daily swim training in addition to bike and run training, who knows what could turn up. For daily training the more flexible standard Suunto Comfort Belt would be a better choice.

Pros:

  • Calculates EPOC, a measure of the training stress of the session, somewhat like TSS/rTSS.
  • Can record heart rate during swimming, provided the Memory Belt stays put.
  • Can record a full triathlon without having to tell it to change sensors.
  • Only slightly larger than normal wristwatch size.

Cons:

  • Only works with SRM Powermeters.
  • Windows only software, and WKO+ is file import only, not direct download.
  • No third party software as alternative to what Suunto provides, no documentation.

Conclusion

Going into this I actually wanted the Suunto solution, but seeing how Garmin is much better aligned with my general values of having my data in open formats and devices with documented interfaces, I think I'll end up with the Garmin solution.

Recording all of a triathlon with the Suunto is a nice thing for sure, but it is not really that important for me.

Another thing is the fact that I currently use WKO+ for downloading and analysis, writing logs etc., then uploading the .wko file to TrainingPeaks. And .wko files are binary junk data. I've looked hard, and I can't decipher them. I know that WKO+ can export to a saner format, but the export function is a little dodgy at times, and some data is lost in the conversion, so I'd like to have my raw data in an open format. And that I can have with the Garmins.

So a Garmin based workflow will be:

  1. Get the data off the Garmin.
  2. Upload .tcx file to TrainingPeaks via web interface.
  3. Write log messages etc.

That's it. Easy. And I'll have all my .tcx files both locally and on TrainingPeaks (I don't think they save as .wko files). And I can write my own software to get useful data out of the files, or use something like RaceDay to do fun stuff with the data.

The workflow with Suunto would be the same, except that I'd have to boot Windows somehow before I could start, and that's just annoying and time consuming. And being a Windows based solution it is so much harder to script parts of the workflow for automation.

So, if you're stuck down in Windows, and don't see that changing anytime soon, Suunto is nice. And so is Garmin. But If you use Mac OS X, there's much more in favor of Garmin.

Wednesday, March 4, 2009

Regex Humor

Jamie Zawinski is famously quoted for saying:

Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.

In a wonderful play on words Mark Pilgrim Twittered:

Some people, when confronted with a problem, think “I know, I'll quote Jamie Zawinski.” Now they have two problems.

The messenger is some of the message too. Good fun.

Monday, March 2, 2009

EOL for miracle.mongers.org

Yesterday Alex announced the end-of-life for miracle.mongers.org. Only the hardware hosting it, not the domain and community, which is mostly just a private high quality IRC channel.

It also means that m.mongers.org will go away. Which is sad, but also an opportunity. I'll see what I end up with.

Sunday, February 22, 2009

OpenBSD on MacPPC

With my new job followed a gorgeous new MacBook. Slightly smaller screen than I was used to, but I'll probably survive (I'm tough like that). Mette Marie have inherited my MacBook Pro and is very happy with that too, so I now have a PowerBook G4, my first Mac ever, free for fun stuff.

So, what to do? Install OpenBSD of course!

It was my first foray into non-i386 hardware with OpenBSD, but as always the documentation is great.

The install itself was really easy, almost the same as on an i386 machine, except for a few differences. There's a FAT formatted “i” partition in the disklabel editor that must be kept intact, otherwise it's as straightforward as on i386 hardware.

At the first boot after the install I held down Command-Option-O-F to get to the Open Firmware prompt and issued the following commands (straight from the INSTALL.macppc document):

setenv auto-boot? true
setenv boot-device hd:,ofwboot
reset-all

After that the machine boots straight into OpenBSD every time. You can even use Open Firmware to dual boot with Mac OS X if you want, but that makes the disk setup much more complicated. It's documented how to do it though.

The plan is to let it take over from my old crappy converted settop box I use for gateway at home, using an old PCMCIA interface for the upstream connection.

I'm checking out sources on the machine now, and when it's fully patched up and I have the software on it I need, I'll redo my whole setup, the firewall rules are really old by now, and there are new features in pf I'd love to use. I hope I can make the switch next week-end.