DIY Projects

ESP32. Getting started with ESP32-Arduino on IDE Arduino, macOS, Windows, Linux

The ESP-Arduino development kit (for Espressif IoT Development Framework) for the Arduino IDE allows to develop code for all development boards based on ESP32. It provides access to most of the functions of the ESP-IDF library. It is very easy to install from the library manager of the Arduino IDE. It is also possible to use the ESP-IDF framework from the command line from the Terminal (macOS or Linux) and PowerShell (Windows). 

 

The Espresso Development Kit (SDK) for ESP32 boards is available on GitHub . It is compatible with the Arduino IDE for macOS, Windows, Linux 32-bit, 64-bit and ARM chips (Raspberry Pi, Orange Pi, etc …). Very detailed documentation is available here .

The framework is constantly evolving … and so is the technical documentation. Be careful to choose the version used before accessing the documentation. Latest is the most recent version

Install the ESP32-Arduino Framework for ESP32 on the Arduino IDE

Now that the ESP-IDF framework for ESP32 development boards is directly available from the board manager of the Arduino IDE, the installation procedure is the same whatever the operating system (Windows 10, macOS, Linux, Raspberry Pi OS , Armbian…)

1 Open the preferences panel from the Arduino menu

2 click the button to the right of the Additional board manager URL option .

3 In the dialog box that opens, add the link below and click OK

https://dl.espressif.com/dl/package_esp32_index.json
Please note, one line per URL.

There is also a link to the version under development (release). This version is not recommended for production. It makes it possible to evaluate the new functionalities under development.

https://dl.espressif.com/dl/package_esp32_dev_index.json

4 The link to the repository is added to the list. Close the settings by clicking on OK

5 Open the board manager from the Tools menu then Card type

6 Search for the SDK with the keyword ESP32. Choose the board package named ESP32 by Espressif Systems then click on install.

Now that the ESP32 development board are managed from the board manager, the libraries can be updated as soon as a new version is available.

Wait for the framework to be downloaded and installed from the internet. The installation process is fully automated. There is absolutely nothing more can be done.

Check that the ESP32 boards are correctly installed

The framework supports development boards built around the following chips.

Module Chip Flash memory

(MB)

PSRAM

(MB)

Antenna
ESP32-WROOM-32 ESP32-D0WDQ6 4 PCB
ESP32-WROOM-32D ESP32-D0WD 4, 8 or 16 PCB
ESP32-WROOM-32U ESP32-D0WD 4, 8 or 16 U.FL
ESP32-SOLO-1 ESP32-S0WD 4 PCB
ESP32-WROVER (PCB) ESP32-D0WDQ6 4 8 PCB
ESP32-WROVER (IPEX) ESP32-D0WDQ6 4 8 U.FL.
ESP32-WROVER-B ESP32-D0WD 4, 8 or 16 8 PCB
ESP32-WROVER-IB ESP32-D0WD 4, 8 or 16 8 U.FL

Once the installation is complete, there is no need to restart the Arduino IDE.

Open the Tools menu and then the Card type submenu. Scroll down, if the installation was successful you should be able to select your ESP32 development board from the list.

If you can’t find your board in the list, you can try a generic configuration, for example:

The list of boards changes with each update, however here is a small overview of the boards currently supported:

Check that everything is working by flashing an LED

The ESP32 is programmed exactly like an ESP8266 . Here we will simply check that everything is correctly installed. Create a new project and paste the following code which flashes an Led connected on pin 15.

/*
 * ESP32 Dev Board Test
 * Led blinking
 * projetsdiy.fr - diyprojects.io
 */
int ledPin = 15;

void setup()
{
    pinMode(ledPin, OUTPUT);
    Serial.begin(115200);
}

void loop()
{
    Serial.println("Hello ESP32!");
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
}

From the list of adapters, select ESP32 Dev Module. The modules generally support a download speed of 921600 baud which is very appreciable.

That’s it.

Install ESP-IDF command line tools

The development framework is also available in the form of a toolchain, command line compilation, configuration and debugging tools accessible from the Terminal (macOS and Linux) or PowerShell (Windows).

Install ESP-IDF on Windows

An installation utility named ESP-IDF Tools Installer is available on Windows.

Download version 2.3

The installer includes the compilers, OpenOCD , cmake, and Ninja build tool . The installer can also download and run installers for Python 3.7 and Git for Windows if they are not already installed on the computer.

Official Documentation

Install on macOS and Linux

By default, the tools should be installed in the ~/esp folder

Open a Terminal and run these commands to download the repository

mkdir ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git

then start the installation

cd ~/esp/esp-idf
./install.sh

Once the installation is complete, it is necessary to declare the paths in the environment variables

. $HOME/esp/esp-idf/export.sh

Common mistakes

-bash: idf.py: command not found

The path to the ESP-IDF directory has not been correctly declared

Run the following command depending on the environment

PowerShell Windows macOS or Linux terminal
.$HOME/esp/esp-idf/export.ps1
. $HOME/esp/esp-idf/export.sh

ESP32 tutorials and projects

Ready to get started, here are other tutorials and projects based on ESP32

Updates

2/10/2020 How to install ESP-IDF command line tools

06/3/2019  New SDK installation procedure compatible with all operating systems from the Arduino IDE board manager

Click to rate this post!
[Total: 0 Average: 0]
Exit mobile version