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

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email
Share on whatsapp

The ESP-IDF development kit (for Espressif IoT Development Framework) for the Arduino IDE allows to develop code for all development boards based on ESP32. ESP-IDF 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 ESP-IDF 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

Open the Arduino IE Preference menu

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

Arduino IDE Development Board Manager

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.

link sdk espressif esp32 ide arduino

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

Deposit to ESP32 boards (ESP-IDF)

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

2 install sdk espressif esp32 ide arduino

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.

install sdk espressif esp32 ide arduino

Check that the ESP32 boards are correctly installed

The framework supports development boards built around the following chips.

ModuleChipFlash memory

(MB)

PSRAM

(MB)

Antenna
ESP32-WROOM-32ESP32-D0WDQ64PCB
ESP32-WROOM-32DESP32-D0WD4, 8 or 16PCB
ESP32-WROOM-32UESP32-D0WD4, 8 or 16U.FL
ESP32-SOLO-1ESP32-S0WD4PCB
ESP32-WROVER (PCB)ESP32-D0WDQ648PCB
ESP32-WROVER (IPEX)ESP32-D0WDQ648U.FL.
ESP32-WROVER-BESP32-D0WD4, 8 or 168PCB
ESP32-WROVER-IBESP32-D0WD4, 8 or 168U.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:

  • ESP32 Dev Module
  • ESP32 Wrover Module
  • NodeMCU-32S

Select an ESP32 development board on the Arduino IDE

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

  • Adafruit ESP32 Feather
  • AI Thinker ESP32-CAM
  • ALKS ESP32
  • BPI-BIT
  • D-duino-32
  • MUST ESP32 DEVKIT V1
  • Dongsen Tech Pocket 32
  • Electronic SweetPeas – ESP320
  • ESP32 Dev Module
  • ESP32 FM DevKit
  • ESP32 Pico Kit
  • ESP32 Wrover Module
  • ESP32vn IoT One
  • ESPea32
  • Spectrum32
  • FireBeetle-ESP32
  • Frog Board ESP32
  • Heltec WiFi Kit 32
  • Heltec WiFi LoRa 32
  • Heltec WiFi LoRa 32(V2)
  • Heltec Wireless Stick
  • Hornbill ESP32 Dev
  • Hornbill ESP32 Minima
  • IntoRobot Fig
  • LOLIN D32
  • LOLIN D32 PRO
  • LoPy
  • LoPy4
  • M5Stack-Core-ESP32
  • M5Stack-FIRE
  • M5Stick-C
  • MH AND LIVE ESP32DevKIT
  • Microduino-CoreESP32
  • Nano32
  • Node32s
  • NodeMCU-32S
  • As Noduino
  • ODROID ESP32
  • OLIMEX ESP32-EVB
  • OLIMEX ESP32-GATEWAY
  • OLIMEX ESP32-PoE
  • Onehorse ESP32 Dev Module
  • OROCA EduBot
  • Silicognition wESP32
  • SparkFun ESP32 Thing
  • T-Beam
  • ThaiEasyElec’s ESPino32
  • TTGO LoRa32-OLED V1
  • Cake IoT Node
  • u-blox NINA-W10 series
  • WEMOS LOLIN32
  • Widora AIR
  • WiPy 3.0
  • XinaBox CW02

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.

ide arduino esp32 demo led blink geekcreit

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 WindowsmacOS 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]

Are you having a problem with this topic?

Maybe someone has already found the solution, visit the forum before asking your question
Ask your question

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email
Share on whatsapp

Did you like this project ? Don't miss any more projects by subscribing to our weekly newsletter!

5 Comments on post "ESP32. Getting started with ESP-IDF on IDE Arduino, macOS, Windows, Linux"
  1. I’m using Raspberry Pi3 Debian on a ESP32-WROOM-32.
    I get these error messages:

    Arduino: 1.8.1 (Linux), Board: “ESP32 Dev Module, QIO, 80MHz, 4MB (32Mb), 921600, None”

    fork/exec /home/pi/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++: no such file or directory

    Error compiling for board ESP32 Dev Module.
    Invalid library found in /home/pi/Arduino/hardware/espressif/esp32/libraries/BLE: /home/pi/Arduino/hardware/espressif/esp32/libraries/BLE
    Invalid library found in /home/pi/Arduino/hardware/espressif/esp32/libraries/BLE: /home/pi/Arduino/hardware/espressif/esp32/libraries/BLE

    The xtensa-esp32-elf directory does not get created. And the BLE directory is empty.

    Where do I get those files for Raspberry Pi3 Debian?

    Thanks,
    Rick

    • Hello Rick. I’m sorry, I do not have a Debian distribution installed to test. From the message it seems that the bluetooth library is not installed on your distribution. Do not you prefer to use Raspbian? The Raspberry Pi Foundation deals with all the integration work of libraries. It’s less work: D

  2. Hi there!
    Thank you so much for your very helpful and detailed tutorial! I as able to get my windows environment setup properly, and could compile the WifiScan example just fine, BUT I need to have this working on my Raspberry Pi 3 as well, however I keep running into issues. At the moment, I’m stuck with the following error after it nearly completes the compilation of the WifiScan example:
    /home/pi/Arduino/hardware/espressif/esp32/tools/sdk/include/soc/soc/io_mux_reg.h: In function ‘PIN_PULLUP_DIS’:
    /home/pi/Arduino/hardware/espressif/esp32/tools/sdk/include/esp32/esp_assert.h:23:28: error: first argument to ‘__builtin_choose_expr’ not a constant
    Have you any idea how to fix this issue?
    Again, thanks so much!
    Tom

  3. Hi: I am trying to install Arduino 1.8.7 on my Rasbperry Pi so I can use my ESP32.
    I followed your instructions (and saw all the installation info flash by), but when I reboot and click on the Arduino icon, I come up with Arduino 1.0.5. (and no ESP32 in the menu.) What suggestions do you have?

    I have followed other guidelines. I see the arduino-1.8.7 in my downloads folder but all my attempts have failed to install it.

    Chuck

  4. Everything went through without a problem but in my arduino no new entry is available.

    Leave a Reply

    DIY Projects
    %d bloggers like this: