Update esp_wifi.h to include esp_wifi_ftm_get_report()

Hey folks,

I am using platformio with vscode and I am trying to implement Finite Time Measurement (FTM) in my project however I am having dependency issues at compile time that seem to be related platformio not being up to date on new functions offered by ESP. Hence I was wondering what your options / thoughts were about this.
I am trying to use the function esp_wifi_ftm_get_report() however this function is “not declared in this scope” in the platformio reference that my project is using :
~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32c3/include/esp_wifi/include$
Since I had red squiggly lines under every #include ESP_somethings, I decided I’d download the ESP-IDF and create a link in the includePath variable of c_cpp_properties.json. So when I’m coding in VSCode, I don’t have issues as my project refers to the most recent libraries… but when I compile, platformio refers to a version that is at least 5 months old (this function I want seems to have been added 5 months ago).,… hence my question to you all, what is the best way to solve this issue ? Add a build flag ?

Thank you all for your time, :slight_smile:

Well, the functions you are referring to come from ESP-IDF 5.x.
ESP-IDF 5.x is only available with Arduino 3.x.
In PlatformIO the Arduino framework is still at version 2.x which is based on ESP-IDF 4.x. For this reason, the functions are not available to you.

Here comes the catch:
Arduino 3.x is not officially available for PlatformIO and may never be. See Support Arduino ESP32 v3.0 based on ESP-IDF v5.1 · Issue #1225 · platformio/platform-espressif32 · GitHub

This is why the community fork “pioarduino” exists.

Give it a try!

Using pioarduino, the FMT example compiles out of the box and the requested functions are available to you :slight_smile:

Thanks for the quick answer @sivar2311 :upside_down_face:
let me try that out and I’ll give some feedback here for posterity ! :herb: