ISSUE:
In most of our web server and MQTT projects, we use the following libraries (that are currently deprecated):
- ESPASyncWebServer: https://github.com/me-no-dev/ESPAsyncWebServer
- AsyncTCP: https://github.com/me-no-dev/asynctcp
Using these libraries will result in the following error and constant rebooting of the ESP32:
assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)
SOLUTION:
To fix this issue, you must use the newest fork of those libraries, available on the following links:
- ESPAsyncWebServer: https://github.com/ESP32Async/ESPAsyncWebServer (at least version 3.6.2)
- AsyncTCP: https://github.com/ESP32Async/AsyncTCP (at least version 3.3.2)
Follow these instructions to solve the issue:
- Go to the Arduino Libraries Manager: Sketch > Include Library > Manage Libraries
- UNINSTALL any previous versions of the ESPAsyncWebServer and AsyncTCP libraries
- Now, you can install the latest version of the new fork. Follow the next instructions:
To guarantee that you’re using the latest version of the ESPAsyncWebServer and AsyncTCP libraries, please install them via ZIP folder (don’t use the Library Manager that will currently install an older version with issues).
Click the following links to download the library files.
- Click here to download the ESPAsyncWebServer
- Click here to download the Async TCP library.
In your Arduino IDE, go to Sketch > Include Library > Add .zip Library and select the libraries you’ve just downloaded.
Compile your code again. This will work with the latest version of the ESP32 core.