Since the announcement of the imp, one the misgivings I’ve heard is that it’s tied into electric imp’s cloud service. I understand that this is central to their business model, however tech savvy hobbyists may find it quite useful to be able to make network connections directly between imps and other devices on their LAN.
Just as I received my prototype imps the postman also delivered a shiny new Raspberry Pi. I thought it would be fun to connect the two gadgets, and perhaps go some way to satisfying the imp local connectivity issue.
I came up with this:
Imps are deployed around your house/garden/car/planet to perform a variety of interesting tasks. They require an internet connection as usual to connect with the electric imp Planner, an Amazon hosted cloud service. An additional imp, which I’m calling the Pimp (because I couldn’t resist it) also connects to the Planner. The Pimp provides a set of input and output ports which can be connected with other imps (or virtual imps known as vimps) using the standard interface, like this:
In the real world the Pimp is connected to a Raspberry Pi via SPI (synchronous serial). This is most conveniently achieved with an electric imp April development board and a simple cable to the Pi expansion header. The Pi can also power the Pimp.
The Pi runs Linux, under which a user space app can communicate with the Pimp using the spi user space device driver. Code on the Pimp forwards data received from connected imps over SPI (with source information) while code on the Pi forwards this data to defined sockets using TCP/IP. Data is also marshalled in the reverse direction, so data received on each socket is forwarded to particular output ports of the Pimp for connection to imps using the Planner. There’s a huge amount of processing power left over on the Pi, which might be rather a nice candidate as a complete home automation control centre, bringing together networks of imps, X10 and other devices.
There are, of course, some drawbacks to this design. The imp service is not removed from the loop so you still need a functional internet connection for all your imps, and the latency of marshalling data through the cloud remains. However the Planner is also a very convenient and friendly way of configuring and connecting imps together, and a Pimp is likely to comprise just one element of a home automation network or some such application. From my experiments so far cloud latency seems to be very good (the Atlantic ocean accounting for most of it, as the European service isn’t online yet). The Pimp won’t be good for transferring large amounts of data, but will be fine for the kind of real time control data the imp is ideal for.
I plan to show this project at the Bristol Raspberry Jam on August 20th and make the code available at that time if there’s any interest.