Today, I'm going give more to the open source community by releasing some of my code on GitHub. Starting by a project I had for a while, that is starting to take shape. It's a "SmartPlug" application. A device that helps you controls your appliances connected to your home socket. I started the project on an Orange Pi, controlling a mechanical relay board via i2c thanks to a MPC23017 chip. It was working well, I even integrated it to Django with a page to control through a web page each switch. But i2c was a limiting factor. Although I learned a lot during this project, its usefulness pretty limited because you needed a a cable with limited length to control your plug.
Last year, I discovered the ESP8266 WiFi Module. A great chip with great capabilities. I immediately bought a bunch of them. looked what was possible to do with it and it sounded interesting. There is great firmware called nodemcu for ESP8266 that allow you to easily program the chip and add or remove LUA code without recompiling. At first sight it seems very promising with a great documentation, but when you start to make moderate complex application, everything start to fall apart. First, you hit the memory barrier, being on a such small platform, the memory is limited and running an interpreter is not really an option. So, you start to produce bytecode on the platform, but you have to do it on the platform, it's slow, it takes time and being new to LUA does not help. Finally, even executed on in the bytecode form, your responds slowly and the board reboot because of the lack of memory. Even with this I think nodemcu has some potential, especially with the successor of ESP8266, the ESP32 that will be more powerful.
After this experience I reluctantly wanted to program directly in C the board. I should have probably started here. But the learning cure is much more steeper, not because of C of which I am familiar with, but because of the framework that is more difficult to apprehend. It was finally not so difficult, but at this point I have probably spend an equal time preparing the project than to actually produce code. But once everything is set, you can advance at a faster pace that with nodemcu. Compile your code, flash the chip, run it in two command lines with the help of make.
Where am I today? I'm able to control GPIO of the chip with a web server that I have programmed. It's a small, maybe not fully functional server, but in this case it's working well. Now I need to test the response capabilities, add a REST interface with json to be able to control the plugs with a web app, make the flash readable and writeable to save the configuration and I may also add a discovery mechanism.