Since this is so long, the summary is: I got it working and now I have plans to expand it.
I've had this idea for a few weeks for an easy project. In the mornings, I like to sleep in. I tend to lose track of how much time has gone by after hitting the snooze button a few times. I have bad vision, so I can't read my clock even though it has three inch high numbers. If I want to know the time, I have to pick it up and hold it close to my face, or put on my glasses.
So I've developed a system of guessing what time it is, and mostly I'm right. But I'd rather know than guess. Bonus points for not having to put forth any effort to get this info in the morning.
So I've played with the text to speech synthesizer festival before, and I used that as my starting point. I setup a simple script on my desktop to announce the time at night:
[crontab]
0 2,3 * * * ~/bin/datechime
30 2 * * * ~/bin/datechime
[~/bin/datechime]
#!/bin/sh
echo '(voice_kal_diphone)(SayText "it is now '`date +%l:%M%p`'")' | festival >/dev/null 2>&1
This works great for having a reminder of when I should go to bed (3am). I tried setting up the same announcement for when I should get up (11am), and I can't hear it from my bedroom. That's easy enough, I just need another computer in my bedroom. One that doesn't make any noise. One that has a minimum of blinky lights. One that uses a minimum of power too, no need to waste anything.
A friend and I bought 3 Soekris net4521 machines a few years ago to do wireless point to point links. That project is no longer, so I re-tasked one of the machines to do this. Those machines are built around the AMD ElanSC520 processor running at 133mhz, with 64mb of ram, and has a 128MB Compact Flash card for storage. They are primarily designed for wireless points, but you can expand them with PC Card and Mini PCI cards. So I bought a PC Card to USB adapter ($10), a USB audio adapter ($10), and a cheap pair of speakers ($8).
After getting all the hardware together, I setup a virtual machine on my desktop to test installing an OS on this restricted memory and space requirements. I first used livecd-creator to create a Fedora Live CD image, but that didn't really work with only 64mb of ram. I then tried Damn Small Linux, which fit the bill. I even pared it down further by removing all the graphics and firefox (this machine only has a serial port for display). I also found a version of festival designed for low powered CPUs and low memory (flite or "festival lite"). After testing out installing and booting my image a few times with the virtual machine, I was pretty confident in the software setup.
My simple script changed slightly for flite:
[~/bin/datechime]
#!/bin/sh
flite "it is now `date '+%l:%M %p' | sed 's/\([AP]\)M/\1.M/'`" >/dev/null 2>&1
I go to install it on the Soekris machine, and I find out that I don't have a compact flash adapter. I instead have a secure digital adapter. Well, no problem. I'll just install from the net using PXE boot. I boot up the Soekris machine, and it won't display anything to the serial port. I try two different machines, and all the possible baud rates, and nothing displays. The red error lite just turns on and stays on.
Ok, so scrap the Soekris machine. I also happen to have a laptop with a broken LCD. I take apart the laptop and unplug the LCD, so it won't be using any power. It's a low-powered laptop (1ghz Transmeta processor), so it won't be using much power. I already had fedora installed on it, so setting up the rest of the software was easy. I then turned most everything off, and set the hard drives to read-only (mount -o remount,ro /). This way the hard drive won't be clicking through the night.
People gave me some suggestions as to features they'd want in software like this:
- Current Weather / Weather Forecast
- Schedule for Today
- Traffic Patterns
- News/Sports/RSS Reader
- Subjects of new Emails received over night
- Breakfast/Coffee/Tea
- Time synchronization to an atomic clock
I figure my next steps will be to add weather and my schedule. Since this laptop has a wireless card in it, it will be easy to get internet access on it.