Until last year I was using Espressif 32 framework version 4.2.0 and I have several projects for ESP32-CAM (all based on CameraWebServer example) which I made between 2021. and a year ago.
Last year I had to compile some project which required updated framework so I added platform = espressif32 @ 6.7.0 to platformio.ini and everything worked well - the new framework installed automatically into framework-arduinoespressif32 and the name of the folder containing old framework changed to framework-arduinoespressif32@3.20002.220503.
However, now I had to edit and compile my older ESP32-CAM projects but I got include errors for fd_forward.h and fr_forward.h header files.
Here I’ve found that face recognition code (and those header files) were removed in Arduino core Arduino Core 3.1.x and that the latest Arduino core containing those headers is 3.0.7.
Under Platformio > Platforms I still have framework Espressif 32 version 4.2.0 which I was using before and I thought compile will work by using platform = espressif32 @ 4.2.0 but the error is still the same and I can’t anymore compile my old ESP32-CAM projects.
If I am not mistaken, compile of old projects should work even with platform = espressif32 @ 6.7.0 because Arduino core used by that version of the framework is 2.0.16 but it doesn’t work with either of ESP32 framework versions.
I noticed that when I am creating a new project or when I filter the boards in Board Explorer Espressif boards are listed twice or even three times and sometimes four times like this:
AI Thinker ESP32-CAM
AI Thinker ESP32-CAM
AI Thinker ESP32-CAM
AI Thinker ESP32-CAM
Under Platforms I can see both Espressif 32 v6.7.0 and Espressif 32 v4.2.0
What could be the cause of that problem and Is there something I could do so I could compile my older projects again witrhout removing the code for face recognition?
You miss, i have same issue ini without version. After you add @ original isnt renamed, but removed and replaced. I mean your 4.2 was updated over home many time ago and your projects was based on other version.
Now only try versions is ay for you … This is one bad PIO system.
And FYI original pio frameworks any to actual 6.10.0 dont use Arduino 3.x
I don’t see a way of uploading .zip file here on the forum but it is easy to reproduce the project that I could compile before but not anymore:
Back in 2021. I opened CameraWebServer example for ESP32-CAM with portable version of Arduino 1.8.10, saved the project, imported it with Platformio by using Import Arduino Project button and changed the extension of .ino file to .cpp
The exact date was the first of March 2021 because the Platformio generated the folder name starting with 210301.
Then I made a few versions of the program by adding code and changing byte arrays in camera_index.h but that isn’t important because if I could compile the unmodified example then I could compile my versions too.
The exact version of CameraWebServer example which I could compile before but now I can’t is this very code:
Here’s what I discovered after a few more hours of research:
Since the reason why compile doesn’t anymore work is at some point the folder esp-face containing files fd_forward.h and fr_forward.h which are included in app_httpd.cpp was removed from the arduino-esp32 framework I examined the repository trying to find the last occurrence of those header files in the framework.
The last commit where those header files were still included in CameraWebServer from 14th Feb 2020. example is this:
A few months later on 8th Dec 2020 those includes were guarded by compiler directive:
and esp-face folder was removed from the framework:
meaning my assumption I could compile that example with Espressif 32 v4.2.0 was wrong!!
Since I compiled that code on the first of March 2021 I must have used Espressif 32 v3.1.0 + Arduino 1.0.5:
I don’t remember uninstalling that version of the framework but now when I tried to install it again by using:
Resolving esp32cam dependencies...
Platform Manager: Installing espressif32 @ 3.1.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Platform Manager: espressif32@3.1.0 has been installed!
Tool Manager: Installing platformio/toolchain-xtensa32 @ ~2.50200.0
Tool Manager: Error: Please read https://bit.ly/package-manager-ioerror
Tool Manager: Warning! Package Mirror: HTTPSConnectionPool(host='eu2.contabostorage.com', port=443): Max retries exceeded with url: /c0a5502915964bc09d2607baa2984f98:pioregmirroreu/tools/c1/f9/7fce33658c3efb1f2396581eac9569e693949038b99d692dba51768afbe8/toolchain-xtensa32-windows-2.50200.97.tar.gz (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000002BEA5ECCA50>: Failed to resolve 'eu2.contabostorage.com' ([Errno 11004] getaddrinfo failed)"))
Tool Manager: Looking for another mirror...
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: toolchain-xtensa32@2.50200.97 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.10005.0
UnknownPackageError: Could not find the package with 'platformio/framework-arduinoespressif32 @ ~3.10005.0' requirements for your system 'windows_amd64'
When I tried again (I first removed the 3.1.0 framework from Platforms because it was showing there but wasn’t installed) there was endless stream of errors Max retries exceeded and I had to press Cancel and remove Espressif 32 v3.1.0 from Platforms again.
Then I followed the instructions “A temporary solution is to install packages using a system terminal (not VSCode Terminal)” from the link in the error report and run:
I wanted to try that but there is now another problem. After removing Espressif 32 v3.1.0 from Platforms by clicking Uninstall button (like everytime before) there is:
Could not load installed platforms
PIO Core Call Error: "UnknownPlatform: Unknown development platform 'PackageItem <path=C:\\Users\\xxxx\\.platformio\\platforms\\espressif32@3.1.0 metadata=PackageMetadata <type=platform name=espressif32 version=3.1.0 spec={'owner': 'platformio', 'id': 8026, 'name': 'espressif32', 'requirements': None, 'uri': None}'"
error when I try to create a new project or when I try to use Import from Arduino so I can’t select platform / board.
And there is:
Could not load installed platforms
PIO Core Call Error: "UnknownPlatform: Unknown development platform 'PackageItem <path=C:\\Users\\xxxx\\.platformio\\platforms\\espressif32@3.1.0 metadata=PackageMetadata <type=platform name=espressif32 version=3.1.0 spec={'owner': 'platformio', 'id': 8026, 'name': 'espressif32', 'requirements': None, 'uri': None}'"
error when I click Platformio > Platforms.
I still have framework-arduinoespressif32 (6.7.0) and framework-arduinoespressif32@3.20002.220503 (4.2.0) folders in .platformio > packages and these do work because I can still open existing projects which are using ESP32 framework without errors.
Seems as somewhere the reference to version 3.1.0 which I removed using Platforms > Uninstall wasn’t removed.
Before when I installed 3.1.0 by editing platformio.ini and uninstalled it via Platformio > Platforms > Uninstall there were no errors but now when I installed 3.1.0 via command line and then uninstalled it via Platformio > Platforms > Uninstall selecting platform no loger works.
I really wouldn’t like to delete .platformio directory, there must be a way of removing that reference by editing some file or by running some command.
EDIT:
I removed 3.1.0 directory from .platformio > platforms and now I can open Platforms.
That worked well and the project now compiles without errors!! :-)) All I have to do now is to specify platform = espressif32@3.5.0 in all projects I made in 2021.
I didn’t have to use command line, editing platformio.ini worked well.
Thank you very much for your time!!
But there are still two things I’d like to know:
Let’s say the compile with 3.5.0 didn’t work and the only way to compile the project would be by using Arduino framework 1.0.5 which is, as you said, not anymore in th registry. How could one still use 1.0.5 with Platformio in that case?
Because, what if one day even 1.0.6 disappears from the registry?
Now I have it in the local folders I can use it even if it disappears from the registry but what if I really had to use the exact version 1.0.5?
And what could be the reason the boards in the dropdown menu for selecting the board when creating new project are listed multple times? I now have three versions of Espressif 32 framework installed and ready to use but the boards are listed four times and some of them even more than four times.
For projects needing Arduino-ESP32 core 1.0.5, I guess it should work to take the framework package directly from their Github. It has the needed package.json and builder script, so no modifications needed.
[env:esp32dev]
; can handle Arduino-ESP32 1.0.6 just fine, so likely also 1.0.5
platform = espressif32@3.5.0
board = esp32dev
framework = arduino
; force framework package to be the 1.0.5 version
platform_packages =
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/archive/refs/tags/1.0.5.zip
The specific framewok was downloaded to .platformio\packages\framework-arduinoespressif32@src-<32 hex characters> directory and can now be used with any project which is using Espressif 32 v3.5.0