Espressif board manager 3.3.0 fails

Both IDE 1.8.19 and 2.3.6 and windows 10 and windows 11 updating esp32 from espressif to 3.3.0, fails “Failed to install platform: 'esp32:3.3.0'. UNKNOWN: stream error: stream ID 1; PROTOCOL_ERROR; received from peer” It’s a long download and I believe a problem on their part? tried several times in both IDE’s with the same failure both in windows 10 and 11. Repeated several times on windows 11 and it finally completed. Still fails on 1.8.19 on windows 10. I think it is timing out on the long files. Error in 1.8.19 on Windows10:esp32 error

Tried many times and it always fails with this long file. Found: ver 3.1.3 will install as well as any older. 3.2.0 and newer fail the same way.

I have no idea where you got that URL, it isn't any I have seenm, but the real good news is esp232 is now builtin, no need for ANY esp32URL.

Here is mine
No esp32

and esp32 3.3.0 installed

That file is one of the tools listed in the main Arduino15/package_index.json file (the one that gets updated periodically when you start the IDE).

$ rg crosstool.+14.2.0.+riscv32.+mingw package_index.json
25864:              "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/
riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip",
25885:              "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/
riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip",

Harder to verify against a screenshot, but looks like that first one, the i686 version -- although that indicates a 32-bit CPU (as opposed to x86_64)?

Anyway, the file is present, and pretty big, about the size of a CD (imagine a shiny disc that could fit in your hand, which had about a dozen songs that you could listen to, without commercials). The URL returns a redirect, so with curl, you need -L to follow it

$ curl -OL https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100  640M  100  640M    0     0  47.4M      0  0:00:13  0:00:13 --:--:-- 51.8M

Which doesn't take too long to download on a 50MB/s connection, but of course....

Unfortunately, I don't have an i686 Windows system to try and reproduce the failure.

Hi @tannenba. The developers of the "esp32" boards platform made the perhaps questionable decision to use GitHub as a way to host the very large toolchain files upon which their platform depends rather than the more responsible approach of self-hosting the files (as the Arduino company does with our toolchains).

GitHub recently reduced the expiration time set for the token that is used to download these files. The expiration is now set for 5 minutes after the initiation of the download. This means that the download is intentionally failed if it takes longer than ~5 minutes (there is apparently some leeway on the enforcement of the expiration).

There is discussion about that here:

This means that the ability to successfully install the "esp32" boards platform is dependent on the speed of your Internet connection. Your Internet connection is apparently too slow to download this file before the expiration of the token, so the installation fails for you.

The workaround will be to manually download the file using a tool that supports resumption of downloads. The Google Chrome web browser ostensibly does, but I actually haven't had any success when I tried to use it to resume downloads of the file. When I click "Resume" on the failed download, it immediately fails again with a "Site wasn't available" error (if I do it via the menu of the "Downloads" icon on the browser toolbar), or "Failed - Unknown server error. Please try again, or contact the server administrator." (if I do it via Chrome's Downloads page). I believe this is due to the fact that GitHub redirects the initial download URL to a temporary URL that is authenticated with the JWT token, and Chrome isn't smart enough to resume this type of download.

I am able to resume the failed download when I perform the download using using curl.exe --continue-at - --location --remote-name.

I was also able to resume the download using wget --continue.

If you already have a download manager tool that supports resuming these downloads, you should use that to manually download the file. If you don't already have one, I will suggest you use curl as, unlike Wget, this is preinstalled in Windows. I'll provide instructions you can follow to do that:

  1. Right click the Windows "Start" button.
    A context menu will open.
  2. Select "Search" from the menu.
    The Windows "Start" menu will open with a search field selected.
  3. Type windows powershell ise in the search field.
  4. Select "Windows PowerShell ISE" from the search results.
    A "Windows PowerShell ISE" window will open.
    I'm not certain this is available on Windows 10. The point is to open a PowerShell terminal. You are welcome to do that by whichever method is convenient.
  5. Type the following command in the Windows PowerShell ISE window:
    curl.exe --continue-at - --location --output-dir "$Env:LOCALAPPDATA\Arduino15\staging\packages" --remote-name https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip
    
  6. Press the Enter key.
    The file download will now start.
  7. Monitor the progress of the file download. After approximately five minutes have passed, it will exit with a message something like, which indicates that the download was not successful:
    curl: (18) end of response with 35384341 bytes missing
    
  8. Repeat steps 5-7 until the upload completes, as indicated by the lack of a "curl: (18) end of response with \_\_\_ bytes missing" message when the command exits.
    Something that might be confusing is that the progress indicator only shows the progress during the current download attempt. The lack of a sign of the progress from the previous download attempt makes it seem like it started the download over from scratch rather than resuming. However, you will know it has indeed resumed because the command will print a message something like:
    ** Resuming transfer from byte position 111658240
    
  9. Now you need to do the same procedure, but downloading a different large file. Type the following command in the Windows PowerShell ISE window:
    curl.exe --continue-at - --location --output-dir "$Env:LOCALAPPDATA\Arduino15\staging\packages" --remote-name https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-i686-w64-mingw32.zip
    
  10. Press the Enter key.
    The file download will now start.
  11. Monitor the progress of the file download. After approximately five minutes have passed, it will exit with a message something like, which indicates that the download was not successful:
    curl: (18) end of response with 35384341 bytes missing
    
  12. Repeat steps 5-7 until the upload completes, as indicated by the lack of a "curl: (18) end of response with \_\_\_ bytes missing" message when the command exits.
  13. Now you need to do the same procedure one last time, for downloading a third large file. Type the following command in the Windows PowerShell ISE window:
    curl.exe --continue-at - --location --output-dir "$Env:LOCALAPPDATA\Arduino15\staging\packages" --remote-name https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.5/esp32-arduino-libs-idf-release_v5.5-b66b5448-v1.zip
    
  14. Press the Enter key.
    The file download will now start.
  15. Monitor the progress of the file download. After approximately five minutes have passed, it will exit with a message something like, which indicates that the download was not successful:
    curl: (18) end of response with 35384341 bytes missing
    
  16. Repeat steps 5-7 until the upload completes, as indicated by the lack of a "curl: (18) end of response with \_\_\_ bytes missing" message when the command exits.

After that, try installing the "esp32" platform via the Arduino IDE Boards Manager again, just as you did before. Hopefully this time it will be successful, as it will use the existing file you downloaded using curl instead of attempting to download it from the Internet. It may still need to download some additional files from the Internet, but they are all significantly smaller than the file you had trouble with, so hopefully Boards Manager will be able to download those.


There is a feature request to add support to Arduino IDE for resuming file downloads here:

That would mitigate the problem as, even though the first attempt at the installation might still fail, it would finally succeed after subsequent attempts as the file was downloaded incrementally.


:red_exclamation_mark: Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on the Arduino Forum.


That URL is the failure as it is loading the tools.

Will try. Would be easier to have a way to tell Github to expand it’s timeout.

I'm not aware of a way to accomplish that. Maybe one of the other forum helpers will be able to suggest a better alternative.

If GitHub doesn't provide a mechanism to extend the token expiration, I doubt there is any way to influence it to any significant extent, since the whole point of the token is to be able to control this sort of thing, and so any workaround would be considered a security flaw in what is surely a widely used JSON Web Token (JWT) implementation. You might be able to slightly postpone the expiration by changing your system time, but I'm sure that any significant deviations will not be permitted.

That did it. I have 3.3.0 loaded now. Thank you.

You are welcome. I'm glad it is working now.

Regards, Per

I’m only commenting because I had a problem getting ESP32 board support installed.

I reset my firewall in windows 10 and then IDE 1.8.19 and 2.3.6 downloaded and installed it fine I did have to allow the IDE’s to connect. I use the build in Firewall of Windows 10.

I have a relatively slow internet, so the large files were taking over 5 minutes.

1 Like

I also have a slow connection.

Espressif has a mirror for chinese users:

Users in China might have troubles with connection and download speeds using the links above (github. Please use our Jihulab mirror:

I live in the US and used it with the board manager. Works.

The Arduino developers are now tracking the problem of the failing platform installation here:

Even though the root cause of the failure is on GitHub's end, it is not clear whether they expected the change they made to have this type of effect, and whether they will ever take action to resolve the problems it caused. So it is worth investigating whether Arduino IDE can be made to manage to complete the downloads under these conditions.

If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:


:red_exclamation_mark: Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on Arduino Forum.


I have an update to share on this. GitHub reported that they took measures to fix the problem:

I performed a test and found that the failure no longer occurs, even though the download took 12 minutes.

So I believe the problem is now truly resolved and the workaround I mentioned in my previous reply will no longer be required.

If anyone still encounters the "PROTOCOL_ERROR; received from peer" error when installing an Arduino boards platform, please comment here (or in the GitHub issue if you prefer) and we'll investigate further.