Arduino core for the ESP32 fails to install

using VS Code on Win 10 an import of either espidf-arduino-blink or espidf-arduino-wifiscan fails to import. It looks like the Arduino core for the ESP32(GitHub - espressif/arduino-esp32: Arduino core for the ESP32) fails to install. However the projects do appear in my project directory and i can open them. Predictably the build fails with Tool manger failing to install GitHub - espressif/arduino-esp32: Arduino core for the ESP32.

here’s the build log:

Tool Manager: Installing git+https://github.com/espressif/arduino-esp32.git#idf-release/v4.0
Error: Traceback (most recent call last):
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\__main__.py", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "c:\users\peter\.platformio\penv\lib\site-packages\click\core.py", line 829, in __call__     
    return self.main(*args, **kwargs)
  File "c:\users\peter\.platformio\penv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\commands\__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "c:\users\peter\.platformio\penv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\peter\.platformio\penv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\peter\.platformio\penv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\peter\.platformio\penv\lib\site-packages\click\decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\commands\run\command.py", line 143, in cli
    is_test_running,
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\commands\run\command.py", line 175, in process_env
    result = {"env": name, "duration": time(), "succeeded": ep.process()}
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\commands\run\processor.py", line 79, in process
    result = p.run(build_vars, build_targets, self.silent, self.verbose, self.jobs)
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\platform\_run.py", line 60, in run
    self.autoinstall_runtime_packages()
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\platform\_packages.py", line 69, in autoinstall_runtime_packages
    self.pm.install(self.get_package_spec(name))
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 49, in install
    spec, silent=silent, skip_dependencies=skip_dependencies, force=force
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 97, in _install
    pkg = self.install_from_url(spec.url, spec, silent=silent)
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 141, in install_from_url
    vcs = VCSClientFactory.new(tmp_dir, url)
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 55, in new
    src_dir, remote_url, tag, silent
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 137, in __init__
    self.configure()
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\package\vcsclient.py", line 146, in configure
    result = proc.exec_command([cls.command, "--exec-path"])
  File "c:\users\peter\.platformio\penv\lib\site-packages\platformio\proc.py", line 113, in exec_command
    p = subprocess.Popen(*args, **kwargs)
  File "C:\Users\Peter\.platformio\python3\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Peter\.platformio\python3\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

I’ve also tried with GitHub - espressif/arduino-esp32: Arduino core for the ESP32 …same result

In the end just trying to use some timer functions from espidf. tried just adding appropriate include files in my source and using setting build flags using project config to add the appropriate paths but couldn’t get it to work.

any suggestions would be greatly appreciated.

Do you have git installed (Git - Downloads)? Do you have an antivirus program that might interfere?

@ maxgerhardt Thanks for the prompt reply … pulling my hair out on this one.

git is not installed on this machine …very old dog, still mostly using SVN :slight_smile:

another important data point - i was successfully able to import and build the espidf-arduino-blink example on another win10 machine (running in vbox) that does not have git. It’s an older install of platformio and the espressif platform version is 1.11.

pio info for WORKING machine:
PlatformIO Core 5.0.4
Python 3.7.7-final.0
System Type windows_amd64
Platform Windows-10
File System Encoding utf-8
Locale Encoding cp1252
PlatformIO Core Directory C:\Users\Peter.platformio
PlatformIO Core Executable C:\Users\Peter.platformio\penv\Scripts\platformio.exe
Python Executable c:\users\peter.platformio\penv\scripts\python.exe
Global Libraries 0
Development Platforms 2
Tools & Toolchains 13

On the FAILING system , git not installed, espressif32 platform version is 2.1.0 and pio info shows:

PlatformIO Core 5.0.4
Python 3.7.7-final.0
System Type windows_amd64
Platform Windows-10
File System Encoding utf-8
Locale Encoding cp1252
PlatformIO Core Directory C:\Users\Peter.platformio
PlatformIO Core Executable C:\Users\Peter.platformio\penv\Scripts\platformio.exe
Python Executable c:\users\peter.platformio\penv\scripts\python.exe
Global Libraries 0
Development Platforms 1
Tools & Toolchains 9

AV is windows defender - it does not show any recent actions disabled got same result.

Working machine is also Windows Defender AV

Okay let’s first make sure that all software is up to date.

Please open a PIO CLI in VSCode and do

pio upgrade --dev
pio platform update espressif32

then restart VSCode.

And I undestand you correctly that git is now installed on the machine at which it is currently not working? If not, please do so anyways.

You’re also using the unmodified platformio.ini from platform-espressif32/platformio.ini at develop · platformio/platform-espressif32 · GitHub right?

git is not installed on EITHER machine. I am not going to touch the machine that’s working …not very convenient to use but it’s my “last resort” and i firmly believe “if it ain’t broken don’t fix it” 1

Going forward in this thread everything will refer to the non working system. Proceeding with git install and pio updates…

PlatformIO has been successfully upgraded to 5.0.5b5!

**************************************************************************************************************************************************If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
**************************************************************************************************************************************************
--------
Updating platformio/espressif32               2.1.0                              [Up-to-date]
Updating platformio/toolchain-xtensa32        2.50200.80 @ ~2.50200.0            [Up-to-date]
Updating platformio/toolchain-esp32ulp        1.22851.191205 @ ~1.22851.0        [Up-to-date]
Updating platformio/framework-arduinoespressif32 3.10004.201016 @ ~3.10004.191002   [Up-to-date]
Updating platformio/tool-esptoolpy            1.30000.201119 @ ~1.30000.0        [Up-to-date]


**************************************************************************************************************************************************We found 642.89KB of unnecessary PlatformIO system data (temporary files, unnecessary packages, etc.).
Use `pio system prune --dry-run` to list them or `pio system prune` to save disk space.
PS C:\Users\Peter\Documents\PlatformIO\210124-231322-espidf-arduino-blink> pio system prune --dry-run
Dry run mode (do not prune, only show data that will be removed)

Prune cached data:
 - cached API requests
 - cached package downloads
 - temporary data
Space on disk: 306.17MB

Prune unnecessary core packages:
Calculating...
Space on disk: 0B

Prune unnecessary development platform packages:
Calculating...
Package                        Version         Size
-----------------------------  --------------  --------
platformio/toolchain-xtensa32  2.80200.200827  334.03MB
platformio/tool-scons          4.40001.0       2.69MB
Space on disk: 336.72MB

Total reclaimed space: 642.89MB

restarted VS Code , rebuild still fails:
Tool Manager: Installing git+https://github.com/espressif/arduino-esp32.git#mod-idf-v4.2 …
.
.
.
FileNotFoundError: [WinError 2] The system cannot find the file specified

mod-idf-v4.2? That branch or tag does not exist in GitHub - espressif/arduino-esp32: Arduino core for the ESP32 and is different from the reference

Please show the full platformio.ini of the project.

oops that mod-idf-v4.2 was a failed experiment fom anothe Git user … let me revert to standard.

same build result after i reverted to idf-release/v4.0. Here is current platform.ini

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env]
platform = espressif32
framework = 
	arduino
	espidf
build_flags = -D CONFIG_BLINK_GPIO=2
monitor_speed = 115200
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0

[env:esp32dev]
board = esp32dev

[env:espea32]
board = espea32

[env:esp320]
board = esp320

git Installed, restarted VS Code, open project VS Code .did an Intellisense Index rebuild

Voila! …Build succeeded :slight_smile:

it appear that for version 2.1 of esp32 platform git installed is a requirement … on my "working machine with v 1.11 of esp32 it was NOT required.

1 Like

If you’ve installed git and it did install itself to the PATH, a VSCode restart is necessary; that might be the actual reason. A reboot after such an install would also be a way to make that absolutetly sure.

@maxgerhardt thank you for your hellp .! . it is much appreciated!

it would have been a very long time before i stumbled on a solution