espressif / vscode-esp-idf-extension

Visual Studio Code extension for ESP-IDF projects
Apache License 2.0
1.05k stars 305 forks source link

Arduino ESP32 cloning fails in download phase without recovery (VSC-1290) #1130

Closed edolis closed 9 months ago

edolis commented 9 months ago

OS

Windows

Operating System version

10.0.19045

Visual Studio Code version

1.86.0

ESP-IDF version

5.1.2

Python version

see doctor log

Doctor command output

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report --------------------------------------------- OS win32 x64 10.0.19045 System environment variable IDF_PYTHON_ENV_PATH undefined System environment variable PATH C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Zulu\zulu-11\bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Calibre2\;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Agilent\IO Libraries Suite\bin;C:\Program Files\IVI Foundation\VISA\Win64\agvisa;C;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\dotnet\;C:\Program Files\Crucial\Crucial Storage Executive;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\Common Files\Acronis\VirtualFile\;C:\Program Files (x86)\Common Files\Acronis\VirtualFile64\;C:\Program Files (x86)\Common Files\Acronis\FileProtector\;C:\Program Files (x86)\Common Files\Acronis\FileProtector64\;D:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Gpg4win..\GnuPG\bin;D:\Program Files\ffmpeg\bin;D:.espressif\python_env\idf5.1_py3.11_env\Scripts;C:\AppData\Local\Microsoft\WindowsApps;C:\AppData\Local\Programs\MiKTeX\miktex\bin\x64\;C:\AppData\Local\Programs\Microsoft VS Code\bin;C:\AppData\Roaming\npm;C:\Program Files\Git\bin System environment variable PYTHON undefined Visual Studio Code version 1.86.0 Visual Studio Code language en Visual Studio Code shell C:\Program Files\Git\bin\bash.exe ESP-IDF Extension version 1.7.0 Workspace folder d:\MyStuff\Progetti\P014_fermChamber\AUT\P014\blink ---------------------------------------------------- Extension configuration settings ------------------------------------------------------ ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH} ESP-IDF Path (idf.espIdfPath) D:\esp\v5.1.2\esp-idf ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH} ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH} Custom extra paths (idf.customExtraPaths) D:.espressif\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin;D:.espressif\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin;D:.espressif\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin;D:.espressif\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin;D:.espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin;D:.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin;D:.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;D:.espressif\tools\cmake\3.24.0\bin;D:.espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin;D:.espressif\tools\ninja\1.10.2;D:.espressif\tools\idf-exe\1.0.3;D:.espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64;D:.espressif\tools\dfu-util\0.11\dfu-util-0.11-win64;D:.espressif\tools\esp-rom-elfs\20230320 Custom extra vars (idf.customExtraVars) OPENOCD_SCRIPTS: D:.espressif\tools\openocd-esp32\v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts IDF_CCACHE_ENABLE: 1 ESP_ROM_ELF_DIR: D:.espressif\tools\esp-rom-elfs\20230320/ Virtual env Python Path (idf.pythonBinPath) D:.espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe Serial port (idf.port) COM3 OpenOCD Configs (idf.openOcdConfigs) board/esp32-bridge.cfg ESP-IDF Tools Path (idf.toolsPath) D:.espressif Git Path (idf.gitPath) D:.espressif\tools\idf-git\2.39.2\cmd\git.exe Notification Mode (idf.notificationMode) All Custom terminal executable (idf.customTerminalExecutable) C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -------------------------------------------------------- Configurations access ------------------------------------------------------------- Access to ESP-ADF Path (idf.espAdfPath) false Access to ESP-IDF Path (idf.espIdfPath) true Access to ESP-MDF Path (idf.espMdfPath) false Access to ESP-Matter Path (idf.espMatterPath) false Access to ESP-IDF Custom extra paths Access to D:.espressif\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin: true Access to D:.espressif\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin: true Access to D:.espressif\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin: true Access to D:.espressif\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin: true Access to D:.espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin: true Access to D:.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin: true Access to D:.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: true Access to D:.espressif\tools\cmake\3.24.0\bin: true Access to D:.espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin: true Access to D:.espressif\tools\ninja\1.10.2: true Access to D:.espressif\tools\idf-exe\1.0.3: true Access to D:.espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64: true Access to D:.espressif\tools\dfu-util\0.11\dfu-util-0.11-win64: true Access to D:.espressif\tools\esp-rom-elfs\20230320: true Access to Virtual env Python Path (idf.pythonBinPath) true Access to CMake in environment PATH undefined Access to Ninja in environment PATH undefined Access to ESP-IDF Tools Path (idf.toolsPath) true -------------------------------------------------------- Configurations has spaces ------------------------------------------------------------- Spaces in system environment Path true Spaces in ESP-ADF Path (idf.espAdfPath) false Spaces in ESP-IDF Path (idf.espIdfPath) false Spaces in ESP-MDF Path (idf.espMdfPath) false Spaces in ESP-Matter Path (idf.espMatterPath) false Spaces in ESP-IDF Custom extra paths Spaces in D:.espressif\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin: false Spaces in D:.espressif\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin: false Spaces in D:.espressif\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin: false Spaces in D:.espressif\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin: false Spaces in D:.espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin: false Spaces in D:.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin: false Spaces in D:.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: false Spaces in D:.espressif\tools\cmake\3.24.0\bin: false Spaces in D:.espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin: false Spaces in D:.espressif\tools\ninja\1.10.2: false Spaces in D:.espressif\tools\idf-exe\1.0.3: false Spaces in D:.espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64: false Spaces in D:.espressif\tools\dfu-util\0.11\dfu-util-0.11-win64: false Spaces in D:.espressif\tools\esp-rom-elfs\20230320: false Spaces in Virtual env Python Path (idf.pythonBinPath) false Spaces in ESP-IDF Tools Path (idf.toolsPath) false ----------------------------------------------------------- Executables Versions ----------------------------------------------------------- Git version 2.39.2.windows.1 ESP-IDF version 5.1.2 Python version 3.11.2 Python's pip version 24.0 -------------------------------------------------- Project configuration settings ---------------------------------------------------------- -------------------------------------------------- Python packages in idf.pythonBinPath ---------------------------------------------------- bitarray version: 2.9.2 bitstring version: 4.1.4 CacheControl version: 0.14.0 certifi version: 2024.2.2 cffi version: 1.16.0 charset-normalizer version: 3.3.2 click version: 8.0.4 colorama version: 0.4.6 construct version: 2.10.70 contextlib2 version: 21.6.0 cryptography version: 39.0.2 ecdsa version: 0.18.0 esp-coredump version: 1.10.0 esp-debug-backend version: 1.0.3 esp-idf-kconfig version: 1.4.2 esp-idf-monitor version: 1.4.0 esp-idf-panic-decoder version: 1.0.1 esp-idf-size version: 1.1.0 esptool version: 4.7.0 filelock version: 3.13.1 freertos-gdb version: 1.0.2 idf-component-manager version: 1.4.2 idna version: 3.6 intelhex version: 2.3.0 kconfiglib version: 14.1.0 markdown-it-py version: 3.0.0 mdurl version: 0.1.2 msgpack version: 1.0.7 packaging version: 23.2 pip version: 24.0 pycparser version: 2.21 pyelftools version: 0.29 pygdbmi version: 0.9.0.2 Pygments version: 2.17.2 pyparsing version: 3.0.9 pyserial version: 3.5 pywin32 version: 306 PyYAML version: 6.0.1 reedsolo version: 1.7.0 requests version: 2.31.0 requests-file version: 1.5.1 requests-toolbelt version: 1.0.0 rich version: 13.7.0 schema version: 0.7.5 setuptools version: 69.0.3 six version: 1.16.0 tqdm version: 4.66.1 urllib3 version: 1.26.18 windows-curses version: 2.3.2 ---------------------------------------------------- Check ESP-IDF python requirements.txt ------------------------------------------------- Check ESP-IDF Python packages Python requirements are satisfied. ---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------ Check Debug AdapterPython packages Python requirements are satisfied. ---------------------------------------------------- Visual Studio Code launch.json -------------------------------------------------------- { "version": "0.2.0", "configurations": [ { "type": "espidf", "name": "Launch", "request": "launch" } ] } ---------------------------------------------------- Visual Studio Code c_cpp_properties.json ---------------------------------------------- { "configurations": [ { "name": "ESP-IDF", "compilerPath": "${config:idf.toolsPathWin}\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe", "compileCommands": "${workspaceFolder}/build/compile_commands.json", "includePath": [ "${config:idf.espIdfPath}/components/", "${config:idf.espIdfPathWin}/components/", "${config:idf.espAdfPath}/components/", "${config:idf.espAdfPathWin}/components/", "${workspaceFolder}/" ], "browse": { "path": [ "${config:idf.espIdfPath}/components", "${config:idf.espIdfPathWin}/components", "${config:idf.espAdfPath}/components/", "${config:idf.espAdfPathWin}/components/**", "${workspaceFolder}" ], "limitSymbolsToIncludedHeaders": false } } ], "version": 4 }

Extension

No response

Description

I have been trying to execute the command ESP-IDF:Add Arduino ESP32 as ESP-IDF component, three times so far. Looks like after a promising start, the download fails around 11% - 18% and no resume capability is implemented. Running again the command does not work (a message saying that the folder already exists pops up) So the only way forward seems to be deleting the folder components/arduino - which is locked by explorer.exe. So you have to kill explorer.exe to remove the lock (bad stuff); initiate another explorer, restart VS code, delete the folder, retry... and rinse and repeat.

Please consider fixing with some normal resume capability or the chance of some manual installation.

Debug Message

Receiving objects:  18% (9168/48776), 62.40 MiB | 294.00 KiB/s
Receiving objects:  18% (9168/48776), 62.66 MiB | 271.00 KiB/s
Receiving objects:  18% (9168/48776), 62.93 MiB | 277.00 KiB/s
error: 3694 bytes of body are still expected

fetch-pack: unexpected disconnect while reading sideband packet

fatal: early EOF

fatal: fetch-pack: invalid index-pack output

Arduino ESP32 cloning has exit with 128

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

edolis commented 9 months ago

another kind of error message:

Receiving objects:   8% (4278/48776), 20.40 MiB | 374.00 KiB/s
Receiving objects:   8% (4278/48776), 20.76 MiB | 375.00 KiB/s
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly before end of the underlying stream
error: 6787 bytes of body are still expected

fetch-pack: unexpected disconnect while reading sideband packet

fatal: early EOF

fatal: fetch-pack: invalid index-pack output

Arduino ESP32 cloning has exit with 128
edolis commented 9 months ago

and another. I think I'll give up for the time being

Receiving objects:   8% (4277/48785), 13.54 MiB | 211.00 KiB/s
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 778 bytes of body are still expected

fetch-pack: unexpected disconnect while reading sideband packet

fatal: early EOF

fatal: fetch-pack: invalid index-pack output

Arduino ESP32 cloning has exit with 128
brianignacio5 commented 9 months ago

This seems to be an issue with your internet connection.

Can you run this on a terminal:

D:.espressif\tools\idf-git\2.39.2\cmd\git.exe  config --global http.postBuffer 524288000  # Set a larger buffer size
D:.espressif\tools\idf-git\2.39.2\cmd\git.exe  config --global core.compression 0         # Disable compression

and try again.

Other suggestions are here https://github.com/orgs/community/discussions/48568

edolis commented 9 months ago

Thanks Brian - that thread solved my issue: I had to use a VPN, for some reason that traffic is being filtered too much here (Italy). Now, some further things: a) can you please provide the rollback commands for those two config commands above (which did not help) - so that I bring git to its previous state? b) this Arduino ESP thing brought me to download 2.3 GB of data. Is there a way to copy and use it for another project too? I tried creating another sample project and executing the same command seems to initiate the download from scratch - this is clearly not sustainable. I am writing seem as when I execute the ESP-IDF:Add Arduino ESP32 as ESP-IDF component command, this time I get absolutely no message in the output window - but I see the VPN is starting the download activity again. And then fails (using VPN too) - with no message in the output window (just the popup) - see below image

Can I copy the content to the components/arduino folder and tweak the configuration to achieve the same results as the command? thanks

brianignacio5 commented 9 months ago
  1. You can set
    D:.espressif\tools\idf-git\2.39.2\cmd\git.exe  config --global http.postBuffer 1M  # Default 1M
    D:.espressif\tools\idf-git\2.39.2\cmd\git.exe  config --global core.compression -1         # Default zlib
  2. You can save this components in a location where you save global components. This can be any directory in your system and you can add it from your project CMakeLists.txt as any other ESP-IDF component
  3. In output please select ESP-IDF from dropdown (Where is says Tasks)
  4. Yes you can, this command is basically doing steps from this documentation: https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html
edolis commented 9 months ago

Thanks Brian for your boundless patience. For other beginners, I believe the global components folder is the \esp\v5.1.2\esp-idf\components one (in my case, version 5.1.2.)

Given the size/ potential fragility of the download process (size/ no resume option) , I'd recommend that saving in the global components is an option given to the user when executing the command.