forked from me-no-dev/AsyncTCP
76e49649e641ca372561ebe4c4ff344e96fd4792
AsyncTCP
A fork of the AsyncTCP library by @me-no-dev for ESPHome.
Async TCP Library for ESP32 Arduino
This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP32 MCUs.
This library is the base for ESPAsyncWebServer
AsyncClient and AsyncServer
The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.
Changes in this fork
- All improvements from ESPHome fork
- Reverted back
library.propertiesfor Arduino IDE users - Arduino 3 / ESP-IDF 5 compatibility
- Point to
mathieucarbou/AsyncTCP @ ^3.2.1 - IPv6 support
Important recommendations
Most of the crashes are caused by improper configuration of the library for the project. Here are some recommendations to avoid them.
- Set the running core to be on the same core of your application (usually core 1)
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1 - Set the stack size appropriately with
-D CONFIG_ASYNC_TCP_STACK_SIZE=16384. The default value of16384might be too much for your project. You can look at the MycilaTaskMonitor project to monitor the stack usage. - You can change if you know what you are doing the task priority with
-D CONFIG_ASYNC_TCP_PRIORITY=10. Default is10. - You can increase the queue size with
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=128. Default is64. - You can decrease the maximum ack time
-D CONFIG_ASYNC_TCP_MAX_ACK_TIME=3000. Default is5000.
I personally use the following configuration in my projects:
-D CONFIG_ASYNC_TCP_MAX_ACK_TIME=3000
-D CONFIG_ASYNC_TCP_PRIORITY=10
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=128
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096
Description
Languages
C++
99.6%
CMake
0.2%
Makefile
0.2%