I wanted to play with electronics and home automation. This is what I came up with.
The following sequence of events is not just a dramatization. It happened yesterday.
- The UPS delivery guy delivers a package and pushes my doorbell button.
- The button rings my doorbell and switches a relay.
- The relay drives a pin high on the GBA port on the Nintendo DS.
- A homebrew app runs on the DS which reads from EEPROM every frame, effectively polling the relay state.
- The DS connects to my wireless access point, sends an HTTP request to my server, and then goes offline again.
- The HTTP request executes a CGI script which connects to a chat server I've been working on, sends a message, and then disconnects.
- The chat server stores the message and sends it to any connected clients.
- One of the clients, which was the result of an AJAX request, returns the new message to a web browser.
- Cory, in his web browser, is notified that a package has arrived.
- My front and rear doors are monitored separately, hence the two relays.
- There are two pulldown resistors on the GBA port pins. I think they're unnecessary if I cause the DS to drive them low before I start reading.
- The DS app is a trivial modification of the httpget demo.
- This isn't in fact useful, but it was fun, easy, and made almost entirely with stuff I already had.
- The DS is a neat alternative to a microcontroller, if you happen to have a spare or two lying around. It doesn't draw much power, as an ARM chip or two running with the screens off, and it has its own battery back-up.
I have been looking for a computer to run on my TV for a while, lately. I thought my constraints were fairly reasonable. I wanted something fairly quiet and small. It didn't have to be super small, but I didn't want, "oh, you jacked a computer into your TV in your living room" to be a common first reaction. It didn't have to be super quiet, but moving parts tend to fail on me, and quiet things have fewer fans. Playing 1080p video is nice but not absolutely essential.
I almost bought a Mac Mini. I almost stuck a full tower in the basement and ran cables upstairs. I didn't really want either of those.
After months and months of Engadget taunting me with previews of hardware that is either not yet available or never going to be available in the US, I bought the first thing that met my requirements.
It arrived without an OS (as desired). I threw Jaunty Jackalope x86_64 on it, and I have been pleased.
For video, I'm begrudgingly using the latest closed source drivers from nVidia (185.18.31). I hate nVidia less than ATI/AMD, currently.
Audio was an adventure. Analog output as well as optical and digital over HDMI all worked out of the box, but pulseaudio fought me at every turn. I ended up grabbing the latest PPA of pulseaudio, which fixed most of my problems but seems to have deprived me of surround output. This is what I'm still using currently.
I also found it necessary to use VDPAU, which seems to be nVidia's proprietary video decoding on the GPU API. After grabbing a custom build of mplayer and rifling through documentation, mplayer -vo vdpau -vc ffh264vdpau had me watching 1080p content without issue. Decoders for mpeg1 and 2 and some WMV-related codecs also seem available.
In summary, I like it, and I spent a third of what I would have spent on a Mac Mini, but I had to wait about six months.