After coming across a great tutorial on pikiosk on how to interface a thermal printer with a Raspberry Pi I knew that I had try building one of those. I wasn’t as interested in printing graphics rather than making it easily accessible, so I chose to use their code as a basic service for printing text and doing everything else in a small web frontend; which gave me an opportunity to delve into Symfony 2.
With the tutorial above, connecting the Pi via GPIO was a piece of cake and most of the time consisted of finding a stable pin connection without soldering it into place (male pin header casing without pin worked very will together with breadboard cabling). The Pi’s GPIO connector is really the key element for its usefulness and fills a great niche there. Without a full Linux doing anything non-trivial with networking isn’t really fun on. This is especially true for Arduino and Android is still to cumbersome as an intermediary there (but that’s a different post).
The casing itself is a pretty durable spare tupperware container I had lying around, a bit too durable to work smoothly with it. Should I work on another enclosure I’ll likely choose a thinner plastic or similar material. Nonetheless, a Dremel with a cut-off wheel and a drill was sufficient to cut a square hole in the top and a hole to feed the power cabling through. A spare wifi adapter provides connectivity.
I really enjoyed working with the structure and tools that Symfony provides and how the documentation makes it easy to create a clean and structured project from scratch. The web debug toolbar (see here) in particular is a nice tool to efficiently debug your application. Having some of those elements such as routing and Twig in Drupal is going to be a great advancement.
The only thing which was annyoing here was the template inheritance structure, the documentation could be a bit more detailed on this topic. In particular how and where Twig uses extend to inherit elements and which are automatically aggregated, which are manually deployed and so on.
Making printouts with TinyPrinter is surprisingly addictive. The code is on Github.