Ok, now its time to start developing for the ESP8266. Basically you can use it in two ways, either as a “wifi modem” using a different MCU for application (f.i. an Arduino) or use it standalone. My first project will be a simple humidity and temperature sensor for our cellar. The purpose is to monitor the climate in orde to make sure that no mold can grow.
The solution will look something like this:
- DHT22 sensor (measures humidity and temperature)
- Some central unit (probably a Raspberry PI) for data storage and monitoring
- Network using Wifi
- Power supplied by battery
The ESP8266 hardware would certainly meet these requirement by itself, the challenge is to have it run on battery. An Arduino based solution could poweroff the ESP8266 completely when not sending data, and this would consume much less power than using the ESP8266 by itself. My goal is to have the solution running for a year on some standard alkaline batteries.
Now when the hardware plattform is set, it is time to consider the software plattform. There are several options available:
Language: assembly, C/C++ and Lua
SDK: NON-OS SDK and RTOS SDK.
I have worked alot in C/C++ so for me deciding the language was easy. Lua is cerainly a good option as well, but it is a new language for me, and I also think that using a script language developing for embedded systems “feels” wrong. However, the CPU is quite powerful so it might work very well.
NON-OS SDK and RTOS SDK
For the difference according to Expressif, se this article
Initially I started to use the NON-OS sdk, again it felt right when developing for embedded systems to maximize control and minimize overhead. I have worked with some other MCU:s and I have always worked directly with the hardware without any OS. A big advantage when working with the ESP8266 is that if you decide to use the NON-OS SDK, you gain access to several very good and easy development environments:
The Arduino environment
As a hobbyist interested in embedded systems, it is impossible to miss the Arduino plattform. It has a large community, a great number of libraries and available open source software. It is certainly the plattform that will get you productive really fast. Nowdays, it is possible to use the arduino environment when developing for the ESP8266. I have not tried this myself, but if you have used Arduino before it seems like a good choice.
If I were to use the NON-OS SDK I would must certainly use Sming. Sming is an opensource framework which makes working with the ESP8266 really simple. If you come from an Arduino background, you will also be familiar with the API, it is very similar. The ESP8266 is a much more powerful plattform than Arduino, The Sming framework makes using the Wifi parts in ESP8266 simple, in wraps the ugly expressif API:s in clean and simple to understand API:s and makes using the “flash file system” Spiffy simple. In my opinion this is the best option.
Using the NON-OS SDK directly
It is certainly possible to use the NON-OS SDK directly. I preffer working on Windows and I am used to Visual Studio and also the Arduino environment, I had much difficulties to get it to work, I suppose if you are a Linux guy it would be much simpler. And, anyway I see no advantage of using it directly, use Sming instead!.
In my next post I will explain why I selected not to use the NON-OS SDK.