Looking back on all the Raspberry Pi things I've worked on in the last year, a trend started to emerge. In almost every project I found myself using it as an easy connection to the Internet. Sometimes that involved actually controlling something with the built-in GPIO pins, other times an Arduino might do part of the work and the Pi would simply relay data from the serial port.
As I became familiar with the strengths and weaknesses of the various micro-controllers and single-board computers in my possession, I got comfortable assigning them specific roles based on what they did best. That meant I didn’t spend time fumbling around with an Arduino and some break-out board, trying to get online, just because I was using it to read a few sensors. The Raspberry Pi is much better suited for the network stuff.
After trying out different architectures in a handful of projects you realize some work better than others. I got a lot of mileage out of using cron jobs that would regularly call scripts to collect and send data back to a server with a JSON API. Eventually, as some projects grew, that started to get a little too complicated. I reached a point where I just wanted to control the Raspberry Pi. I wanted an easy way to ask it for something and have it respond.
With that in mind, I created a Python library that uses RabbitMQ messaging called: Pi-Control-Service. Once the service is started, it listens on a queue for messages. When a message is received, the service does some work and sends back another message with a result. So far, it’s been working pretty smoothly.