Hi its been a while since the last post, sorry about that. So in the last few month’s, i was playing with the idea of doing some projects with IoT devices and python. I knew that IOT and electronic hobby projects were a very expensive proposition, so I decided early on that I wouldn’t pour huge sums on the problem and not invest on new kit and more expensive equipment at least that’s the plan.
enter esp8266 (aka the GOAT chip)
what can I say about this board which hasn’t been said already, To say that its very capable is a gross understatement . I feel its a good litmus test to know if you really want to do tech if you don’t fall in love with this I’m not sure I can recommend a future in the tech industry as a developer. For this project, I am using a wemos d1 mini board.
The esp8266 embodies all things good about programming . its fast, fun, cheap, connected, has great community support and you can do almost anything with it. But great hardware also has a great problem the end user, let me explain if you give me a race car and ask me to go fast around a track most likely I will crash. Similarly, it takes years of practice and training to be competent at IOT and electronics. But every so often there comes a great innovation in software which makes a task like driving a race car as simple as operating a washing machine.
enter MicroPython (aka infinity gauntlet)
python is powerful(obviously) but ask anyone why c is still popular and so powerful the answer is that nothing else will come as close to bare metal as c does , you can write programs for a server and if you have enough memory cross compile it to some obscure processor the size of a rice grain, okay this wont work always but it is possible. And that is why I feel micro python is a breath of fresh air in the programming language space which is obsessed with more and more features. Its Python in a microcontroller, an appropriate metaphor for this would be like if you could get super serum in your local drug store.
enter MQTT (aka the nerve center)
great now we have the main components of our project but we still need some software to make communicating with the different pieces very easy. Mqtt is an industry standard message queue protocol used in IoT devices and there is lot of support and a large set of community developed tools. And is it so happens newer versions of micropython come baked with a mqtt client library (mind = blown) .
putting it all together
I really love remote cars but they are limited to an analog remote and exist in a sort of isolated space. I wanted to make my RC remote car into a wifi car I bought the cheapest RC car I could find and started looking online for schematics and instruction sets for the ic on the board and as it so happens I came upon this beauty RX2C, the RX2C is found in most if not all cheap RC remote cars . so in true hacky fashion, I just soldered the four gpio pins of the wemos d1 mini to the LEFT, RIGHT, UP and DOWN pins of the.
Some python and mqtt code to put it all together. I have made a GitHub repo for the code here.
Bonus: here is a poster I made for the Chennai python conference PySangamam.