Why I love the ESP8266

Underneath the silver square on the larger, rectangular breakout board sits my favourite micro-controller, the ESP8266 by Espressif – the perfect* starting point for all your IoT projects.

Not only are these little super-stars crazily cheap, less than $10 each, they can run from batteries, have a deep sleep mode to conserve power and yet have WiFi built in – along with digital I/O pins, an Analog to Digital Converter and more …

For programming, I’m a fan of the Arduino framework which fully supports these micro-controllers and is not only easy to use but has a wealth of libraries and support available on the internet. You can get the Arduino IDE from arduino.cc and  the ESP8266 Arduino SDK is maintained on github.com

There is an abundance of web help for getting going with this combination, and I’m not going to repeat or dive deep with that here. You could do worse than begin with this README.md from the link above.

UPDATE

Since I began my IoT projects, Amazon has taken stewardship of FreeRTOS, a different (non-Arduino) operating system for micro-controllers that is more suitable for robust commercial applications than my little hobby projects. Amazon FreeRTOS doesn’t yet run on the ESP8266 but does run on the more powerful ESP32 and I’m planning to migrate my projects to that combination in future as time permits.

*Well, almost perfect.

One of the challenges with memory and cpu constrained micro-controllers is negotiating a secure connection to the cloud service where you may be sending and receiving messages. In particular, performing validation of the certificate chain is – or at least was when I began, beyond the capabilities of this little chip.

It is still capable of negotiating a TLS 1.2 connection and using a client X.509 certificate to authenticate, which is good, but it’s important to note that without being able to validate the server certificate, a man in the middle attack is technically possible. I elected to accept this risk for my tinkering, however I have now begun to migrate to the big brother to the ESP8266, the ESP32, which is capable of making a more secure connection by validating the server provided certificate chain.