
Build an extensible ESP32 wifi LAN app with ftp server, web-based ota updates, dash 22 sensor data, and non-volatile storage for wifi credentials.
Identify the ESP32 hardware and compatible dev kits, including a DHT 22 sensor and breadboard, and set up the Eclipse IDE and ESP-IDF tools for compilation, flashing, and debugging.
Explore the course structure for building an ESP32 IoT app with ESP-IDF, covering template project setup, wifi-based http server, non-volatile wifi credential storage, OTA updates, and DHT22 sensor data.
Explore Espressif dev kits for the ESP32, focusing on the rover and pico kits, with setup options, headers, pin layout, schematics, datasheet, and USB/UART driver guidance.
Install the Eclipse IDF plug-in on Windows, an all-in-one setup that includes the ESP32 toolchain, build tools, and ESP IDF; covers offline installer and workspace setup.
Explore the ESP-IDF build system and CMake overview, learn the project structure and idf_py menu config, and see how components, partitions, bootloader, and OTA enable a humidity sensor web server.
Open Eclipse, connect the ESP32 devkit, create an ESP-IDF project, configure the sdk and serial flasher, adjust the partition table for OTA, resolve the certificate issue, then build and flash.
Explore ESP-IDF example projects via the API reference and GitHub, and use SPF eclipse to access, build, and flash a sample.
Navigate the ESP-IDF FreeRTOS environment and its differences from vanilla FreeRTOS. Learn task creation with xTaskCreate on the ESP32's multicore architecture, and understand task states and vTaskDelay.
Explore robust error handling in ESP-IDF with the ESP ADF, using the ESP error check macro to manage recoverable and fatal errors and convert codes to messages.
Learn the embedded C coding style used in this course for ESP-IDF projects, including header and source file conventions, the _E and _T suffix naming, prototypes, and essential ESP-IDF includes.
Explore the ESP IDF components library with sensor drivers, learn how to integrate it into your project, and access documentation and examples on GitHub page, including BM680 sensor example.
Clone and integrate the BME 680 sensor library into an ESP-IDF project, update the top-level build to include the component, and run the example to read measurements.
Explore the master branch with finalized source code for this course and learn how to contribute via the contribution station improvements branch; message for improvements and enable watch notifications.
Implement rgb status leds using the ESP-IDF led control component, configuring timer, channels, and duty cycles to indicate wifi started, http server started, and wifi connected.
Program ESP32 rgb LED with ESP-IDF by configuring red, green, blue GPIOs and pwm channels, and implement status colors for Wi-Fi and HTTP server indicators.
Explore how the ESP32 wifi implementation in ESP-IDF uses an access point and station mode, DHCP IP assignment, and an HTTP server to coordinate wifi and web events.
Configure a wifi application on the ESP32 with ESP-IDF by adding source and header files, defining AP and station settings, beacon interval, channel, IP, netmask, and message queues.
Define and manage the Wi-Fi application task in a FreeRTOS-based ESP-IDF project, including setting task priorities, cores, event handling, queues, and starting the Wi-Fi and HTTP server.
Learn to implement an ESP32 wifi application using ESP-IDF: define and register wifi and IP event handlers, configure a soft AP with static IPs and DHCP, and manage connection events.
Initialize non-volatile storage (NVS) with robust error handling, start the wifi application, connect to the esp32 network, and observe the DHCP server assigning an IP while the http server starts.
Learn how the http server on the ESP32 using ESP-IDF serves web page files (html, css, js) and supports OTA updates, temperature and humidity readings, and connection controls.
Embed web page assets and wire up the ESP32 http server by organizing the web page folder, updating build files, and defining the http server task, monitor, and message queue.
Learn to implement an ESP32 http server with the ESP-IDF, configuring httpd, creating a server task, and registering uri handlers for jQuery.js, index.html, app.js, and favicon.ico to serve embedded files.
Define and wire jQuery, index.html, CSS, app.js, and favicon handlers for the ESP32 Httpd server using the Httpd request and response API, and verify via browser.
Create and manage an http server monitor task on the ESP32, using a message queue to update global variables and coordinate inter-task communication with the web server.
Configure a partition table with OTA zero, OTA one, and OTA data in ESP-IDF, upload the firmware via a web page, and manage OTA begin, write, end, boot, and restart.
Define ota update statuses (pending, successful, failed) and implement http post handlers for /ota update and /ota status endpoints to let the web app react to firmware updates.
Implement ota status handler returning json with compile time and date to the web page, and configure a firmware update reset timer with reboot logic based on ota success.
Build and flash a firmware update test on the ESP32 using the ESP-IDF, then perform an OTA update via a web page, monitor terminal output, and verify reboot and reconnect.
Note: This course is compatible with ESP-IDF 5.x.
ESP-IDF 6.0 may introduce breaking changes and is not officially supported yet.
General Description & Background Information:
In this course, we'll develop a feature rich WiFi based application using the ESP-IDF (Espressif IoT Development Framework), Integrate an ESP-IDF Components & Sensors Library and configure the ESP32 to connect to AWS IoT and Publish/Subscribe messages via AWS IoT Core using the MQTT protocol.
WiFi is commonly incorporated into many IoT and Industrial IoT solutions and is the basis of the application developed in this course which enables AWS IoT cloud connectivity (or any compatible cloud framework that you choose).
The ESP32 is a series of low-cost, low-power, SoC (system on a chip) series of microcontrollers with integrated WiFi and dual-mode Bluetooth. The ESP-IDF is Espressif's official IoT Development Framework for the ESP32. It provides a self-sufficient SDK (software development kit) for any generic application development, using programming languages such as C and C++. ESP-IDF currently powers millions of devices in the field, and enables building a variety of network-connected products, ranging from simple light bulbs and toys, to big appliances and industrial devices.
The ESP-IDF runs FreeRTOS, which is widely used in embedded systems, so the techniques and knowledge you gain while developing IDF-based applications for the ESP32 will translate well should you use other MCUs running FreeRTOS. Additionally, the FreeRTOS kernel of the ESP-IDF is modified for multicore support and we will utilize both cores of the ESP32 in this course.
If you are interested in working with the ESP32 and are serious about improving your embedded software development skills while getting to know this incredible SoC, then harnessing the capabilities of the ESP-IDF directly, is an excellent way to go.
The IDF is well designed, and once you get going, implementing new features becomes a breeze. Further, any new updates, bugfixes, or changes to the ESP-IDF can be immediately available to you in a flexible way without having to wait for the Arduino port to be written.
About the Course:
For many, the best way to learn is to start with a project, which is why in this course, I have created a robust WiFi based application that is able to connect to a cloud framework (AWS IoT in this case), as a learning tool - as opposed to demonstrating tiny examples that you could easily find online.
The intended outcome of this course, is that you become comfortable developing applications using the ESP-IDF, gain insight from the application code, inspiration for your own projects and ultimately, save you time in learning to use various components of the ESP-IDF.
By working through this project, programming step-by-step through each lesson, I'm confident that you will feel comfortable developing an extensible WiFi based application and integrating a cloud framework using the ESP-IDF, or any application using the ESP-IDF, as it will become apparent how to create a plan of action when using Espressif's IoT Development Framework -> utilizing the Espressif documentation, looking up the API reference and relevant functions, and applying what makes sense to accomplish your goals.
Furthermore, in this course we will not focus on theory as this is a practical application programming course where you learn by doing. However, I will briefly present background information about the ESP-IDF application programming interface that applies to each section and a brief overview of the application requirements for each section. These overviews will describe what will be accomplished and how we are going to accomplish it using the ESP-IDF.
Lastly, I have chosen to develop this project utilizing the ESP-IDF Eclipse Plugin (or Espressif IDE), which is available for Windows, MacOS, and Linux, and provides an all-in-one installation that includes the Eclipse IDE, and all prerequisites required for ESP32 development; enabling us to get started with programming, flashing and monitoring the ESP32 directly after installing. The setup process is quite easy and efficient, especially for Windows users...
Other Noteworthy Highlights:
Modular programming style used.
Utilize both cores of the ESP32 and create tasks using xTaskCreatePinnedToCore.
Use FreeRTOS message queues for inter-task communication.
And, FreeRTOS binary semaphore for signalization from an interrupt service routine (ISR).
State machine in WiFi application allows for future growth and customization.
Use Non-Volatile storage for saving and loading WiFi credentials for connecting the ESP32.
Learn an efficient workflow for developing an HTTP server and web page.
Learn how to implement an OTA (over the air) firmware update over the WLAN by sending the update file via a web page to the ESP32.
Learn how to integrate a cloud framework - we will integrate the ESP AWS IoT framework to enable communication with AWS IoT Core.
Learn how to publish data (e.g., temperature, humidity and WiFi RSSI) from the ESP32 to AWS IoT using the MQTT protocol.
Learn how to subscribe & publish data to and from the AWS Dashboard.
Learn how to integrate an ESP-IDF Components & Sensors Library.
Hardware:
- ESP32 DevKit
- RGB LED and Resistors
- DHT22 Sensor or any sensor(s) from the ESP-IDF Components & Sensors Library
- Jumper Wires
- Breadboard
Software:
- ESP-IDF Eclipse (Espressif IDE)
We'll use Google Chrome for testing the web page functionality