AsyncWebServer is no longer working "Crashing" with ESP32-S3-WROOM

i am using ESP32-s3-WROOM cam board.
i used to compile and use AsyncWebServer library normally , i do not know what recently happened when i am trying to compile even simple code with the AsyncWebServer library the board is crashing "even with the simplest code "

I already built lot of projects with the AsyncWebServer library however now all of them are giving the same crash

appereciate if anyone can advise regarding workaround or fix

#include <WiFi.h>
#include <ESPAsyncWebServer.h>

// Network credentials
const char* ssid = "ssid123";
const char* password = "pass123";

// Create AsyncWebServer object on port 80
AsyncWebServer server(80);

void setup() {
  // Initialize Serial Monitor
  Serial.begin(115200);

  // Connect to WiFi
  WiFi.begin(ssid, password);
  Serial.println("Connecting to WiFi...");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  // Print the IP address
  Serial.println("\nConnected to WiFi!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());

  // Define a route to serve a web page
  server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) {
    request->send(200, "text/plain", "ESP32 Webserver");
  });

  // Start the server
  server.begin();
  Serial.println("Webserver started!");
}

void loop() {
  // Nothing needed in the loop for AsyncWebServer
}

and it crashes generating the error

..[  2800][V][STA.cpp:216] _onStaEvent(): STA Disconnected: SSID: ZAYTOUNA 721-5Ghz, BSSID: 80:69:1a:05:ee:84, Reason: 39
[  2811][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 113 - STA_DISCONNECTED
[  2819][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 113 - STA_DISCONNECTED
[  2827][W][STA.cpp:137] _onStaArduinoEvent(): Reason: 39 - TIMEOUT
[  2833][D][STA.cpp:155] _onStaArduinoEvent(): WiFi Reconnect Running
[  2839][W][STA.cpp:541] disconnect(): STA already disconnected.
[  3020][V][STA.cpp:206] _onStaEvent(): STA Connected: SSID: ZAYTOUNA 721-5Ghz, BSSID: 80:69:1a:05:ee:84, Channel: 12, Auth: WPA2_PSK
[  3032][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 112 - STA_CONNECTED
[  3040][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 112 - STA_CONNECTED
.[  3196][V][NetworkInterface.cpp:78] _onIpEvent(): sta Got New IP: 192.168.1.116 MASK: 255.255.255.0 GW: 192.168.1.1
[  3207][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 115 - STA_GOT_IP
[  3214][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 115 - STA_GOT_IP
[  3221][V][STA.cpp:171] _onStaArduinoEvent(): STA IP: 192.168.1.116, MASK: 255.255.255.0, GW: 192.168.1.1
.
Connected to WiFi!
IP Address: 192.168.1.116
assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)
Backtrace: 0x403764c2:0x3fca94d0 0x4037cb45:0x3fca94f0 0x40383539:0x3fca9510 0x42023f17:0x3fca9640 0x42024081:0x3fca9660 0x4200ca39:0x3fca9680 0x4200bbcd:0x3fca96d0 0x42003053:0x3fca96f0 0x42010e5f:0x3fca9760 0x4037d832:0x3fca9780
ELF file SHA256: 6f1ba6c36
Rebooting...

@gomaa1, @eltabakh_gomaa,

Please read and respond to the private message I have sent you.

Thank you.

OP, please post as @eltabakh_gomaa, your second account has been suspended.

Thank you.

That is not a Arduino Nano ESP32 and hence your topic has been moved.

i am using ESP32-s3-WROOM cam board.
i used to compile and use AsyncWebServer library normally , i do not know what recently happened when i am trying to compile even simple code with the AsyncWebServer library the board is crashing "even with the simplest code "

I already built lot of projects with the AsyncWebServer library however now all of them are giving the same crash

appereciate if anyone can advise regarding workaround or fix

#include <WiFi.h>
#include <ESPAsyncWebServer.h>

// Network credentials
const char* ssid = "ZAYTOUNA 721";
const char* password = "pass123";

// Create AsyncWebServer object on port 80
AsyncWebServer server(80);

void setup() {
  // Initialize Serial Monitor
  Serial.begin(115200);

  // Connect to WiFi
  WiFi.begin(ssid, password);
  Serial.println("Connecting to WiFi...");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  // Print the IP address
  Serial.println("\nConnected to WiFi!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());

  // Define a route to serve a web page
  server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) {
    request->send(200, "text/plain", "ESP32 Webserver");
  });

  // Start the server
  server.begin();
  Serial.println("Webserver started!");
}

void loop() {
  // Nothing needed in the loop for AsyncWebServer
}

and it crashes generating the error

..[  2800][V][STA.cpp:216] _onStaEvent(): STA Disconnected: SSID: ZAYTOUNA 721, BSSID: 80:69:1a:05:ee:84, Reason: 39
[  2811][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 113 - STA_DISCONNECTED
[  2819][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 113 - STA_DISCONNECTED
[  2827][W][STA.cpp:137] _onStaArduinoEvent(): Reason: 39 - TIMEOUT
[  2833][D][STA.cpp:155] _onStaArduinoEvent(): WiFi Reconnect Running
[  2839][W][STA.cpp:541] disconnect(): STA already disconnected.
[  3020][V][STA.cpp:206] _onStaEvent(): STA Connected: SSID: ZAYTOUNA 721, BSSID: 80:69:1a:05:ee:84, Channel: 12, Auth: WPA2_PSK
[  3032][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 112 - STA_CONNECTED
[  3040][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 112 - STA_CONNECTED
.[  3196][V][NetworkInterface.cpp:78] _onIpEvent(): sta Got New IP: 192.168.1.116 MASK: 255.255.255.0 GW: 192.168.1.1
[  3207][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 115 - STA_GOT_IP
[  3214][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 115 - STA_GOT_IP
[  3221][V][STA.cpp:171] _onStaArduinoEvent(): STA IP: 192.168.1.116, MASK: 255.255.255.0, GW: 192.168.1.1
.
Connected to WiFi!
IP Address: 192.168.1.116
assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)
Backtrace: 0x403764c2:0x3fca94d0 0x4037cb45:0x3fca94f0 0x40383539:0x3fca9510 0x42023f17:0x3fca9640 0x42024081:0x3fca9660 0x4200ca39:0x3fca9680 0x4200bbcd:0x3fca96d0 0x42003053:0x3fca96f0 0x42010e5f:0x3fca9760 0x4037d832:0x3fca9780
ELF file SHA256: 6f1ba6c36
Rebooting...

so specifically the below line

assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)

Please do not cross-post. Topics merged.

Do not post in "Uncategorized".

A wild guess is this is caused by the V3 board changes.

Hi @eltabakh_gomaa. I see a report of this in the library's issue tracker:

An affected user reported that they experienced the problem while using the latest version 3.1.0 of the esp32 platform, but found that it did not occur after they downgraded the platform to 3.0.7.

I was not able to reproduce the crash even after uploading your sketch to my ESP32-S3 board using version 3.1.0 of the esp32 platform. So I'm not able to verify the reported workaround, but if you want to give it a try I'll provide instructions you can follow to install version 3.0.7 of the platform:

  1. Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Scroll down through the list of boards platforms until you see the "esp32" entry.
  3. Select "3.0.7" from the drop-down menu in the "esp32" entry.
  4. Click the "INSTALL" button at the bottom of the entry.
  5. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully installed platform ...

Arduino IDE will occasionally notify you that a new version of the boards platform is available, you'll need to refrain from accepting the offer that will cause an update back to the problematic version of the platform. If you find these notifications annoying, you can disable them via the advanced settings.

I'll provide instructions you can follow to do that:

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
    A menu will appear on the editor toolbar:
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
    You can scroll down through the list of commands to find it or type the name in the field.
    A "Preferences" tab will open in the Arduino IDE main panel.
  3. Type arduino.checkForUpdates in the "Search Settings" field of the "Preferences" tab.
  4. Uncheck the box under the "Arduino: Check For Updates" setting.
  5. Close the Preferences tab by clicking its X icon.

If you disable the automatic update check, make sure to periodically do a manual check for newer versions of Arduino IDE and your installed boards platforms and libraries. You can check for new versions of Arduino IDE by selecting Help > Check for Arduino IDE Updates from the Arduino IDE menus. You can check for new versions of boards platforms and libraries by selecting "Updatable" from the "Type" menu in the Boards Manager and Library Manager views.

@ptillisch ,, thank you , this solved the issue of the crashing , now it is working as before ,,

You are welcome. I'm glad it is working now.

Regards, Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.