ESP-IDF version doesn't match structures in code

I’m using platform = espressif32 @ 6.9.0. In the release notes I can see

If I understand, I can use ESP-IDF 5.3.1 APIs, but I got compiling errors when trying to do it.

I tried :

Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));

and I got

ESP-IDF version is: v4.4.7-dirty

Then I tried APIs from ESP-IDF 4.4.7 but they also gave a compile error.
I finally tried the APIs from ESP-IDF 3.3 and they worked. So, my question is, how can I set up the correct ESP-IDF version? I want to use the latest one.

The specific API I’m testing is

“mqtt_client.h”

. When using the struct

" esp_mqtt_client_config_t"

Thanks a lot in advance

Would you be able to provide your complete platformio.ini file? Also if you want help with the compile error, please provide that as well.


When you define your platform as espressif32@6.9.0 inside of your platformio.ini file that enables you to use framework as arduino, espidf, or arduino, espidf. I suspect you are aiming to use just Arduino, which will lock you to using V4.4.7 of ESP-IDF.

If you want to have support for more recent versions of ESP-IDF, you can look into using the open source platform pioarduino.

1 Like

When using framework = arduino and platform = espressif32@6.9.0, you indeed get Arduino Core 2.0.17 which is based on ESP-IDF v4.4.7. That doesn’t meane that all components from there are included though. So which v.4.4.7 APIs have you tried exactly?

Also, when using framework = arduino, it’s best to use Arduino APIs for everything before resorting to ESP-IDF.

Note that https://github.com/pioarduino/platform-espressif32 exists as an updated version. By e.g. setting

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip

you get “Arduino core 3.1.1 based on IDF 5.3.2.241224”, which means you should be able to call into ESP-IDF 5.3.2 APIs without a problem.

1 Like