PlatformIO Community

Platform not supported Error when using ESPAsyncWebServer for ESP32

Hi,
I am using ESP32 Dev Module.
When I am adding ESPAsyncWebServer.h I get this error while building:
Building in release mode
Compiling .pio/build/esp32dev/esp-idf/src/main.cpp.o
Generating LD script .pio/build/esp32dev/esp32_out.ld
Generating partitions .pio/build/esp32dev/partitions.bin
Compiling .pio/build/esp32dev/esp-idf/app_trace/app_trace.c.o
Compiling .pio/build/esp32dev/esp-idf/app_trace/app_trace_util.c.o
Compiling .pio/build/esp32dev/esp-idf/app_trace/host_file_io.c.o
Compiling .pio/build/esp32dev/esp-idf/app_trace/gcov/gcov_rtio.c.o
In file included from src/main.cpp:14:
.pio/libdeps/esp32dev/ESP Async WebServer_ID306/src/ESPAsyncWebServer.h:38:2: error: #error Platform not supported
#error Platform not supported
^~~~~
Compiling .pio/build/esp32dev/esp-idf/app_update/esp_ota_ops.c.o
Compiling .pio/build/esp32dev/esp-idf/app_update/esp_app_desc.c.o
In file included from .pio/libdeps/esp32dev/ESP Async WebServer_ID306/src/ESPAsyncWebServer.h:462,
from src/main.cpp:14:
.pio/libdeps/esp32dev/ESP Async WebServer_ID306/src/AsyncWebSocket.h:29:10: fatal error: ESPAsyncTCP.h: No such file or directory

This is my platformio file:
[env:esp32dev]

platform = espressif32

framework = arduino, espidf

board = esp32dev

build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"

monitor_speed = 115200

platform_packages =

; use a special branch

framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0

# using the latest stable version

lib_deps =

ESP Async WebServer

AsyncTCP

SHA-1 Hash

When I remove espidf as a framework in the platform.ini file it builds successfully for some reason.

Not sure why it says unsupported platform.

In a nutshell, CMakeLists.txt for Arduino framework doesn’t contain required CPPDEFINES. Try adding -D ESP32 to your platfromio.ini:

platform = espressif32
framework = arduino, espidf
board = esp32dev
build_flags = 
    -D ESP32
1 Like