
Inspired by this, I set out to build myself a microprinter. That is, a receipt printer that would sit on my desk and print out whatever little bits of text I happened to send to it. Why would I want to do this? Well, first, I'd been looking for some kind of project that would result in a physical thing (too much software in my life normally). Secondly, I'm obsessed with notification systems. I don't trust myself to remember things, so over the years I've used a variety of what could laughingly be called "systems" for reminding myself of various tasks, dates, ideas, etc.... Before I started working at home, it was the rare day that I wouldn't come home with at least one or two random notes stuffed in my pocket. So the original idea was to make something that I could use to create unignorable physical reminders for myself. But first, I needed a printer.
I like the way thermal printed receipts look, so I looked for a thermal printer instead of a dot matrix variety. After perusing ebay a bit, I settled on the Epson TM-T88 series, which is the one you see pretty much everywhere in stores and restaurants (at least in my area). I wasn't willing to spend a fortune on it though, so it took me awhile to find a resonably priced one on ebay, but I finally did.
With the printer secured, I needed some hardware. A shopping list:
- Arduino Duemilanove
- Arduino Ethernet Shield
- Various little electronics bits
The general plan is for the Arduino (which is really just a little standalone programmable computer) to make periodic requests to a web service, and send whatever it receives to the printer. I'm not going to get into the electronics details because, frankly, I don't really understand it all that well. Plus, there was a large amount of frustration, false steps, cursing, trips to Frys and Radio Shack, and a little help from my friends (thanks Matt!) before I got it all working, and I'd rather not relive that. So let's just sum it up by saying that I finally got it working. If anyone reading this wants help building their own, well, there are probably much better sources of help out there than me, but feel free to contact me if you have any questions you think I might be able to answer.
With the hardware working, I could finally move to the more comfortable area of the web service. I set the Arduino/printer rig up so that it sends periodic requests to my server, and if it gets a correctly formatted response, it prints it out. The web side is a pretty simple Django app. It has a basic Message model, and a view that returns any unread messages. When the request comes in from the Arduino, it also checks to see if it needs to run any message gathering jobs, which is based on the time since the job was last run. So, for instance, I run the Twitter job every 15 minutes, and the Trac job every 10 minutes. I originally planned to run these jobs via cron, but my server setup doesn't let me run cron jobs more fequently than hourly.
The messages currently come from three sources:
- A simple form where I can send reminders to myself. This just directly creates a new Message object and adds it to the queue.
- Twitter messages. I check for any @replies or direct messages to myself, plus any tweets from a few friends who update relatively infrequently.
- Trac tickets. The job fetches the Trac RSS feed for all tickets and prints out any new ones.
This was a fun little project, and although it ended up taking a lot longer than I expected it to, I'm pretty happy with the results. If anyone has any other ideas for interesting message sources, please share! The only other ideas I have at the moment are a grocery list (print it out at the press of a button), and a daily calendar summary (publish my iCal calendar to my server, and print out a daily summary out every morning).
