Esp32 with wifi continuously reboots

Using PlatformIO I can get programs that do not use wifi working on my esp32. When I try an example that uses wifi, however, the esp32 continuously reboots.
I have separately also installed the compiler and esp-idf directly from Espressif. With those I can get the examples with wifi working. If I use the exact same code (with sdkconfig translated into a .h file) in PlatformIO it continuously reboots again.
What am I doing wrong?

What is your platformio.ini file?

The platformio.ini file is:

platform = espressif32
board = esp32dev
framework = espidf
upload_speed = 921600

The code is (with credentials filled in) the same as


I am not sure what that post tells me. I have updated framework-espidf via platformio to version 1.90.0.
I also tested it by making a copy of the “external” esp-idf files to ~/.platformio/packages/framework-espidf (keeping the package.json), but that gave a number of errors of missing files.

See my latest comment


It works, thanks!