Part 1: Wrangling Redis, Gevent, SocketIO and Django
So the other day I was digging around a storage space under neath the step in our apartment and found something awesome. I found the little box and all the wiring for our doors buzzer. It completely exposed and ready to be fiddled with. This discovery paired with seeing this bad boy Spark Core got me thinking of all sorts of cool things you could do with small WIFI enabled micro-controllers.
The Spark Core is a pretty slick computer on a chip. It has a wifi chip built onto the board that is super simple to configure and also allows you to program it wirelessly. It’s pretty cool because it uses a REST API to let you control all the IO pins on it using simple HTTP requests. The company runs a cloud service as an intermediary for who ever buys it which is also pretty slick.
It got my thinking though. Why can’t I make some sort of simple REST API for all the different brands of micro-controllers that are out there. It would cost maybe 4 bucks to host a site with a simple REST API to control some microchips. Last fall with the help of my friend Ranulfo we coded an Android app that can connect to one of the micro’s and turn a light on and off but it was a total pain because you have to sync both devices and be on a LAN. So we decided to go for version 2.0 and move it to the CLOUD.
So now we were coming back to the project and are beginning to hack together some sort of similar functionality that the Spark Core has. I am in charge of making the REST service and Ranulfo is programming the Beaglebone Black we are using for testing. Our goal is to be able to manipulate any of the digital pins and read the state of the computer.
I wanted to write the server in Python, preferably use Django because it has a killer REST Framework and its easy to make a nice web interface with authentication. What would probably have been pretty straight forward project soon grew by an order of magnitude…
Next post is going to be about Redis, Socketio and other neat things