Running Python on a micro controller is not something you hear every day. But ever since the MicroPython Kickstarter campaign got funded, it has become a reality.
MicroPython is a rewrite of Python 3, targeted towards 32 bit ARM series. This means you can pretty much run all the standard Python code right on your tiny embedded device. It’s something even seasoned embedded software developers have been waiting for. Building a small application without the need to play around with pointers or making sure that you do not have memory leaks.
The downside is that you cannot easily benefit from what the Python developers have done so far. For that to work the entire core Python library has to be ported. But even if everything gets ported, there are limitations due to the nature of the device: your microcontroller doesn’t really have a file system and it very often does not have built-in networking.
picoTCP easily integrates in projects running on an ARM MCU, so it was only a matter of compiling everything together, providing architecture code and a networking driver and you’re running the stack right next to MicroPython.
More effort has been spent on getting TCP fully integrated. This required adding C code to form a wrapper around the picoTCP API that provides an interface that Python can work with. This is what we are calling Python Whelp. If you didn’t know about what was happening under the hood, you’d think that it is just another Python 3 installation. The usual networking API is (partially) implemented, so you could, in theory, add a Python library that makes use of TCP right on top of the current code.
Using MicroPython’s prompt (runs over a serial connection) you can quickly and easily set up sockets right from the command line. This is great for prototyping an idea really quickly and it gets rid of any frustrations you might have while developing C code. It’s not as CPU/memory efficient as running C code, but during prototyping and development this should not be of too much concern. Imagine how you could get that nice little board to do whatever you imagined in a matter of hours, rather than a matter of days. Need to impress your customer quickly? This is the way to go!
PythonWhelp is still in its infancy and has not been made publicly available yet. However, if you’re interested in the project just send us an e-mail or poke us on Twitter or Facebook and we’ll gladly provide you with the necessary things to get you started.
If you would like to know more about MicroPython, please check out their website: http://micropython.org/. We would like to thank Damien George and George Robotics for all the work they put into making MicroPython possible. They didn't just port Python to your favorite board, they actually rewrote it from the ground up! While you're at it, have a look at their GitHub page, where we got most of our mustard.