| 2 |
raymond |
1 |

|
|
|
2 |
|
|
|
3 |
# AsyncTCP
|
|
|
4 |
|
|
|
5 |
[](https://opensource.org/license/lgpl-3-0/)
|
|
|
6 |
[](https://github.com/ESP32Async/AsyncTCP/actions/workflows/ci.yml)
|
|
|
7 |
[](https://registry.platformio.org/libraries/ESP32Async/AsyncTCP)
|
|
|
8 |
|
|
|
9 |
Discord Server: [https://discord.gg/X7zpGdyUcY](https://discord.gg/X7zpGdyUcY)
|
|
|
10 |
|
|
|
11 |
## Async TCP Library for ESP32 Arduino
|
|
|
12 |
|
|
|
13 |
This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP32 MCUs.
|
|
|
14 |
|
|
|
15 |
This library is the base for [ESPAsyncWebServer](https://github.com/ESP32Async/ESPAsyncWebServer)
|
|
|
16 |
|
|
|
17 |
## How to install
|
|
|
18 |
|
|
|
19 |
The library can be downloaded from the releases page at [https://github.com/ESP32Async/AsyncTCP/releases](https://github.com/ESP32Async/AsyncTCP/releases).
|
|
|
20 |
|
|
|
21 |
It is also deployed in these registries:
|
|
|
22 |
|
|
|
23 |
- Arduino Library Registry: [https://github.com/arduino/library-registry](https://github.com/arduino/library-registry)
|
|
|
24 |
|
|
|
25 |
- ESP Component Registry [https://components.espressif.com/components/esp32async/asynctcp/](https://components.espressif.com/components/esp32async/asynctcp/)
|
|
|
26 |
|
|
|
27 |
- PlatformIO Registry: [https://registry.platformio.org/libraries/esp32async/AsyncTCP](https://registry.platformio.org/libraries/esp32async/AsyncTCP)
|
|
|
28 |
|
|
|
29 |
- Use: `lib_deps=ESP32Async/AsyncTCP` to point to latest version
|
|
|
30 |
- Use: `lib_deps=ESP32Async/AsyncTCP @ ^<x.y.z>` to point to latest version with the same major version
|
|
|
31 |
- Use: `lib_deps=ESP32Async/AsyncTCP @ <x.y.z>` to always point to the same version (reproductible build)
|
|
|
32 |
|
|
|
33 |
## AsyncClient and AsyncServer
|
|
|
34 |
|
|
|
35 |
The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.
|
|
|
36 |
|
|
|
37 |
## Important recommendations
|
|
|
38 |
|
|
|
39 |
Most of the crashes are caused by improper configuration of the library for the project.
|
|
|
40 |
Here are some recommendations to avoid them.
|
|
|
41 |
|
|
|
42 |
I personally use the following configuration in my projects:
|
|
|
43 |
|
|
|
44 |
```c++
|
|
|
45 |
-D CONFIG_ASYNC_TCP_MAX_ACK_TIME=5000 // (keep default)
|
|
|
46 |
-D CONFIG_ASYNC_TCP_PRIORITY=10 // (keep default)
|
|
|
47 |
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=64 // (keep default)
|
|
|
48 |
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1 // force async_tcp task to be on same core as the app (default is core 0)
|
|
|
49 |
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096 // reduce the stack size (default is 16K)
|
|
|
50 |
```
|
|
|
51 |
|
|
|
52 |
## Compatibility
|
|
|
53 |
|
|
|
54 |
- ESP32
|
|
|
55 |
- Arduino Core 2.x and 3.x
|