Page 1 of 2
Installing ESP-IDF.
Posted: Sat Jan 21, 2023 11:14 am
by frankie53
Having seen comparisons of ESP32 against Arduino I decided to go the ESP32 route. Great except I have spent 3 days try unsuccessfully to install and get working ESP-IDF. I have tried all the alleged fixes I have so far discovered but none of them seem to work. All I ever get is that damned "failed with error code -2" message. I'm beginning to wonder If I have made a mistake and would have been better off going with Arduino.
Re: Installing ESP-IDF.
Posted: Sun Jan 22, 2023 1:08 am
by ESP_Sprite
Are you simply venting or do you want help? Because if you want us to help you, you'll need to provide a bit more information: OS, versions, how are you trying to install ESP-IDF, are you using an IDE etc etc.
Re: Installing ESP-IDF.
Posted: Mon Jan 23, 2023 4:02 am
by karunt
Best way to install ESP-IDF is to use VSCode. Follow the instructions provided in this link:
https://github.com/espressif/vscode-esp ... install.md. If you get stuck, let us know where you got stuck and what error messages you're getting so we can help you accordingly.
Re: Installing ESP-IDF.
Posted: Mon Jan 23, 2023 7:19 am
by RichPiano
Don't worry it took me a few days as well. Here's the big picture:
1) Download the esp-idf git repo
2) Install using install.bat (or install.sh when on linux) from the repo directory -> this will install the "toolchain" (compiler, cmake and such).
I would recommend to set environment variables IDF_PATH (where you cloned your repo) and IDF_TOOLS_PATH beforehand. I have mine set to C:/dev/esp/esp-idf and C:/dev/esp/.espressif respectively.
Re: Installing ESP-IDF.
Posted: Mon Jan 23, 2023 8:27 am
by ESP_Roland
I'd like to point out that the official and supported way to install ESP-IDF on Windows is the Windows Installer:
https://docs.espressif.com/projects/esp ... -installer
Running the scripts manually and setting environment variables are not recommended - this can lead to issues which are very hard to identify and solve.
As for Vscode + ESP-IDF,
https://github.com/espressif/vscode-esp ... install.md is the way to go as it was already linked earlier.
Re: Installing ESP-IDF.
Posted: Mon Jan 23, 2023 3:49 pm
by karunt
Curious - for Windows, what's a better approach? Using Windows Installer or VS Code? Or are both equally good and it really depends on whether user wants to develop in the VS Code environment or using the ESP-IDF shell?
Re: Installing ESP-IDF.
Posted: Mon Jan 23, 2023 4:00 pm
by mbratch
This is the way I install it (on Windows), after having tried other methods, and it works great for me. I use both VS Code and Eclipse environments. After installing using the Windows installer, I just point to that installation in the VS Code and Eclipse plugin setups. I also have the option of using the command line tools in PowerShell or Command prompt if desired (which I do occasionally).
Re: Installing ESP-IDF.
Posted: Tue Jan 24, 2023 5:43 am
by frankie53
In response to ESP_Sprite, both of the above. My OS is windows 10, I have not installed an IDE (do I need to?"
- Capture.JPG (43.3 KiB) Viewed 6053 times
, I go to this page
https://dl.espressif.com/dl/esp-idf/ and attempt to install using this package "Universal Online Installer 2.18, Windows 10, 11, Size:4MB". I follow exactly the instructions presented and leave every setting at default and the response I get is "Installation has failed with exit code -2".
Re: Installing ESP-IDF.
Posted: Tue Jan 24, 2023 6:03 am
by ESP_Roland
frankie53, if you have the log from the installer then please submit an issue here:
https://github.com/espressif/idf-installer/issues
Re: Installing ESP-IDF.
Posted: Tue Jan 24, 2023 11:21 am
by mbratch
frankie53 wrote: ↑Tue Jan 24, 2023 5:43 am
In response to ESP_Sprite, both of the above. My OS is windows 10, I have not installed an IDE (do I need to?"
No, you don't have to install an IDE.
I go to this page
https://dl.espressif.com/dl/esp-idf/ and attempt to install using this package "Universal Online Installer 2.18, Windows 10, 11, Size:4MB". I follow exactly the instructions presented and leave every setting at default and the response I get is "Installation has failed with exit code -2".
I have not tried the "universal" installer. I used the Offline installer for the specific ESP-IDF version I wanted (they offer 4.4.3 and 5.0).