PLEASE NOTE THIS POST IS NOW OUT-OF-DATE. The Go Free Range printer is now at http://exciting.io/printer/ – I’ve not updated my Raspberry Pi code because my own thermal printer is broken, and will only spew out lines saying ‘CP437′ – if anyone knows of any possible fix, I’d be very grateful.
I love the idea of the Berg Little Printer, but it’s expensive: a self-contained box that lets you rip & read internetty stuff such as weather, messages, diary events, travel news, whatever anyone can think of. I already have a thermal printer I used for my Little Box of Poems, so I decided to make an open source GoFreeRange internet printer instead. The GoFreeRange printer normally uses an Arduino, but as I have the wrong kind of Arduino, I wanted to use a Raspberry Pi instead.
You can read more about little thermal internet printers in this Wired article from 2012.
Here’s roughly how I did it (more details to follow):
- I made a fresh Raspberry Pi SD card using the normal default Raspbian Wheezy disk image: http://www.raspberrypi.org/downloads
- I got the Raspberry Pi on t’internet using a wifi dongle, setting it up using the GUI wifi tool on the desktop, and enabled SSH using the raspi-config tool so I could log into it from a computer with no keyboard or mouse connected to the Pi. I also used the raspi-config tool to expand the disk image to fill the SD card and update the system software. I did not get the Pi to boot into the graphical environment at startup, as I was going to be running it ‘headless’.
- I powered up my thermal printer and connected it to the Raspberry Pi in the same way I did with The Little Box of Poems. I put the Raspberry Pi and printer in an old washing tablet box.
- I followed Andrew Nicolaou’s instructions: https://github.com/andrewn/raspi-printer#readme - I changed the baud rate in cmdline.txt – this causes the Raspberry Pi to send its Linux boot messages to the printer as well as the video output. It’s a bit verbose – I got a yard of nerdy gubbins spewing out of my printer, but it worked. (You can disable this if you like, see below).
- Then, following Andrew’s instructions, I installed the python-serial library. I was a bit thrown about the bit where he says to save a file with your unique printer ID. I didn’t have one, and I didn’t know how to get one. It seemed like a bit of a catch-22, so eventually I just ran his printer.py script anyway.
- I then went to this page on my desktop computer and made a note of the printer URL: http://printer.gofreerange.com/my-printer – somehow the file with my unique printer ID seemed to get made in the process. I did a test print – it worked!
- Then, having saved my printer URL in a notepad, I signed up for Printer Mail – http://printer-mail.herokuapp.com/. This means people can send messages to my printer by filling in a simple form on a web page. Brilliant!
I had a couple of kernel panics – the Pi rebooted itself without warning. Not sure why, need to investigate. I’d like to make the boot-up text a bit less verbose too.
As I’m running the printer script manually, I need to follow Andrew’s instructions on getting it to run automatically when you boot the Pi up, and get all the gubbins in a self-contained box.
People sending my printer messages from anywhere they can get on the internet all over the world is pretty damn cool, but other possible uses include waking up to a daily printed weather report and printing paper bookmarks customised for the book you’re reading. Or print out anything you star in Google Reader. What’s that you say? Oh well, you get the idea.
The Raspberry Pi version of the GoFreeRange printer doesn’t have a button – it just prints anything that’s sent it. I have a big red shiny button in my printer box that’s going spare, but I quite like the idea that no human intervention is required, it just squirts out… stuff.
I’ve been away from my printer all day, working a late shift. Quite excited to see what might be on it when I get home…
What’s next?! Excited… very excited.
I also signed up for the Printer Paint app – so you can draw me a picture on your computer and send it to my little printer. I love pictures appearing on my printer – send me one! http://printer-paint.herokuapp.com/send/blogmywiki
I’ve now disabled serial port login on the Pi, to see if that helps with stability – following the instructions here: http://www.hobbytronics.co.uk/raspberry-pi-serial-port. I did this when I made the Little Box of Poems, and it seems like a good idea. You just comment out the last line of /etc/inittab, the one that reads
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
by putting a # (hash) at the start of the line. There are also instructions there on how to stop the printer spewing out all the Linux boot-up info when you turn the Pi on.
Post-script to the addendum
I had trouble getting the Python script to run at startup. This is quite important, because I want my little printer to just start working – and stay working – when I plug it in. I don’t want to have to log in by SSH to start the script running.
I couldn’t get the update-rc.d method to work, so instead I edited /etc/rc.local by typing
sudo nano /etc/rc.local
and adding the line
sudo python /home/pi/raspi-printer/printer.py
to it. This seems to work.