Skip to content

ESPAsyncWebServer Library Compatibility Issues with ESP32-S3 and ESP-IDF #260

@ayhamalji2

Description

@ayhamalji2

Platform

ESP32

IDE / Tooling

PlatformIO

What happened?

Environment

  • Platform: ESP32-S3 (4D Systems GEN4-ESP32 16MB)
  • Framework: Arduino + ESP-IDF
  • ESP-IDF Version: 4.4.6
  • PlatformIO Version: Latest
  • Library: ESPAsyncWebServer (multiple versions tested)

What happened?

The ESPAsyncWebServer library and its dependencies are experiencing compatibility issues with newer ESP-IDF versions, specifically with the ESP32-S3 platform. The library was designed for older ESP-IDF versions and hasn't been updated to support the newer networking stack changes.

Key Issues:

  1. IP Address Structure Changes: The ip_addr_t structure has been updated in newer ESP-IDF versions, where the .addr member has been replaced with .u_addr.
  2. Missing Headers: The interrupts.h header file is no longer available or has been moved in the current ESP-IDF version.
  3. Library Version Mismatch: The ESPAsyncWebServer library and its dependencies (RPAsyncTCP, ESPAsyncTCP) were designed for older ESP-IDF versions.

Stack Trace

Stack Trace

1. RPAsyncTCP Library Errors

.pio/libdeps/4d_systems_esp32s3_gen4_r8n16/RPAsyncTCP/src/RPAsyncTCP.cpp:231:8: error: 'ip_addr_t' {aka 'struct ip_addr'} has no member named 'addr'; did you mean 'u_addr'?
   addr.addr = ip;
        ^~~~
        u_addr

Multiple occurrences of this error in:

  • AsyncClient::connect(IPAddress, uint16_t)
  • AsyncClient::connect(const char*, uint16_t)
  • AsyncClient::operator==(const AsyncClient&) const
  • AsyncClient::_dns_found(ip_addr_t*)
  • AsyncClient::getRemoteAddress() const
  • AsyncClient::getLocalAddress() const
  • AsyncServer::begin()

2. ESPAsyncTCP Missing Header

.pio/libdeps/4d_systems_esp32s3_gen4_r8n16/ESPAsyncTCP/src/SyncClient.cpp:25:10: fatal error: interrupts.h: No such file or directory

Minimal Reproductible Example (MRE)

Minimal Reproducible Example (MRE)

platformio.ini

[env:4d_systems_esp32s3_gen4_r8n16]
platform = espressif32
board = 4d_systems_esp32s3_gen4_r8n16
framework = arduino, espidf
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
board_build.psram = enabled
board_build.filesystem = littlefs
board_build.partitions = custom_partitions.csv
build_type = debug
build_flags = 
	-Wno-error
	-Wno-reorder
	-Wno-logical-op
	-Wno-maybe-uninitialized
	-Wno-format-truncation
	-Wno-unused-variable
	-Wno-implicit-fallthrough
	-Wno-address
	-DCONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED=1
	-DCONFIG_MBEDTLS_SSL_PSK_MODES=1
	-DLITTLEFS_ENABLED=1
	-DARDUINO_LITTLEFS=1
lib_ldf_mode = deep
lib_extra_dirs = 
	lib
	.pio/libdeps/4d_systems_esp32s3_gen4_r8n16
lib_deps = 
	esp32async/ESPAsyncWebServer@^3.7.10

main.cpp

#include <Arduino.h>
#include <ESPAsyncWebServer.h>

AsyncWebServer server(80);

void setup() {
  Serial.begin(115200);
  
  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(200, "text/plain", "Hello World!");
  });
  
  server.begin();
  Serial.println("HTTP server started");
}

void loop() {
  delay(1000);
}

Steps to Reproduce:

  1. Create a new PlatformIO project with the above configuration
  2. Add the ESPAsyncWebServer library to lib_deps
  3. Create the main.cpp file with the minimal example
  4. Run pio run

Expected Result: Successful compilation and upload
Actual Result: Compilation fails with the errors shown in the stack trace

Impact

This issue prevents the use of ESPAsyncWebServer library on ESP32-S3 devices with current ESP-IDF versions, which is a significant limitation for projects requiring asynchronous web server functionality.

Requested Actions

  1. Update RPAsyncTCP library to use the correct ip_addr_t structure members (.u_addr instead of .addr)
  2. Fix ESPAsyncTCP library to handle the missing interrupts.h header
  3. Test compatibility with ESP32-S3 and current ESP-IDF versions
  4. Update documentation to reflect supported platforms and versions

Additional Context

This issue affects multiple ESPAsyncWebServer library variants and appears to be a systematic problem with the underlying TCP/Async libraries not being updated for newer ESP-IDF versions.


Note: This issue affects the entire ESPAsyncWebServer ecosystem and should be addressed at the dependency level (RPAsyncTCP, ESPAsyncTCP) as well as the main library level.

I confirm that:

  • I have read the documentation.
  • I have searched for similar discussions.
  • I have searched for similar issues.
  • I have looked at the examples.
  • I have upgraded to the lasted version of ESPAsyncWebServer (and AsyncTCP for ESP32).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions