Page 1 of 1

Using esp-idf in arduino: issues with librairies / components

Posted: Sun Feb 23, 2020 2:22 pm
by bobo1974
I'm using arduino, and so far I could always add some occasionnal esp-idf libraries (or components, not sure what's the difference) in my project, by adding the header. Like:

Code: Select all

#include "C:\esp\esp-idf\components\esp_https_ota\include\esp_https_ota.h"
I have the esp-idf in C:\esp\esp-idf, and arduino in C:\Users\USERNAME\AppData\Local\Arduino15.

However I now include a .h file that has itself some other includes in the IDF and it doesn't compile. so here for instance:
I included tcpip_adapter_types.h with its full path, but it contains an include to "esp_netif_sta_list.h" with no directory and it breaks.

Code: Select all

C:\esp\esp-idf\components\tcpip_adapter\include\tcpip_adapter_types.h:20:32: fatal error: esp_netif_sta_list.h: No such file or directory
Manually adding the path seem very dirty, is there a way to include a search path for the libraries in arduino so that it searches in the esp-idf files as well?

Re: Using esp-idf in arduino: issues with librairies / components

Posted: Sun Feb 23, 2020 8:08 pm
by boarchuz
I'm surprised you haven't run into issues sooner. You probably don't realise that your esp32-arduino installation includes the full IDF. The Arduino stuff is built to be compatible with that specific IDF version, and the IDF is configured and compiled to the requirements of Arduino. Mixing and matching is going to result in headaches even if you know what you're doing.

In this case it sounds like your external IDF is 4.0 while Arduino is probably built on 3.3.

Try

Code: Select all

#include "esp_https_ota.h"

Re: Using esp-idf in arduino: issues with librairies / components

Posted: Sun Feb 23, 2020 8:31 pm
by bobo1974
Thanks for helping.
2 reasons why I tried to include some esp-idf files instead of the arduino's one:

- some files do not exist in the arduino code : example: tcpip_adapter_types.h
Tipically this one doesnt compile, was unfound, which made me start to try and include it from somewhere else.
Not sure why, but I can't find it in the arduino directories. So I included it with the full path to my idf installation (4.0). Error is gone, but I get the next one: esp_netif_sta_list.h which is included in tcpip_adapter_types.h.

- some files are quite old in the arduino code, and I needed some latest bug correction. esp_https_ota.h is an example. I installed the latest IDF as I saw it corrected many bugs I was running into.

Re: Using esp-idf in arduino: issues with librairies / components

Posted: Mon Feb 24, 2020 6:17 am
by bobo1974
In case someone want to give it a try I was just trying to compile this code on arduino: ping program.

https://github.com/nopnop2002/esp-idf-p ... aster/main