After a first successful simple blink example using PlatformIO with VSCode and Ubuntu 21.10 on a ESP32 devkit V1, I tried to copy esp-idf/examples/protocols/http_server/restful_server
for use within PlatformIO. The example perfectly builds using idf.py build
. The first problem is that ESP-IDF expects the sources to be in main
while running pio init
expects the sources to be in src
. Somewhere I read that this is hardcoded, so I moved mv main src
. But then idf.py build
no longer builds.
So I tried to build by pio
setting up platformio.ini
with pio project init -b esp32doit-devkit-v1 --ide=vscode -O "framework = espidf"
but it is not terminating at all. After terminating by Ctrl-C there was a platformio.ini
with:
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = espidf
So I tried pio run
which failed with Error: Couldn't find the main target of the project!
. I found a hint to work around this by using platform = espressif32@1.11.2
. So pio run
realy starts to compile but now failed with fatal error: esp_vfs_semihost.h: No such file or directory
.
Is there a step by step tutorial, how to build the examples from esp-idf/examples
using PlatformIO? Or is there an import procedure that I missed? PlatformIO within VSCode only provides import for Arduino projects, not for IDF.
Thanks in advance.