Framework = espidf, arduino

I’ve performed this quick test, unfortunately the exact same error occurs :frowning:

The same error being:

from components\arduino\cores\esp32\esp32-hal-adc.c:15:
components\arduino\cores\esp32\esp32-hal-gpio.h:78:44: error: ‘SOC_GPIO_PIN_COUNT’ undeclared here (not in a function); did you mean ‘GPIO_PIN_COUNT’?
extern const esp32_gpioMux_t esp32_gpioMux[SOC_GPIO_PIN_COUNT];

I think my request may be simpler, since I want for the moment to just build a blink project, so it’s far from the need of bleeding-edge ESP-IDF.

I’ve seen quite a lot of issues and topics about working with Arduino as an ESP-IDF component, which is basically what I want to do.

As I said before, I managed to build the espidf-arduino-blink examples but I know for sure that in the future I’ll need to add modifications to the sdk (to work with AWS OTA) and the precompiled ESP-IDF won’t suffice.

I’ll keep trying to see what I find, if there’s any direction you could point me to, I’d be very grateful.

But, if you have managed to get that example working, you do have the ESP-IDF part configurable already. That is basically ESP-IDF plus Arduino as a component.

I’ve looked further into this and it is definitely a mismatch of Arduino-ESP32 with ESP-IDF. In the used ESP-IDF version, the macro SOC_GPIO_PIN_COUNT does not exist, only GPIO_PIN_COUNT. One can get it to build further by adding

build_flags =
   -DSOC_GPIO_PIN_COUNT=GPIO_PIN_COUNT
   -DMHZ=1000000

but then LitteFS breaks the compilation with a non-found header file. Given that there was this recent commit which says that it fixes building Arduino-ESP32 as a component, I will be focusing on getting the latest ESP-IDF and Arduino-ESP32 working instead.

EDIT: I’ve made some progress with using the latest Arduino-ESP32 and ESP-IDF version, but PlatformIO’s linking logic fails at the very end of the compilation. Due to ESP-IDF shuffling around linker fragment files in esp32: move common fragment definitions · espressif/esp-idf@bbc5994 · GitHub and esp32: move system libs · espressif/esp-idf@a202a60 · GitHub the logic in

fails.

I’m currently trying a variety of things with

    result["lf_files"].extend(
        [
            os.path.join( FRAMEWORK_DIR, "components", "esp_common", "common.lf"),
            os.path.join( FRAMEWORK_DIR, "components", "esp_common", "soc.lf"),
            os.path.join(FRAMEWORK_DIR, "components", "newlib", "newlib.lf"),
            os.path.join(FRAMEWORK_DIR, "components", "newlib", "system_libs.lf")
        ]
    )

but it won’t work yet, with that esptool.py fails.

1 Like

Hello there @maxgerhardt ,

It seems you’re really going the extra mile for that one, thank you for that!

I managed to compiled Arduino as ESP-IDF component, but I’m not sure if it is the correct way of doing it, anyways, I think it would be a good thing to share on this topic.

So after googling around I found this Github issue: Successfully built arduino-esp32 as component on esp-idf v4.2 release · Issue #4702 · espressif/arduino-esp32 · GitHub and decided to give it a try, so I started follwing these steps arduino-esp32/docs/esp-idf_component.md at mod-idf-v4.2 · summivox/arduino-esp32 · GitHub.

Since I’m using Windows, make menuconfig does not work, I had to use these instead

cd %userprofile%\esp\hello_world
idf.py set-target esp32
idf.py menuconfig

So with the Arduino component inside the hello-world ESP-IDF sample project I managed to build it inside ESP-IDF, I still had to move it to platformio. What I did then was placing a platformio.ini file inside the project root folder and then running ‘pio run -t menuconfig’ to set the AUTOSTART ARDUINO parameter.

I also had to change the main folder from ‘main’ to ‘src’ and change the base CMakeLists.txt to register the source code file (changed from hello_world_main.c to main.cpp).

Then after a quite long build process I managed to compile Arduino as a ESP-IDF component inside platformio, and I’m quite happy about that!

I already built a simple serial loop code, but I’ll try adding some other code to see if I can progress any further.

Thanks.

Interesting, that one uses --branch mod-idf-v4.2 https://github.com/summivox/arduino-esp32.git though from a fork and lags behind main Arduino-ESP32 by 176 commits – a slightler older version but if it works, okay. I’ll see if I can get mainline Arduino-ESP32 running which requires a bleeding edge ESP-IDF.

1 Like

Hello there @maxgerhardt,

Any progress towards getting Arduino-ESP32 and bleeding edge ESP-IDF together?

By the way, I took some time to learn the very basics of CMake, it’s helping me a lot with these ‘adaptations’ from one framework to the other as well as better understanding ESP-IDF itself, I’d recommend to fellow members of the pio community to do such as well, because it helped me tremendously being a beginner as I am!

So, my next step is to download an Amazon FreeRTOS sample from AWS website (which downloads a fraction of FreeRTOS as opposed to cloning the github repo) and integrate it with this ESP-IDF+Arduino as a component program.

I expect to find a lot of mismatches and cmake related stuff to do in order to integrate both codes, but I’ll keep my progress posted.

Thank you.

Support for ESP-IDF v4.3 was recently released (Releases · platformio/platform-espressif32 · GitHub) with the accompanying changes to the builder script – maybe those are already the changes needed to get it working for also v4.4. I’ll test if I can find time.

Just as a heads up, the solution I posted before (Framework = espidf, arduino - #20 by gkfernandes) does not seem to be working on pio any longer.

I’ve also tried to build the newest development arduino-esp32 version (v2.0.0-alpha) and there are errors that seem to be like some mismatch between the component and ESP-IDF versions, like the log below:

In file included from …/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:2:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:51:5: error: ‘tcpip_adapter_if_t’ does not name a type
tcpip_adapter_if_t _if;
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:70:5: error: ‘tcpip_adapter_if_t’ does not name a type
tcpip_adapter_if_t interface();
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:115:79: error: ‘tcpip_adapter_if_t’ has not been declared
bool listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
In file included from …/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:2:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:116:78: error: ‘tcpip_adapter_if_t’ has not been declared
bool listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:117:80: error: ‘tcpip_adapter_if_t’ has not been declared
bool listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:125:91: error: ‘tcpip_adapter_if_t’ has not been declared
size_t writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:126:90: error: ‘tcpip_adapter_if_t’ has not been declared
size_t writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:127:92: error: ‘tcpip_adapter_if_t’ has not been declared
size_t writeTo(const uint8_t *data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:131:66: error: ‘tcpip_adapter_if_t’ has not been declared
size_t broadcastTo(uint8_t *data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:132:58: error: ‘tcpip_adapter_if_t’ has not been declared
size_t broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:136:83: error: ‘tcpip_adapter_if_t’ has not been declared
size_t sendTo(AsyncUDPMessage &message, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:137:82: error: ‘tcpip_adapter_if_t’ has not been declared
size_t sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:138:84: error: ‘tcpip_adapter_if_t’ has not been declared
size_t sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:141:65: error: ‘tcpip_adapter_if_t’ has not been declared
size_t broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~
In file included from …/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:2:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:115:107: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
bool listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:115:107: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
bool listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
In file included from …/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:2:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:116:106: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
bool listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:116:106: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
bool listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:117:108: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
bool listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:117:108: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
bool listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl=1, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:125:119: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:125:119: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:126:118: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:126:118: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:127:120: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t writeTo(const uint8_t *data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:127:120: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t writeTo(const uint8_t data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:131:94: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t broadcastTo(uint8_t data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:131:94: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t broadcastTo(uint8_t data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:132:86: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:132:86: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:136:111: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t sendTo(AsyncUDPMessage &message, const ip_addr_t addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:136:111: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t sendTo(AsyncUDPMessage &message, const ip_addr_t addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:137:110: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:137:110: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:138:112: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:138:112: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:141:93: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
size_t broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.h:141:93: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
size_t broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX);
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: In constructor 'AsyncUDPPacket::AsyncUDPPacket(AsyncUDP
, pbuf
, const ip_addr_t
, uint16_t, netif
)':
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:285:5: error: ‘_if’ was not declared in this scope
_if = TCPIP_ADAPTER_IF_MAX;
^~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:285:11: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
_if = TCPIP_ADAPTER_IF_MAX;
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:285:11: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
_if = TCPIP_ADAPTER_IF_MAX;
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:318:35: error: ‘tcpip_adapter_if_t’ was not declared in this scope
tcpip_adapter_get_netif ((tcpip_adapter_if_t)i, &nif);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:318:35: note: suggested alternative: ‘tcpip_api_call’
tcpip_adapter_get_netif ((tcpip_adapter_if_t)i, &nif);
^~~~~~~~~~~~~~~~~~
tcpip_api_call
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:318:9: error: ‘tcpip_adapter_get_netif’ was not declared in this scope
tcpip_adapter_get_netif ((tcpip_adapter_if_t)i, &nif);
^~~~~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:318:9: note: suggested alternative: ‘ip_addr_get_network’
tcpip_adapter_get_netif ((tcpip_adapter_if_t)i, &nif);
^~~~~~~~~~~~~~~~~~~~~~~
ip_addr_get_network
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: At global scope:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:376:1: error: ‘tcpip_adapter_if_t’ does not name a type; did you mean ‘tcpip_api_call’?
tcpip_adapter_if_t AsyncUDPPacket::interface()
^~~~~~~~~~~~~~~~~~
tcpip_api_call
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: In member function 'virtual size_t AsyncUDPPacket::write(const uint8_t
, size_t)‘:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:452:62: error: ‘_if’ was not declared in this scope
return _udp->writeTo(data, len, &_remoteIp, _remotePort, _if);
^~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: At global scope:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:554:71: error: ‘tcpip_adapter_if_t’ has not been declared
static esp_err_t joinMulticastGroup(const ip_addr_t *addr, bool join, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX) ^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:554:99: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
static esp_err_t joinMulticastGroup(const ip_addr_t addr, bool join, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX) ^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:554:99: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
static esp_err_t joinMulticastGroup(const ip_addr_t addr, bool join, tcpip_adapter_if_t tcpip_if=TCPIP_ADAPTER_IF_MAX) ^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: In function 'esp_err_t joinMulticastGroup(const ip_addr_t
, bool, int)':
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:557:19: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
if(tcpip_if < TCPIP_ADAPTER_IF_MAX){
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:557:19: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
if(tcpip_if < TCPIP_ADAPTER_IF_MAX){
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:559:25: error: ‘tcpip_adapter_get_netif’ was not declared in this scope
esp_err_t err = tcpip_adapter_get_netif(tcpip_if, &nif);
^~~~~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:559:25: note: suggested alternative: ‘ip_addr_get_network’
esp_err_t err = tcpip_adapter_get_netif(tcpip_if, &nif);
^~~~~~~~~~~~~~~~~~~~~~~
ip_addr_get_network
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: At global scope:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:612:83: error: ‘tcpip_adapter_if_t’ has not been declared
bool AsyncUDP::listenMulticast(const ip_addr_t addr, uint16_t port, uint8_t ttl, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:636:99: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::writeTo(const uint8_t * data, size_t len, const ip_addr_t * addr, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: In member function 'size_t AsyncUDP::writeTo(const uint8_t
, size_t, const ip_addr_t
, uint16_t, int)’:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:655:23: error: ‘TCPIP_ADAPTER_IF_MAX’ was not declared in this scope
if(tcpip_if < TCPIP_ADAPTER_IF_MAX){
^~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:655:23: note: suggested alternative: ‘NETIF_ADDR_IDX_MAX’
if(tcpip_if < TCPIP_ADAPTER_IF_MAX){
^~~~~~~~~~~~~~~~~~~~
NETIF_ADDR_IDX_MAX
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:657:38: error: ‘tcpip_adapter_if_t’ was not declared in this scope
tcpip_adapter_get_netif((tcpip_adapter_if_t)tcpip_if, &nif);
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:657:38: note: suggested alternative: ‘tcpip_api_call’
tcpip_adapter_get_netif((tcpip_adapter_if_t)tcpip_if, &nif);
^~~~~~~~~~~~~~~~~~
tcpip_api_call
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:657:13: error: ‘tcpip_adapter_get_netif’ was not declared in this scope
tcpip_adapter_get_netif((tcpip_adapter_if_t)tcpip_if, &nif);
^~~~~~~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:657:13: note: suggested alternative: ‘ip_addr_get_network’
tcpip_adapter_get_netif((tcpip_adapter_if_t)tcpip_if, &nif);
^~~~~~~~~~~~~~~~~~~~~~~
ip_addr_get_network
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp: At global scope:
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:709:82: error: ‘tcpip_adapter_if_t’ has not been declared
bool AsyncUDP::listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:725:96: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:749:84: error: ‘tcpip_adapter_if_t’ has not been declared
bool AsyncUDP::listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:765:98: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::writeTo(const uint8_t *data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:791:72: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::broadcastTo(uint8_t *data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:796:64: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:815:89: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:823:88: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:831:90: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
…/vendors/espressif/esp-idf/components/arduino/libraries/AsyncUDP/src/AsyncUDP.cpp:847:71: error: ‘tcpip_adapter_if_t’ has not been declared
size_t AsyncUDP::broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if)
^~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Probably because the ESP-IDF version was updates to v4.3. Releases · platformio/platform-espressif32 · GitHub

Is there any latest update on this? Has this by chance gotten any easier to match the IDF version with the Arduino-ESP32 version?

No, the opposite, PlatformIO is lagging behind in even the Arduino core version by a lot. Support for the latest Arduino v2.0 · Issue #619 · platformio/platform-espressif32 · GitHub

Looks like this should work now since the latest release. I’m trying to build in PlatformIO and still getting this error that it can’t find Arduino.h. Anyone know why it can’t find that? Here is my error below:

Scanning dependencies…
Dependency Graph
|-- 1.5
|-- 3.1.0
|-- 0.15.0
Building in release mode
Compiling .pio/build/esp32devIDF/src/main.o
src/main.cpp:169:10: fatal error: Arduino.h: No such file or directory


  • Looking for Arduino.h dependency? Check our library registry!
  • CLI > platformio lib search “header:Arduino.h”
  • Web > PlatformIO Registry

Still trying to get this to work. Should the latest arduino-esp32.git work for this? The arduino/IDF examples use:

platform_packages =
; use a special branch
framework-arduinoespressif32 @ GitHub - marcovannoord/arduino-esp32: Arduino core for the ESP32

That package solves the missing Arduino.h problem but it looks like it’s 3 years old and is missing newer functions in the libraries.

How can I get the latest master to compile with all the latest functions/library updates?

I discovered that latest platform & packages are NOT compatible - you must take the develop branch from the platform and the latest from platform_packages.

Practically, this would suffice:

[env:esp32dev]
;; WARNING: any release in `master` FAIL with espidf + arduino!
;; Resorted to latest (Jun 2022) from `develop`.
platform = https://github.com/platformio/platform-espressif32.git#develop
;; WARNING: last release (eg 2.0.3) FAIL espidf + arduino!
;; Resorted to latest (Jun 2022).
platform_packages =
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
framework = arduino

For reproducible and builds and future proofing, i would pin the specific git-hashes, above - the compatibility across these 2 projects seems to break often.

Please report any progress.

Is there any update on this? Should this work now on the latest Espressif32 by using framework= espidf, arduino?

It doesn’t seem to work for me, but it seems much closer.

I had to retract the repo due to some branch leaking (low-importance but nevertheless) secrets .

Now it’s back up there.

@valeros Does the latest Espressif32 version allow building this way out of the box yet?

@bwjohns4 I believe so.

@valeros , this worked!!! But I did have to get the Python chardet module installed. I was getting an error (ModuleNotFoundError: No module named ‘chardet’) on my M1 macbook compiling and found this forum post which solved the issue for me. Hopefully this can get added in upcoming releases.

@valeros , I think this is still an issue with the latest. I’m on M1 Macbook and have to do a roundabout copy of the chardet library everytime I upgrade. Should I flag this somewhere else?