now | writings | rss | github | twitter | contact

time destroys everything

posted to writings on jun 26th, 2007 with tags activerecord, blackberry, gtk, house, laptops, nerd, openbsd, oqo, ruby, and zaurus


when i got back from canadia, i realized that my tv had stopped working. i mean the tv worked, but the satellite didn't, so when i turned on the tv and got no signal, i thought, "huh... that sucks." and turned it off and did something else.

that was a month ago, and i haven't watched tv since then. not that i'm trying to take some political stand against tv, but i just don't find the need to watch 19 episodes of seinfeld and the simpsons every day anymore, and instead of sitting on the couch to watch tv, i tell myself to do something else. so i've taken the tv's out of my bedrooms and stored them in the basement. i think the tv in the living room is still not showing a picture, but who knows. it is going on craigslist soon as it is taking up lots of space in my living room.

i bought a sharp zaurus and put openbsd on it with the intention of making a lap timer for my car. i tried to use this timer on my treo in my r32, but it's so buggy and would crash the phone all the time, and trying to reboot a phone while racing around a track is not something i'd recommend.

there are of course some commercial timers but they are expensive and usually require a laptop running windows to be able to see the gps-acquired data. what's the fun in that?

so i started writing my own application, called lapper. i made a sketch of the interface and started writing the code in ruby using activerecord with a sqlite backend for storing data. for the gui i chose gtk+2, which has turned out to be rather slow (but quite pretty).

class Session < ActiveRecord::Base
  belongs_to :driver
  belongs_to :car
  belongs_to :track
  has_many :laps


the zaurus is well equipped for such an application (sans cpu speed). the main feature being its touchscreen, since i need to operate the interface quickly while on the track and will only have my hand available. since the screen rotates around and flips back over to cover the keyboard, its form factor remains small and has no other things to accidentally get pushed or broken.

i made a settings window in the gui to adjust the zaurus' screen brightness by hooking up a scroll bar widget to wsconsctl display.brightness. clicking the app's power button calls apm -z.

i'm hoping that the tiny hard drive in the zaurus doesn't get affected by the shock and vibration inside the car. if it does, i guess i can switch to a normal compactflash memory card for the hard drive.

since it is equipped with external compactflash and sdio slots, i bought a compactflash gps receiver that works with openbsd and talk to it through gpsd. while timing, lapper receives data points from gpsd and stores them in memory. when a lap has passed (by manually pushing the button or crossing the track's defined gps start/stop coordinates), it flushes the lap and all of the data point records to the sqlite database. this should work adequately for me since laps on the tracks i drive on will be in the range of 1:30 to 3:00 and data points are currenly collected every 200ms.

unfortunately gtk+2 is pretty big and slow, so the user interface is a bit lethargic while running on the little zaurus. even after using some tricks like drawing all of the windows at startup but hiding them until buttons are clicked, it isn't fast enough for my liking. i may just do something cheap like display a static bitmap for the interface and write some low level x stuff to respond to clicks in certain x/y coordinates corresponding to where the buttons are drawn. i'll pass it off as "theme/skin support" and have the bitmap changeable.

i still need to write the functionality to view recorded laps and compare the lines and speeds between each one (example) as well as some kind of png/html export (though i did write a nice little to_gpx method for the Lap class to spit out the lap in gpx format).

i also need to make some sort of mount to secure it in the exige without tearing up the dash. but at least i'll be able to say my racecar is running openbsd when this is all done.

my oqo model 02 finally arrived as well. i ordered it in january and it finally arrived this month, 153 days later. i didn't even want it anymore and was getting tired of hearing oqo push the shipping date back, but i figured i might as well make openbsd work on it before i turn around and sell it.

it now has a via processor, in contrast to the transmeta processor in the model 01/01+. audio is attached as an azalia(4) device but it does not work. the integrated atheros ar5413 wireless attaches as an ath(4) device but also does not work. integrated ethernet is a rl(4) and works fine. bluetooth works after enabling ubt in GENERIC. x11 works in 800x480 with a simple xorg.conf to manually specify the modeline, just like the oqo model 01 (which worked somehow a long time ago, then broke, and now needs vesabios to work).

i bought mine with the integrated sprint ev-do card, which i've made work under -current as a umsm(4) device. though i now realize that it needs to be activated under windows first before it can ever connect in openbsd.

but alas, i no longer use sprint and switched back again to at&t/cingular because i was tired of my treo 700p crashing all the time. it stopped syncing with my mac the other week and i got fed up enough to go buy the new blackberry curve 8300. it is much smaller, thinner, lighter, and stable than my treo. the change in operating system has taken some getting used to but i'm comfortable with it. i have imap, jabber, and ssh on it, so that's all i need anyway.

Comments? Contact me via Twitter or e-mail.