arduino-esp32 IDF component build failure

gpeyton
Posts: 6
Joined: Sun Apr 12, 2020 7:44 pm

arduino-esp32 IDF component build failure

Postby gpeyton » Sun Apr 12, 2020 9:37 pm

I am trying to add the Arduino library as a component, following these instructions:
https://github.com/espressif/arduino-es ... mponent.md

I am able to reproduce the error found here:
https://github.com/espressif/arduino-esp32/issues/3457

Procedure:
- Checkout v4.1-beta1 IDF branch, and reinstall IDF with Eclipse
- Add hello_world project to Eclipse and ensure hello_world builds
- Follow the guide to add arduino-esp32 as a component
- Refresh project in Eclipses and rebuild

It fails with:

Code: Select all

CMake Error at ~/esp/esp-idf/tools/cmake/build.cmake:186 (message):
  Failed to resolve component 'ethernet'.
...
FAILED: build.ninja 
Please can you let me know if there is a fix or workaround for this? At the moment, the Arduino library is completely unusable as a component, but I need to use it.

Thanks!

DerrickLau
Posts: 7
Joined: Mon Apr 13, 2020 9:09 pm

Re: arduino-esp32 IDF component build failure

Postby DerrickLau » Mon Apr 13, 2020 9:13 pm

I had this problem before and made some modifications to the Arduino-esp32 IDF component to make it work. Mine works with the DFPlayer sample.

I posted my code changes here:
https://github.com/DerrickLau/esp32-arduino-port

Just grab a copy of the files and put into /esp-idf/component/Arduino directory and then build your program as usual. It should work.

Are you saying you tried building with my port and it failed?

gpeyton
Posts: 6
Joined: Sun Apr 12, 2020 7:44 pm

Re: arduino-esp32 IDF component build failure

Postby gpeyton » Wed Apr 15, 2020 3:32 am

Thanks for your response. I tried adding it as you said, but still get the same build failure. Are you using Eclipse to build?

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

Re: arduino-esp32 IDF component build failure

Postby daneast » Wed Apr 29, 2020 3:00 pm

I have also tried building with Derrick's modified version and get the same thing as the official version. "Failed to resolve component 'ethernet'." This would have to break a ton of projects that incorporate Arduino libraries.

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

Re: arduino-esp32 IDF component build failure

Postby daneast » Fri May 01, 2020 1:01 am

The codebase between the SDK and this Arduino component have deviated too much. For example, the ethernet component is now named esp_eth. I started to pull all of the headers out of the SDK and update those in the Arduino component but it is just too tedious to do manually. All of the needed include files are in deeper subdirectories in the SDK, then it isn't clear what all is actually needed, etc. Simply replacing the ethernet component headers with the esp_eth headers, and updating the makefile list, does not work - the other headers are not compatible.

Another note on Derrick's fork of the repo above, is that it has some hardcoded paths like "C:/Derrick/", so it won't work on anyone else's environment but his. Plus it also is based on an older version of the SDK that still has the ethernet component instead of esp_eth.

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Re: arduino-esp32 IDF component build failure

Postby abansal22 » Sun May 03, 2020 5:35 am

gpeyton wrote:
Sun Apr 12, 2020 9:37 pm
I am trying to add the Arduino library as a component, following these instructions:
https://github.com/espressif/arduino-es ... mponent.md

I am able to reproduce the error found here:
https://github.com/espressif/arduino-esp32/issues/3457

Procedure:
- Checkout v4.1-beta1 IDF branch, and reinstall IDF with Eclipse
- Add hello_world project to Eclipse and ensure hello_world builds
- Follow the guide to add arduino-esp32 as a component
- Refresh project in Eclipses and rebuild

It fails with:

Code: Select all

CMake Error at ~/esp/esp-idf/tools/cmake/build.cmake:186 (message):
  Failed to resolve component 'ethernet'.
...
FAILED: build.ninja 
Please can you let me know if there is a fix or workaround for this? At the moment, the Arduino library is completely unusable as a component, but I need to use it.

Thanks!
i am using arduino as a component in esp idf 4.0. I am using the vs code. I use the platform io and the espressif extension in the vs code all goes well.

Please follow these steps:
1. download the arduino compatable with the idf version 4.0. Here is the link
https://github.com/espressif/arduino-es ... lease/v4.0

2. install the esp idf in ecllipse as followed by this link.
https://github.com/espressif/idf-eclipse-plugin

3. Now open the hello world project and make a new directory called the "components" (please make the directory of this specific name only). copy the downloaded arduino folder in the components directory.

4. Now we need to configure one more thing only. Now open the sdk configuration editor( as describe in step 2. url). Go to the Component config -> mbedTLS-> TLS Key Exchange Methods->Enable pre-shared-key ciphersuites . enable this option and we are good to go.

5. Now build the project it should be compiled properly.

Please let me know if you need anything more .

jason.a
Posts: 2
Joined: Sun Aug 23, 2020 1:08 pm

Re: arduino-esp32 IDF component build failure

Postby jason.a » Sun Aug 23, 2020 1:15 pm

Hi, i may have found something that may fix this, go to the project file in which you have clone the arduino-esp32 git to be used as idf component. Then open the CMakeLists txt file and scroll down until you come across the line that reads "set(COMPONENT_REQUIRES spi_flash mbedtls mdns ethernet esp_adc_cal wifi_provisioning)" and change the ethernet in that line to esp_eth, then try to get to menuconfig by using idf.py menuconfig again if you're on windows.,

Currently it looks like it's working though i haven't test it on compiling code which uses the arduino library using esp-idf.

yorkwei
Posts: 3
Joined: Mon Sep 07, 2020 7:55 am

Re: arduino-esp32 IDF component build failure

Postby yorkwei » Mon Sep 07, 2020 7:59 am

I use abansal22's method, it works! Thanks a lot!

kraxor
Posts: 7
Joined: Wed Jan 13, 2021 12:08 pm

Re: arduino-esp32 IDF component build failure

Postby kraxor » Wed Jan 13, 2021 12:48 pm

For anyone else landing here in 2021:

The master branch of esp32-arduino won't build with newer esp-idf versions (e.g. 4.2). If you're getting the "Failed to resolve component 'ethernet'." error, you'll probably want to switch to a branch that supports your esp-idf version:

Code: Select all

cd /path/to/esp32-arduino
git checkout idf-release/v4.2
Then you might get an error such as

Code: Select all

esp_littlefs.h: no file or directory

If so:

Code: Select all

cd /path/to/idf/components
git submodule add https://github.com/joltwallet/esp_littlefs.git
git submodule update --init --recursive
If your bluetooth is not enabled, you'll get:

Code: Select all

error: 'WIFI_PROV_SCHEME_BLE' was not declared

Just enable bluetooth it in menuconfig.

raghak
Posts: 1
Joined: Mon Jan 25, 2021 8:19 am

Re: arduino-esp32 IDF component build failure

Postby raghak » Mon Jan 25, 2021 8:23 am

yorkwei wrote:
Mon Sep 07, 2020 7:59 am
I use abansal22's method, it works! Thanks a lot!
@yorkwei, thanks a lot. used your suggestion and It worked for me.

Who is online

Users browsing this forum: No registered users and 198 guests