Development platforms and frameworks
ESP32 is quite popular. Therefore, there are a good number of options that you can select as your development platform and framework.
The first framework, of course, comes directly from Espressif itself. They call it the Espressif IoT Development Framework (ESP-IDF). It supports all three main OS environments – Windows, macOS, and Linux. After installing some prerequisite packages, you can download the ESP-IDF from the GitHub repository and install it on your development PC. They have collected all the necessary functionality into a single Python script, named idf.py
, for developers. You can configure project parameters and generate a final binary image by using this command-line tool.
You can also use it in every step of your project, starting from the build phase to connecting and monitoring your ESP32 board from the serial port of your computer. If you are a more graphical UI person, then you need to install Visual Studio Code as an IDE and install the ESP-IDF extension on it. You can find the ESP-IDF documentation at this link: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html
The second option is the Arduino IDE and Arduino Core for ESP32. If you are familiar with Arduino, you’ll know how easy it is to use. However, it comes at the cost of development flexibility compared to ESP-IDF. You are constricted in terms of what Arduino allows you to do and you need to obey its rules.
The third alternative you can choose is PlatformIO. This is not a standalone IDE or tool but comes as an extension in Visual Studio Code as an open-source embedded development environment. It supports many different embedded boards and frameworks, including ESP32 boards and ESP-IDF. Following installation, it integrates itself with the VSCode UI, where you can find all the functionality that idf.py
of ESP-IDF provides. In addition to VSCode’s IDE features, PlatformIO has an integrated debugger, unit testing support, static code analysis, and remote development tools for embedded programming. PlatformIO is a good choice for balancing ease of use and development flexibility.
The programming language for those three frameworks is C/C++, so you need to know C/C++ in order to develop within those frameworks. However, C/C++ is not the only programming language for ESP32. You can use MicroPython for Python programming or Espruino for JavaScript programming. They both support ESP32 boards, but to be honest, I wouldn’t use them to develop any product to be launched on the market. Although you may feel more comfortable with them because of your programming language preferences, you won’t find ESP-IDF capabilities in either of them. Rust is another option as a programming language to develop IoT applications on ESP32. It is getting some attention in the embedded world and seems worth trying on ESP32. However, in this book, we will develop the applications in C++11 as the modern C++ standard supported by ESP-IDF.
Throughout the book, we will use Visual Studio Code as the IDE and ESP-IDF as the development framework with its integral tools. PlatformIO is also very popular among developers, and we will see some of its features in the next chapter.
We will discuss the real-time operating systems available for ESP32 next.