PlatformIO Community

How can I update ESP-IDF components within PlatformIO

I am trying to use the wifi_provisioning component provided with ESP-IDF using the default example provided. If I use plain vanilla ESP-IDF - it works fine! However if I use PlatformIO-ESP IDF then I get a bunch of errors at build time.

For example, the first error I get is
Building in release mode
Compiling .pio/build/esp32dev/src/main.o
Generating LD script .pio/build/esp32dev/esp32_out.ld
Generating partitions .pio/build/esp32dev/partitions.bin
Compiling .pio/build/esp32dev/components/Arduino_Port/arduino_misc_func.o
Compiling .pio/build/esp32dev/components/HX711/HX711.o
Compiling .pio/build/esp32dev/components/Wifi_Prov/Wifi_Prov.o
Archiving .pio/build/esp32dev/esp-idf/Arduino_Port/libArduino_Port.a
Indexing .pio/build/esp32dev/esp-idf/Arduino_Port/libArduino_Port.a
In file included from /Users/sriraj/.platformio/packages/framework-espidf/components/esp_timer/include/esp_timer.h:45,
from /Users/sriraj/.platformio/packages/framework-espidf/components/freertos/port/xtensa/include/freertos/portmacro.h:46,
from /Users/sriraj/.platformio/packages/framework-espidf/components/freertos/include/freertos/portable.h:52,
from /Users/sriraj/.platformio/packages/framework-espidf/components/freertos/include/freertos/FreeRTOS.h:64,
from components/Wifi_Prov/include/Wifi_Prov.h:4,
from components/Wifi_Prov/Wifi_Prov.c:1:
components/Wifi_Prov/Wifi_Prov.c: In function 'provision_wifi':
components/Wifi_Prov/Wifi_Prov.c:109:21: error: implicit declaration of function 'wifi_prov_mgr_reset_provisioning'; did you mean 'wifi_prov_mgr_start_provisioning'? [-Werror=implicit-function-declaration]
ESP_ERROR_CHECK(wifi_prov_mgr_reset_provisioning());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/sriraj/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:119:31: note: in definition of macro 'ESP_ERROR_CHECK'
esp_err_t __err_rc = (x);
^'
Compiling .pio/build/esp32dev/app_trace/app_trace.o'-

I navigated to ~/.platformio/packages/framework-espidf/components/wifi_provisioning/include/wifi_provisioning/manager.h and the function wifi_prov_reset_provisioning is missing. version.txt denotes 4.3.0 as the ESP-IDF version

So, I replaced just the wifi_provisioning component files with the latest and greatest from GIT and still I receive the same error. That tells me that PlatformIO is using an already built version of ESP-IDF somewhere.

How can I force PlatformIO to either use a newer version of ESP-IDF or rebuild its internal ESP-IDF framework with the replaced files.

Alternatively, can I point my program to just one component in the newest ESP-IDF library?

Thanks for your help in advance

The latest upstream platform-espressif32 has ESP-IDF v4.3.1 support per https://github.com/platformio/platform-espressif32/commits/develop. Have you tried doing using the upstream URL in platform per Espressif 32 — PlatformIO latest documentation to get that version?

Hello - thanks for the suggestion but for some reason it is not working for me. I have provided the platformio.ini file as well build error I am seeing

platformio.ini
[env:esp32dev]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32dev
framework = espidf
monitor_speed = 115200
monitor_port = /dev/cu.usbserial-14320

Build error:
PACKAGES:
- framework-espidf 3.40301.0 (4.3.1)
- tool-cmake 3.16.4
- tool-esptoolpy 1.30100.210531 (3.1.0)
- tool-ninja 1.9.0
- toolchain-esp32ulp 1.22851.191205 (2.28.51)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType:
File “/Users/sriraj/.platformio/penv/lib/python3.9/site-packages/platformio/builder/main.py”, line 180:
env.SConscript("$BUILD_SCRIPT")
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py”, line 597:
return _SConscript(self.fs, *files, **subst_kw)
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py”, line 285:
exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
File “/Users/sriraj/.platformio/platforms/espressif32@src-5f117260f75b328038ec9d3fd0e14a68/builder/main.py”, line 233:
target_elf = env.BuildProgram()
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Util.py”, line 748:
return self.method(*nargs, **kwargs)
File “/Users/sriraj/.platformio/penv/lib/python3.9/site-packages/platformio/builder/tools/platformio.py”, line 61:
env.ProcessProgramDeps()
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Util.py”, line 748:
return self.method(*nargs, **kwargs)
File “/Users/sriraj/.platformio/penv/lib/python3.9/site-packages/platformio/builder/tools/platformio.py”, line 128:
env.BuildFrameworks(env.get(“PIOFRAMEWORK”))
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Util.py”, line 748:
return self.method(*nargs, **kwargs)
File “/Users/sriraj/.platformio/penv/lib/python3.9/site-packages/platformio/builder/tools/platformio.py”, line 343:
SConscript(env.GetFrameworkScript(f), exports=“env”)
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py”, line 660:
return method(*args, **kw)
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py”, line 597:
return _SConscript(self.fs, *files, **subst_kw)
File “/Users/sriraj/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py”, line 285:
exec(compile(scriptdata, scriptname, ‘exec’), call_stack[-1].globals)
File “/Users/sriraj/.platformio/platforms/espressif32@src-5f117260f75b328038ec9d3fd0e14a68/builder/frameworks/espidf.py”, line 63:
assert os.path.isdir(TOOLCHAIN_DIR)
File “/Users/sriraj/.platformio/python3/lib/python3.9/genericpath.py”, line 42:
st = os.stat(s)

You are correct, the current bleeding edge version has a bug. https://github.com/platformio/platform-espressif32/issues/665

1 Like