ESP32 Rebooting Loop with ESPAsyncWebServer

Disclaimer: I am not using an arduino board, but am unsure which category.

I'm using an espressif ESP32-DevKitC-32E and trying to run an ESPAsyncWebServer, but am experiencing a reboot loop. I've tried other code and it seems to only be a problem with ESPAsyncWebServer. I've downloaded the libraries for ESPAsyncWebServer and AsyncTCP today so no outstanding updates, and using esp32 3.1.0 arduino board manager version. Also using 1.8.19 IDE.

When I upload the ESPAsyncWebServer simple_server example code with my wifi credentials, I get no errors but a reboot loop in the serial monitor...

//
// A simple server implementation showing how to:
//  * serve static messages
//  * read GET and POST parameters
//  * handle missing pages / 404s
//

#include <Arduino.h>
#ifdef ESP32
#include <WiFi.h>
#include <AsyncTCP.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#endif
#include <ESPAsyncWebServer.h>

AsyncWebServer server(80);

const char* ssid = "_";
const char* password = "_";

const char* PARAM_MESSAGE = "message";

void notFound(AsyncWebServerRequest *request) {
    request->send(404, "text/plain", "Not found");
}

void setup() {

    Serial.begin(115200);
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);
    if (WiFi.waitForConnectResult() != WL_CONNECTED) {
        Serial.printf("WiFi Failed!\n");
        return;
    }

    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());

    server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
        request->send(200, "text/plain", "Hello, world");
    });

    // Send a GET request to <IP>/get?message=<message>
    server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) {
        String message;
        if (request->hasParam(PARAM_MESSAGE)) {
            message = request->getParam(PARAM_MESSAGE)->value();
        } else {
            message = "No message sent";
        }
        request->send(200, "text/plain", "Hello, GET: " + message);
    });

    // Send a POST request to <IP>/post with a form field message set to <message>
    server.on("/post", HTTP_POST, [](AsyncWebServerRequest *request){
        String message;
        if (request->hasParam(PARAM_MESSAGE, true)) {
            message = request->getParam(PARAM_MESSAGE, true)->value();
        } else {
            message = "No message sent";
        }
        request->send(200, "text/plain", "Hello, POST: " + message);
    });

    server.onNotFound(notFound);

    server.begin();
}

void loop() {
}

Serial Monitor:

Board info:

I can't find the same issue online. Please help, don't know what's wrong

Hi @ard015 . I see a report of this problem of the library causing a "assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)" crash 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 when 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.

@ard015 But wasn't that in conjunction with a wrong URL for the espressif boards? Here is the URL I gave the other user.

(https://espressif.github.io/arduino-esp32/package_esp32_index.json)

When downgrading to 3.0.7 it gives me an error compiling for board ESP32 Dev Module, even for a blank sketch

Arduino: 1.8.19 (Windows 10), Board: "ESP32 Dev Module, Disabled, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None, Disabled, Disabled"





















C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\_\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\_\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\_\OneDrive - Laserglow Technologies\Documents\Arduino\libraries -fqbn=esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none,ZigbeeMode=default -ide-version=10819 -build-path C:\Users\_~1\AppData\Local\Temp\arduino_build_277930 -warnings=none -build-cache C:\Users\_~1\AppData\Local\Temp\arduino_cache_876116 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.riscv32-esp-elf-gdb.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\riscv32-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.riscv32-esp-elf-gdb-12.1_20231023.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\riscv32-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.esp-x32.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-x32\2302 -prefs=runtime.tools.esp-x32-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-x32\2302 -prefs=runtime.tools.esptool_py.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.6 -prefs=runtime.tools.esptool_py-4.6.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.6 -prefs=runtime.tools.esp-rv32.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302 -prefs=runtime.tools.esp-rv32-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302 -prefs=runtime.tools.dfu-util.path=C:\Users\_\AppData\Local\Arduino15\packages\arduino\tools\dfu-util\0.11.0-arduino5 -prefs=runtime.tools.dfu-util-0.11.0-arduino5.path=C:\Users\_\AppData\Local\Arduino15\packages\arduino\tools\dfu-util\0.11.0-arduino5 -prefs=runtime.tools.esp32-arduino-libs.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a -prefs=runtime.tools.esp32-arduino-libs-idf-release_v5.1-632e0c2a.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a -prefs=runtime.tools.openocd-esp32.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\openocd-esp32\v0.12.0-esp32-20240821 -prefs=runtime.tools.openocd-esp32-v0.12.0-esp32-20240821.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\openocd-esp32\v0.12.0-esp32-20240821 -prefs=runtime.tools.esp-xs2.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs2\2302 -prefs=runtime.tools.esp-xs2-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs2\2302 -prefs=runtime.tools.esp-xs3.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs3\2302 -prefs=runtime.tools.esp-xs3-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs3\2302 -prefs=runtime.tools.xtensa-esp-elf-gdb.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.xtensa-esp-elf-gdb-12.1_20231023.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.mklittlefs.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933 -prefs=runtime.tools.mklittlefs-3.0.0-gnu12-dc7f933.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933 -verbose C:\Users\_~1\AppData\Local\Temp\untitled1767409243.tmp\sketch_dec23a\sketch_dec23a.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\_\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\_\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\_\OneDrive - Laserglow Technologies\Documents\Arduino\libraries -fqbn=esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none,ZigbeeMode=default -ide-version=10819 -build-path C:\Users\_~1\AppData\Local\Temp\arduino_build_277930 -warnings=none -build-cache C:\Users\_~1\AppData\Local\Temp\arduino_cache_876116 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.riscv32-esp-elf-gdb.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\riscv32-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.riscv32-esp-elf-gdb-12.1_20231023.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\riscv32-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.esp-x32.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-x32\2302 -prefs=runtime.tools.esp-x32-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-x32\2302 -prefs=runtime.tools.esptool_py.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.6 -prefs=runtime.tools.esptool_py-4.6.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.6 -prefs=runtime.tools.esp-rv32.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302 -prefs=runtime.tools.esp-rv32-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302 -prefs=runtime.tools.dfu-util.path=C:\Users\_\AppData\Local\Arduino15\packages\arduino\tools\dfu-util\0.11.0-arduino5 -prefs=runtime.tools.dfu-util-0.11.0-arduino5.path=C:\Users\_\AppData\Local\Arduino15\packages\arduino\tools\dfu-util\0.11.0-arduino5 -prefs=runtime.tools.esp32-arduino-libs.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a -prefs=runtime.tools.esp32-arduino-libs-idf-release_v5.1-632e0c2a.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a -prefs=runtime.tools.openocd-esp32.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\openocd-esp32\v0.12.0-esp32-20240821 -prefs=runtime.tools.openocd-esp32-v0.12.0-esp32-20240821.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\openocd-esp32\v0.12.0-esp32-20240821 -prefs=runtime.tools.esp-xs2.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs2\2302 -prefs=runtime.tools.esp-xs2-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs2\2302 -prefs=runtime.tools.esp-xs3.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs3\2302 -prefs=runtime.tools.esp-xs3-2302.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp-xs3\2302 -prefs=runtime.tools.xtensa-esp-elf-gdb.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.xtensa-esp-elf-gdb-12.1_20231023.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp-elf-gdb\12.1_20231023 -prefs=runtime.tools.mklittlefs.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933 -prefs=runtime.tools.mklittlefs-3.0.0-gnu12-dc7f933.path=C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\mklittlefs\3.0.0-gnu12-dc7f933 -verbose C:\Users\_~1\AppData\Local\Temp\untitled1767409243.tmp\sketch_dec23a\sketch_dec23a.ino

Using board 'esp32' from platform in folder: C:\Users\_\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7

Using core 'esp32' from platform in folder: C:\Users\_\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7

cmd /c if exist "C:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a\\partitions.csv" COPY /y "C:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a\\partitions.csv" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\partitions.csv"

cmd /c if not exist "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\partitions.csv" if exist "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32\\partitions.csv" COPY "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32\\partitions.csv" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\partitions.csv"

cmd /c if not exist "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\partitions.csv" COPY "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\tools\\partitions\\default.csv" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\partitions.csv"

        1 file(s) copied.

cmd /c IF EXIST "C:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a\\bootloader.bin" ( COPY /y "C:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a\\bootloader.bin" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch_dec23a.ino.bootloader.bin" ) ELSE ( IF EXIST "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32\\bootloader.bin" ( COPY "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32\\bootloader.bin" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch_dec23a.ino.bootloader.bin" ) ELSE ( "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esptool_py\\4.6\\esptool.exe" --chip esp32 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB -o "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch_dec23a.ino.bootloader.bin" "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32\\bin\\bootloader_qio_80m.elf" ) )

esptool.py v4.6

Creating esp32 image...

Merged 1 ELF section

Successfully created esp32 image.

cmd /c if exist "C:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a\\build_opt.h" COPY /y "C:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a\\build_opt.h" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\build_opt.h"

cmd /c if not exist "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\build_opt.h" type nul > "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\build_opt.h"

cmd /c type nul > "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/file_opts"

cmd /c COPY /y "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32\\sdkconfig" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sdkconfig"

        1 file(s) copied.

Detecting libraries used...

"C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2302/bin/xtensa-esp32-elf-g++" -c "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/cpp_flags" -w -Os -Werror=return-type -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10819 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DARDUINO_PARTITION_default "-DARDUINO_HOST_OS=\"windows\"" "-DARDUINO_FQBN=\"esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none,ZigbeeMode=default\"" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_CDC_ON_BOOT=0 "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/defines" "-IC:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a" -iprefix "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/include/" "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/includes" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/qio_qspi/include" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\cores\\esp32" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32" "@C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/build_opt.h" "@C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/file_opts" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch\\sketch_dec23a.ino.cpp" -o nul

Generating function prototypes...

"C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2302/bin/xtensa-esp32-elf-g++" -c "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/cpp_flags" -w -Os -Werror=return-type -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10819 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DARDUINO_PARTITION_default "-DARDUINO_HOST_OS=\"windows\"" "-DARDUINO_FQBN=\"esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none,ZigbeeMode=default\"" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_CDC_ON_BOOT=0 "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/defines" "-IC:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a" -iprefix "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/include/" "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/includes" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/qio_qspi/include" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\cores\\esp32" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32" "@C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/build_opt.h" "@C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/file_opts" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch\\sketch_dec23a.ino.cpp" -o "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\preproc\\ctags_target_for_gcc_minus_e.cpp"

"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2302/bin/xtensa-esp32-elf-g++" -MMD -c "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/cpp_flags" -w -Os -Werror=return-type -DF_CPU=240000000L -DARDUINO=10819 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DARDUINO_PARTITION_default "-DARDUINO_HOST_OS=\"windows\"" "-DARDUINO_FQBN=\"esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none,ZigbeeMode=default\"" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_CDC_ON_BOOT=0 "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/defines" "-IC:\\Users\\_~1\\AppData\\Local\\Temp\\untitled1767409243.tmp\\sketch_dec23a" -iprefix "C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/include/" "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/includes" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/qio_qspi/include" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\cores\\esp32" "-IC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.0.7\\variants\\esp32" "@C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/build_opt.h" "@C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/file_opts" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch\\sketch_dec23a.ino.cpp" -o "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch\\sketch_dec23a.ino.cpp.o"

Compiling libraries...

Compiling core...

cmd /c echo -DARDUINO_CORE_BUILD > "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/file_opts"

Using precompiled core: C:\Users\_~1\AppData\Local\Temp\arduino_cache_876116\core\core_a72857c3fe57ad3150f2ee20b2d8c7d8.a

cmd /c type nul > "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/file_opts"

Linking everything together...

"C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2302/bin/xtensa-esp32-elf-g++" "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/ld_flags" "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/ld_scripts" "-Wl,--Map=C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/sketch_dec23a.ino.map" "-LC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/lib" "-LC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/ld" "-LC:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/qio_qspi" -Wl,--wrap=esp_panic_handler -Wl,--start-group "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930\\sketch\\sketch_dec23a.ino.cpp.o" "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_cache_876116\\core\\core_a72857c3fe57ad3150f2ee20b2d8c7d8.a" "@C:\\Users\\_\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-632e0c2a\\esp32/flags/ld_libs" -Wl,--end-group -Wl,-EL -o "C:\\Users\\_~1\\AppData\\Local\\Temp\\arduino_build_277930/sketch_dec23a.ino.elf"

c:/users/_/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32/lib\libfreertos.a(app_startup.c.obj):(.literal.main_task+0x14): undefined reference to `app_main'

c:/users/_/appdata/local/arduino15/packages/esp32/tools/esp-x32/2302/bin/../lib/gcc/xtensa-esp32-elf/12.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\_\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-632e0c2a\esp32/lib\libfreertos.a(app_startup.c.obj): in function `main_task':

/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/app_startup.c:199: undefined reference to `app_main'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board ESP32 Dev Module.

Update: I've downloaded the Arduino 2.3.4 IDE and using the ESP32 3.0.7 version it works. I originally was using the 1.8.19 IDE to upload flash storage onto the ESP but can figure out a work around.

Thanks for all that tried to help!

You are welcome. I'm glad it is working now. Thanks for taking the time to post an update!

Regards, Per

Hello! I, too, had a problem with my ESP32 Wroom program causing a reboot loop and google led me here. I can confirm that the problem crept in between versions 3.1.0-RC1 and 3.1.0-RC2 of the Espressif boards library, at least for my application.

I am having the same issue now..

Im curious what work around did you find to flash? do you have both versions of the arduino ide installed ["2.3.4", "1.8.19"]? you use the 1.8.19 to flash and then you switch to 2.3.4 to upload?

FYI, please read:

If you use the right dependencies this is fixed since a while already.

Yes, this is exactly what I do. I keep a separate sketch with the files in that data folder open on 1.8.19 to flash and the sketch I am working on and uploading open on 2.3.4.

I believe there is another way that involves programming something, but this works for me.

Darn shame an update can cause so much trouble. Downgraded to 3.1.1 as suggested and the problem (assert failed: tcp_alloc /idf/components/lwip/lwip/src/core/tcp.c:1851 (required to lock tcpip core functionality!) went away. I flashed my last board last week with no issues, but then I hit that update button to get rid of the nag, and had not programmed anything since, until today. Was led here to try to find the issue, just to find out that the update which is supposed to make things better, made things worse. Thank you for posting the temporary fix, I might make this temporary fix permanent...

Looks like Arduino IDE Library is using old libraries by "me-no-dev" and new ones are moved to "ESP32Async".

After i remove libraries installed via Arduino IDE, and install new ones manually i was able to run it without issues.

You have to install both AsyncTCP & ESPAsyncWebServer manually. You will also notice versions are bigger.

Hi @trkich. Thanks for sharing your findings.

That isn't necessary. You can install both of these libraries via the Arduino Library Manager.

You do need to make sure to install the correct libraries as there are several different libraries in Library Manager with similar names. The library names are:

Note that there are spaces in the names.

There is a library named "ESPAsyncWebServer" in Library Manager. That is a different community fork of the library that has not been maintained by the community member and thus is outdated. I guess you installed "ESPAsyncWebServer" instead of "ESP Async WebServer".

Yes, you are right, just tried :slight_smile:

I'm new to Arduino, and I was probably confused because both of these libraries have the same header file, "ESPAsyncWebServer.h".

If you copy code from the examples or github as i did, it's natural to look for the library name based on the header file, and the first one will be the wrong one that didn't work for me and that gave me the error mentioned in this post.

It might be worth deprecating or removing the one that doesn't work.

Replace ESPAsyncWebServer with ESP Async WebServer and AsyncTCP with Async TCP, seems to work

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