PlatformIO Community

Problem with libraries AsyncTCP.h

Although I do everything for the library installation in the platformio ide, I can’t get any results. I’ve done a few basic projects before, but somehow I couldn’t show the #include <AsyncTCP.h> library. I would be glad if you help


My main.c :

#include <AsyncTCP.h>
#include <WiFi.h>
const char* wifi_network_ssid = "UniqueID";
const char* wifi_network_password =  "xxxxx";
const char *soft_ap_ssid = "MyESP32AP";
const char *soft_ap_password = "testpassword";
AsyncWebServer server(80);
void setup() {
  WiFi.softAP(soft_ap_ssid, NULL);
  IPAddress local_IP(10,0,35,1);
  IPAddress gateway(10,0,35,1);
  IPAddress subnet(255,255,0,0);
  Serial.print("Setting soft-AP configuration ... ");
  Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed!");
  WiFi.begin(wifi_network_ssid, wifi_network_password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.println("Connecting to WiFi..");
  Serial.print("ESP32 IP as soft AP: ");
  Serial.print("ESP32 IP on the WiFi network: ");
  server.on("", HTTP_GET, [](AsyncWebServerRequest * request) {
    if (ON_STA_FILTER(request)) {
      request->send(200, "text/plain", "Hello, ESP using as a Station");
    } else if (ON_AP_FILTER(request)) {
      request->send(200, "text/plain", "Hello, ESP using as an Access Point");
    request->send(200, "text/plain", "Hello from undefined");
void loop() {}

You haven’t shown your platformio.ini? Did you add the library to lib_deps?

Yeah, I included many libraries in it

…You’re tripple including AsyncTCP and Arduino-ESP32, which is very wrong. A library should only be included from one source, and an entire Arduino core can’t just be included as a ‘library’.

The reason why library inclusion of all of that is failing is because you’re using the custom platform Libraries include in their manifest, library.json, which platforms they’re compatible with. EPS32 chips belong to the official espressif32 platform. You’re usung deneyap as a platform, which doesn’t match what the library wants to see

Especially since it sets libCompatMode to 2, meaning strict.

You can use lib_compat_mode = off in the platformio.ini to disable this compatibility check.

platform = deneyap
framework = arduino
board = deneyapkart
build_flags = -DCORE_DEBUG_LEVEL=5 
monitor_speed = 115200
; disable compatibility checks
lib_compat_mode = off
lib_ldf_mode = deep
lib_deps =

Overall, I don’t see the sense in using a dedicated platform for a single board that is exactly an ESP32, for which support already exists regularily, but okay.

1 Like

I’m just getting started with these. Thanks for your help but I got same error again
second image : 9w925q0.png

Yeah because of the library’s library.json overriding the global compat setting.

PLATFORM: Deneyap (1.0.0+sha.e231d85) (git+ > Deneyap Kart
HARDWARE: ESP32 240MHz, 8.52MB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-arduinoespressif32 3.10006.210326 (1.0.6) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ deep, Compatibility ~ off
Platform incompatible library /home/max/temp/.pio/libdeps/deneyapkart/AsyncTCP
More details about "Library Compatibility Mode":
Found 28 compatible libraries
Scanning dependencies...
No dependencies

Seems like a fork is necessary.

1 Like


platform = deneyap
framework = arduino
board = deneyapkart
build_flags = -DCORE_DEBUG_LEVEL=5 
monitor_speed = 115200
; disable compatibility checks
lib_compat_mode = off
lib_ldf_mode = deep
lib_deps =

works with

#include <Arduino.h>
#include <AsyncTCP.h>

void setup(){}
void loop(){}
Linking .pio/build/deneyapkart/firmware.elf
Retrieving maximum program size .pio/build/deneyapkart/firmware.elf
Checking size .pio/build/deneyapkart/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.2% (used 13416 bytes from 8937472 bytes)
Flash: [=         ]   8.5% (used 266606 bytes from 3145728 bytes)
Building .pio/build/deneyapkart/firmware.bin v3.0
========================= [SUCCESS] Took 4.15 seconds =========================

My fork removes the compatiblity check. (

Thank you for your help, I am grateful. Library issue solved So As I understand, Do I need to do this for every library that I will include? like wifi.h?


@maxgerhardt … thanks for this. The inputs have helped me in solving problem with AsyncMqttClient_Generic library which was giving LwIP.h not found error.