Manage your Chumby’s alarms via WebDAV

Note This article is substantially out-of-date (especially with regard to how the crontab works on Chumby). If you really insist on using this method, you may want to glance at the other story, Manage your Chumby’s alarms via Email for reference.

As it turns out, I’ve been having quite a few sleepovers at the significant other’s abode lately. My alarm is as loud as the sun is bright; during the depths of the dark, rainy Portland winter, I decided to pick up a new and innovative alarm clock. After looking through alarm clocks that shock you, roll around the room, fly up into the air, and donate money to the Republican Party if you press ‘snooze’, I settled upon the most innovative of them all: The Chumby. Running a version of embedded Linux named BusyBox, it’s really more of a tiny computer than an alarm clock— the guys at Chumby Industries like to call it an Internet Appliance.

As I was saying, this alarm clock is loud; after initially being woken up by the oddest selections of Pandora at 5:00 AM, I decided to just send one of my favorite relaxing wake-up songs (‘Hibernating‘ by Console, if you must know) to the device, but enable something called the ‘Backup Alarm’— just in case for some reason it cannot find any MP3s on its generous internal storage.

If I fail to turn my alarm off within five minutes of its first peep, I’ll risk being be terrified to death by the shrieking hellfire of electronically-synthesized waveform doom that the Backup Alarm will let loose upon my bedroom. Since I’m often not home, this shrieking noise may awaken (and potentially piss off) my roommate, neighbors, city— especially if it is going off for a whole hour before I arrive home in the morning to dismiss it— and I generally try to be as considerate of a person as is practical.

So, I wrote a couple of little scripts—one to synchronize the file containing alarm information with an arbitrary WebDav server, and one to edit said file while on said WebDav server.

WebDav Share

Setting up a WebDav share is outside of the scope of this walkthrough, but as always google has developed a solution to this problem.

Python on the Chumby

After SSHing into your Chumby, you’ll need to download, extract, and install the pre-compiled version of Python2.6 for your Chumby.

# Temporarily re-mount the root drive as read-write
mount -o remount,rw /
# Create a folder to hold your python installation, and head over there
mkdir /mnt/storage/python
cd /mnt/storage/python
# Download and extract the Python binaries
wget http://files.chumby.com/languages/python/python2.6-chumby.tgz
tar -xvzf ./python2.6-chumby.tgz
# Link these libraries to their proper homes
cd /usr/lib/
ln -s /mnt/storage/python/lib/* ./
cd /usr/bin/
ln -s /mnt/storage/python/bin/* ./

Install this script

# Copy the script from Adam's shared files
mkdir /mnt/storage/scripts/
cd /mnt/storage/scripts/
wget http://media.latestrevision.net/ost/chumbyalarmmanager.py

You’ll also need to edit this file to configure it for your environment. It’s really very easy, I promise.

Set up a cron job

crontab -e

Then, add a line looking like this to the very bottom of the editor window that appears:

*/5 * * * * /usr/bin/python /mnt/storage/scripts/chumbyalarmmanager.py --synchronize

Clean up after yourself

# We won't need this anymore
rm python2.6-chumby.tgz
# Re-mount as read-only
mount -o remount,ro /

You’re all set! Your Chumby will begin synchronizing its alarm.xml file in just a few minutes— you are now free to edit your alarms on either the device directly, or by editing the XML file that it has placed a copy of on your WebDav share.

If you run into unexpected situations; the logs are written to /psp/alarms.log.

Editing the XML file

I’ve also written a little application that I use for editing this XML file— mostly to eliminate accidental errors and to cope with some annoyances of the way our friends at Chumby Industries decided to encode times in the XML file. This application is very crude. Use it at your own risk. If you’d like to use this app, you can download it below this entry.

1 year, 6 months ago

text/x-python file
The client-side application which I run once every few minutes on my Chumby.
text/x-python file
The server-side application I use to modify these alarms remotely.

Who is to blame?

A photo of Adam Coddington.

Adam works for a small software company in Portland, OR's Cathedral Park neighborhood as a software developer. In recent news, bike commuting from his apartment in the Mississippi District to his office has been making him slightly damper than expected, but having the early-morning view of the St. Johns bridge poking out of the dense fog rolling across the west hills every morning while enjoying his cup of coffee more than makes up for such a minor inconvenience.

Not enough information? I didn't think so either. Well, he cares about things like leftist politics and economics, living a car-free lifestyle, never taking anything for granted, and although he is an unabashed technophile, he dreams of living an unplugged lifestyle in the middle of the wilderness by the time he reaches forty or so years old.

What is the meaning of this?

This Adam guy has an really terrible memory for things like names, places, and events. Although it might be rather a miracle that he doesn't drown on his own spit from day-to-day, he has somehow managed to scrape together his software development skills from year to year to maintain this site-- a sort of documentary of his own life. This is more for his sake than yours.

We are all creatures of our own past. How do you remind yourself of your own context?

What is this guy up to?

4 days, 21 hours ago My Top 3 #lastfm Artists: Arcade Fire (32), Phoenix (22) & Belle and Sebastian (22) http://t.co/XK6xBWqP

1 week, 1 day ago This place is surprisingly ghetto. (@ Greyhound Station) http://t.co/zrQpqZ1I

1 week, 2 days ago 'looks like I'm going to be in Pasco, WA this weekend.

1 week, 3 days ago Overheard in the office: "But if you've been a bad little boy, Santa will fill your binary with segfaults!"

Follow @latestrevision on twitter