Skip to main content
Featured image for ESP-IDF Workshop: Basic

ESP-IDF Workshop: Basic

Table of Contents

Welcome to the basic ESP-IDF workshop!

Introduction
#

In this workshop, you will gain a solid understanding of the ESP-IDF framework, learning how to effectively use Visual Studio Code (VS Code) and Espressif’s official ESP-IDF extension for VS Code.

The workshop is divided into three parts. In the first part, we’ll verify that your development environment is properly set up by using the classic hello world example as a starting point. In the second part, we’ll dive into the network stack and build a simple HTTP server together. The third part will focus on two very common peripherals: GPIO and I2C.

We’ll also explore the component system and the component registry, which allows you to use libraries without manually managing dependencies or build system settings.

As a final exercise, we’ll combine everything to create a simple sensor gateway, integrating connectivity and peripheral control into a single project.

By the end of the workshop, you’ll have the basic skills needed to start developing your own applications based on ESP-IDF.

Estimated duration: 3 hours.

Agenda
#

The workshop is divided into three parts, each lasting for about one hour.

  • Part 1: Welcome and introduction

    • Lesson 1 – Introduction to ESP-IDF and the ESP-IDF extension for VS Code.
    • Assignment 1.1 – Verify your ESP-IDF and VS Code installation by compiling and flashing the hello_world example. Modify the example’s output text.
    • Assignment 1.2 – Create a new project starting from the blink example
  • Part 2: HTTP Connectivity

    • Lesson 2 – Connectivity: HTTP protocol, HTML, and REST APIs

    • Assignment 2.1 – Create an HTTP server that handles the GET request /index.html/ and returns <h1>Hello LED Control</h1>

    • Assignment 2.2 – Add the following routes to the HTTP server:

      • GET /led/on → turns on the LED and returns the JSON {"led": "on"}
      • GET /led/off → turns off the LED and returns the JSON {"led": "off"}
      • POST /led/blink → accepts a JSON { "times": int, "interval_ms": int } and makes the LED blink the specified number of times at the given interval
    • Assignment 2.3(Optional) Add the following route:

      • POST /led/flash → accepts the JSON {"periods": [int], "duty_cycles": [int]} and, for each element, calculates on/off durations to drive the LED accordingly
  • Part 3: Peripherals and Integration

    • Lesson 3 – GPIO, I2C, and the component registry

    • Assignment 3.1 – Create a new component to control the LED

    • Assignment 3.2 – Add a component to read the onboard environmental sensor

    • Assignment 3.3(Optional) Add the route:

      • GET /environment/ → returns the sensor reading. Choose the most appropriate JSON format to represent the data.

Prerequisites
#

To follow this workshop, make sure you meet the prerequisites listed below.

Required Software
#

Required Hardware
#

  • ESP-C3-DevKit-RUST-1 or ESP-C3-DevKit-RUST-2 board
    (if the activity is in person, the board will be provided during the workshop)
    It’s also possible to use an ESP32-C3-DevKit-M/C board, but you’ll need to adapt the GPIO configuration accordingly.

If the event is held in person, please complete the following before the workshop:

  • Install VS Code
  • Install ESP-IDF externsion for VS COde

If any issues arise, there will be a short window during the first exercise to complete the installation.

Basic Knowledge
#

  • Basic electronics
    • Resistors, capacitors, DC/DC power supplies
    • Reading an electrical schematic
  • Basic embedded programming
    • Flash memory
    • Difference between compiling and flashing firmware
    • Understanding of common microcontroller peripherals (mainly GPIO and I2C)
  • Basic C language knowledge
    • Header files
    • Compiler/linker concepts
    • Use of define, struct, and typedef
  • JSON and YAML data formats
  • HTML and its main tags (<html>, <body>, <h1>, <h2>, <p>)
  • Basic understanding of HTTP request methods (GET, POST) and the concept of URI and routes

Next Step
#

The next step is Lesson 1.

Conclusion
#

Congratulations! You’ve reached the end of this workshop. We hope it has been a valuable experience and the beginning of a deeper journey into Espressif’s tools.

You are now able to create, compile, and flash new projects, use external libraries and components, create your own components, and control everything through an HTTP interface.

You’ve therefore acquired the fundamental skills to develop an IoT application.

ESP-IDF Basics - Lecture 3

··7 mins
In this lecture we’ll explore how to include libraries inside ESP-IDF, external libraries, and components from the ESP Component Registry

ESP-IDF Basics - Lecture 2

··8 mins
In this lesson, we introduce the layered structure of Internet communication, explaining the ISO/OSI model and the data encapsulation process. We also explore HTTP and MQTT protocols, showing how REST APIs and the JSON format enable communication between IoT devices and applications.

ESP-IDF Basics - Lecture 1

··7 mins
In this lesson, we are preparing the ground for the first practical exercise. We introduce ESP-IDF, the official Espressif framework for IoT application development, then explore its architecture, main components, and development tools. We also examine the hardware used in the workshop, based on the ESP32-C3 SoC.

ESP-IDF Basics - Assign. 3.1

··4 mins
Create a led-toggle component and refactor the hello_led example using the component

ESP-IDF Basics - Assign. 1.2

··2 mins
Create a new project from the blink example and change the output GPIO pin via menuconfig