Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/scripts/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

#!/bin/bash
# shellcheck disable=SC2002

# fail the script if any command unexpectedly fails
set -e

if [ ! $# -eq 3 ]; then
echo "Bad number of arguments: $#" >&2
echo "usage: $0 <major> <minor> <patch>" >&2
exit 1
fi

re='^[0-9]+$'
if [[ ! $1 =~ $re ]] || [[ ! $2 =~ $re ]] || [[ ! $3 =~ $re ]] ; then
echo "error: Not a valid version: $1.$2.$3" >&2
echo "usage: $0 <major> <minor> <patch>" >&2
exit 1
fi

ASYNCWEBSERVER_VERSION_MAJOR="$1"
ASYNCWEBSERVER_VERSION_MINOR="$2"
ASYNCWEBSERVER_VERSION_PATCH="$3"
ASYNCWEBSERVER_VERSION="$ASYNCWEBSERVER_VERSION_MAJOR.$ASYNCWEBSERVER_VERSION_MINOR.$ASYNCWEBSERVER_VERSION_PATCH"

echo "New AsyncTCP version: $ASYNCWEBSERVER_VERSION"

echo "Updating library.properties..."
cat library.properties | sed "s/version=.*/version=$ASYNCWEBSERVER_VERSION/g" > __library.properties && mv __library.properties library.properties

echo "Updating library.json..."
cat library.json | sed "s/^ \"version\":.*/ \"version\": \"$ASYNCWEBSERVER_VERSION\",/g" > __library.json && mv __library.json library.json

echo "Updating src/AsyncWebServerVersion.h..."
cat src/AsyncWebServerVersion.h | \
sed "s/#define ASYNCWEBSERVER_VERSION_MAJOR.*/#define ASYNCWEBSERVER_VERSION_MAJOR $ASYNCWEBSERVER_VERSION_MAJOR/g" | \
sed "s/#define ASYNCWEBSERVER_VERSION_MINOR.*/#define ASYNCWEBSERVER_VERSION_MINOR $ASYNCWEBSERVER_VERSION_MINOR/g" | \
sed "s/#define ASYNCWEBSERVER_VERSION_PATCH.*/#define ASYNCWEBSERVER_VERSION_PATCH $ASYNCWEBSERVER_VERSION_PATCH/g" > src/__AsyncWebServerVersion.h && mv src/__AsyncWebServerVersion.h src/AsyncWebServerVersion.h

exit 0
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Discord Server: [https://discord.gg/X7zpGdyUcY](https://discord.gg/X7zpGdyUcY)

Please see the new links:

- `ESP32Async/ESPAsyncWebServer @ 3.6.2` (ESP32, ESP8266, RP2040)
- `ESP32Async/AsyncTCP @ 3.3.2` (ESP32)
- `ESP32Async/ESPAsyncTCP @ 2.0.0` (ESP8266)
- `ESP32Async/ESPAsyncWebServer` (ESP32, ESP8266, RP2040)
- `ESP32Async/AsyncTCP` (ESP32)
- `ESP32Async/ESPAsyncTCP` (ESP8266)
- `https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip` (AsyncTCP alternative for ESP32)
- `khoih-prog/AsyncTCP_RP2040W @ 1.2.0` (RP2040)
- `khoih-prog/AsyncTCP_RP2040W` (RP2040)

Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040
Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc.
Expand Down Expand Up @@ -95,21 +95,15 @@ If you are an ESP8266 user and want to help improve current 3.x, you are more th
```ini
lib_compat_mode = strict
lib_ldf_mode = chain
lib_deps = ESP32Async/ESPAsyncWebServer @ 3.6.2
lib_deps = ESP32Async/ESPAsyncWebServer
```

**Dependencies:**

- **ESP32 with AsyncTCP**: `ESP32Async/AsyncTCP @ 3.3.2`
Arduino IDE: [https://github.com/ESP32Async/AsyncTCP#v3.3.2](https://github.com/ESP32Async/AsyncTCP/releases)

- **ESP32 with AsyncTCP**: [`ESP32Async/AsyncTCP`](https://github.com/ESP32Async/AsyncTCP/releases)
- **ESP32 with AsyncTCPSock**: `https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip`

- **ESP8266**: `ESP32Async/ESPAsyncTCP @ 2.0.0`
Arduino IDE: [https://github.com/ESP32Async/ESPAsyncTCP#v2.0.0](https://github.com/ESP32Async/ESPAsyncTCP/releases/tag/v2.0.0)

- **RP2040**: `khoih-prog/AsyncTCP_RP2040W @ 1.2.0`
Arduino IDE: [https://github.com/khoih-prog/AsyncTCP_RP2040W#v1.2.0](https://github.com/khoih-prog/AsyncTCP_RP2040W/releases/tag/v1.2.0)
- **ESP8266**: [`ESP32Async/ESPAsyncTCP`](https://github.com/ESP32Async/ESPAsyncTCP/releases)
- **RP2040**: [`khoih-prog/AsyncTCP_RP2040W`](https://github.com/khoih-prog/AsyncTCP_RP2040W/releases)

**AsyncTCPSock**

Expand All @@ -119,17 +113,16 @@ AsyncTCPSock can be used instead of AsyncTCP by excluding AsyncTCP from the libr
lib_compat_mode = strict
lib_ldf_mode = chain
lib_deps =
; ESP32Async/AsyncTCP @ 3.3.2
https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip
ESP32Async/ESPAsyncWebServer @ 3.6.2
ESP32Async/ESPAsyncWebServer
lib_ignore =
AsyncTCP
ESP32Async/AsyncTCP
```

## Performance

Performance of `ESP32Async/ESPAsyncWebServer @ 3.6.2`:
Performance of `ESP32Async/ESPAsyncWebServer`:

```bash
> brew install autocannon
Expand Down Expand Up @@ -193,7 +186,7 @@ Read #165 thread, it might give you some hints.
`CONFIG_ASYNC_TCP_RUNNING_CORE` - CPU core thread affinity that runs the queue events handling and executes server callbacks. Default is ANY core, so it means that for dualcore SoCs both cores could handle server activities. If your server's code is too heavy and unoptimized or you see that sometimes
server might affect other network activities, you might consider to bind it to the same core that runs Arduino code (1) to minimize affect on radio part. Otherwise you can leave the default to let RTOS decide where to run the thread based on priority

`CONFIG_ASYNC_TCP_STACK_SIZE` - stack size for the thread that runs sever events and callbacks. Default is 16k that is a way too much waste for well-defined short async code or simple static file handling. You might want to cosider reducing it to 4-8k to same RAM usage. If you do not know what this is or not sure about your callback code demands - leave it as default, should be enough even for very hungry callbacks in most cases.
`CONFIG_ASYNC_TCP_STACK_SIZE` - stack size for the thread that runs sever events and callbacks. Default is 16k that is a way too much waste for well-defined short async code or simple static file handling. You might want to cosider reducing it to 4-8k to same RAM usage. If you do not know what this is or not sure about your callback code demands - leave it as default, should be enough even for very hungry callbacks in most cases.

> [!NOTE]
> This relates to ESP32 only, ESP8266 uses different ESPAsyncTCP lib that does not has this build options
Expand Down Expand Up @@ -336,7 +329,9 @@ myHandler.addMiddleware(&authMiddleware); // add authentication to a specific ha
These callbacks are also not triggering the whole middleware chain since they are not part of the request processing workflow (they are not the final handler).

## Original Documentation

<!-- no toc -->

- [Why should you care](#why-should-you-care)
- [Important things to remember](#important-things-to-remember)
- [Principles of operation](#principles-of-operation)
Expand Down