diff --git a/.github/workflows/build-libretiny.yml b/.github/workflows/build-libretiny.yml new file mode 100644 index 00000000..5e09bacb --- /dev/null +++ b/.github/workflows/build-libretiny.yml @@ -0,0 +1,57 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + +name: Build (LibreTiny) + +on: + workflow_dispatch: + push: + branches: + - main + - release/* + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + platformio-libretiny: + name: LibreTiny (pio) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + board: + - generic-bk7231n-qfn32-tuya + - generic-rtl8710bn-2mb-788k + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache PlatformIO + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-pio + path: | + ~/.cache/pip + ~/.platformio + + - name: Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install PIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + + - name: Build Examples + run: | + for i in AsyncResponseStream Auth Headers; do + echo "=============================================================" + echo "Building examples/$i..." + echo "=============================================================" + PLATFORMIO_SRC_DIR=examples/$i PIO_BOARD=${{ matrix.board }} pio run -e ci-libretiny + done diff --git a/README.md b/README.md index 9bb75753..1db7aee6 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,19 @@ lib_deps = ESP32Async/ESPAsyncWebServer ``` +### LibreTiny (BK7231N/T, RTL8710B, etc.) + +Version 1.9.1 or newer is required. + +```ini +[env:stable] +platform = libretiny @ ^1.9.1 +lib_ldf_mode = chain +lib_deps = + ESP32Async/AsyncTCP + ESP32Async/ESPAsyncWebServer +``` + ### Unofficial dependencies **AsyncTCPSock** diff --git a/examples/AsyncResponseStream/AsyncResponseStream.ino b/examples/AsyncResponseStream/AsyncResponseStream.ino index 80c5d1c9..451bb1a1 100644 --- a/examples/AsyncResponseStream/AsyncResponseStream.ino +++ b/examples/AsyncResponseStream/AsyncResponseStream.ino @@ -2,7 +2,7 @@ // Copyright 2016-2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -20,7 +20,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/AsyncTunnel/AsyncTunnel.ino b/examples/AsyncTunnel/AsyncTunnel.ino index 9910cd45..b63c056a 100644 --- a/examples/AsyncTunnel/AsyncTunnel.ino +++ b/examples/AsyncTunnel/AsyncTunnel.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -70,7 +70,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.begin(WIFI_SSID, WIFI_PASSWORD); while (WiFi.status() != WL_CONNECTED) { delay(500); diff --git a/examples/Auth/Auth.ino b/examples/Auth/Auth.ino index 0ecb7346..8f5b535b 100644 --- a/examples/Auth/Auth.ino +++ b/examples/Auth/Auth.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -52,7 +52,7 @@ static AsyncAuthorizationMiddleware authz([](AsyncWebServerRequest *request) { void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/CORS/CORS.ino b/examples/CORS/CORS.ino index af99e32f..647d5557 100644 --- a/examples/CORS/CORS.ino +++ b/examples/CORS/CORS.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -25,7 +25,7 @@ static AsyncCorsMiddleware cors; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/CaptivePortal/CaptivePortal.ino b/examples/CaptivePortal/CaptivePortal.ino index 1afb5211..0b8c317e 100644 --- a/examples/CaptivePortal/CaptivePortal.ino +++ b/examples/CaptivePortal/CaptivePortal.ino @@ -2,7 +2,7 @@ // Copyright 2016-2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -28,7 +28,7 @@ public: response->print("Captive Portal"); response->print("

This is our captive portal front page.

"); response->printf("

You were trying to reach: http://%s%s

", request->host().c_str(), request->url().c_str()); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI response->printf("

Try opening this link instead

", WiFi.softAPIP().toString().c_str()); #endif response->print(""); @@ -41,7 +41,7 @@ void setup() { Serial.println(); Serial.println("Configuring access point..."); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI if (!WiFi.softAP("esp-captive")) { Serial.println("Soft AP creation failed."); while (1); diff --git a/examples/CatchAllHandler/CatchAllHandler.ino b/examples/CatchAllHandler/CatchAllHandler.ino index ed16e9c6..fb014103 100644 --- a/examples/CatchAllHandler/CatchAllHandler.ino +++ b/examples/CatchAllHandler/CatchAllHandler.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ChunkResponse/ChunkResponse.ino b/examples/ChunkResponse/ChunkResponse.ino index 98e0b198..52c31c0c 100644 --- a/examples/ChunkResponse/ChunkResponse.ino +++ b/examples/ChunkResponse/ChunkResponse.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ChunkRetryResponse/ChunkRetryResponse.ino b/examples/ChunkRetryResponse/ChunkRetryResponse.ino index 55c6ccf1..4e67edb3 100644 --- a/examples/ChunkRetryResponse/ChunkRetryResponse.ino +++ b/examples/ChunkRetryResponse/ChunkRetryResponse.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -96,7 +96,7 @@ static int key = -1; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/EndBegin/EndBegin.ino b/examples/EndBegin/EndBegin.ino index 20365c4b..8e91fcf4 100644 --- a/examples/EndBegin/EndBegin.ino +++ b/examples/EndBegin/EndBegin.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Filters/Filters.ino b/examples/Filters/Filters.ino index df7a08f5..bcdb5b3c 100644 --- a/examples/Filters/Filters.ino +++ b/examples/Filters/Filters.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -32,7 +32,7 @@ public: response->print("Captive Portal"); response->print("

This is out captive portal front page.

"); response->printf("

You were trying to reach: http://%s%s

", request->host().c_str(), request->url().c_str()); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI response->printf("

Try opening this link instead

", WiFi.softAPIP().toString().c_str()); #endif response->print(""); @@ -51,17 +51,17 @@ void setup() { "/", HTTP_GET, [](AsyncWebServerRequest *request) { Serial.println("Captive portal request..."); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI Serial.println("WiFi.localIP(): " + WiFi.localIP().toString()); #endif Serial.println("request->client()->localIP(): " + request->client()->localIP().toString()); #if ESP_IDF_VERSION_MAJOR >= 5 -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI Serial.println("WiFi.type(): " + String((int)WiFi.localIP().type())); #endif Serial.println("request->client()->type(): " + String((int)request->client()->localIP().type())); #endif -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI Serial.println(WiFi.localIP() == request->client()->localIP() ? "should be: ON_STA_FILTER" : "should be: ON_AP_FILTER"); Serial.println(WiFi.localIP() == request->client()->localIP()); Serial.println(WiFi.localIP().toString() == request->client()->localIP().toString()); @@ -77,17 +77,17 @@ void setup() { "/", HTTP_GET, [](AsyncWebServerRequest *request) { Serial.println("Website request..."); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI Serial.println("WiFi.localIP(): " + WiFi.localIP().toString()); #endif Serial.println("request->client()->localIP(): " + request->client()->localIP().toString()); #if ESP_IDF_VERSION_MAJOR >= 5 -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI Serial.println("WiFi.type(): " + String((int)WiFi.localIP().type())); #endif Serial.println("request->client()->type(): " + String((int)request->client()->localIP().type())); #endif -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI Serial.println(WiFi.localIP() == request->client()->localIP() ? "should be: ON_STA_FILTER" : "should be: ON_AP_FILTER"); Serial.println(WiFi.localIP() == request->client()->localIP()); Serial.println(WiFi.localIP().toString() == request->client()->localIP().toString()); @@ -113,7 +113,7 @@ void setup() { // dnsServer.stop(); // WiFi.softAPdisconnect(); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.persistent(false); WiFi.begin("IoT"); while (WiFi.status() != WL_CONNECTED) { diff --git a/examples/FlashResponse/FlashResponse.ino b/examples/FlashResponse/FlashResponse.ino index e3090db8..5763f228 100644 --- a/examples/FlashResponse/FlashResponse.ino +++ b/examples/FlashResponse/FlashResponse.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/HeaderManipulation/HeaderManipulation.ino b/examples/HeaderManipulation/HeaderManipulation.ino index 8de67555..cc1c1c1f 100644 --- a/examples/HeaderManipulation/HeaderManipulation.ino +++ b/examples/HeaderManipulation/HeaderManipulation.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -33,7 +33,7 @@ AsyncHeaderFreeMiddleware headerFree; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Headers/Headers.ino b/examples/Headers/Headers.ino index 355cb728..eee87ac1 100644 --- a/examples/Headers/Headers.ino +++ b/examples/Headers/Headers.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Json/Json.ino b/examples/Json/Json.ino index d947d393..a29fec1b 100644 --- a/examples/Json/Json.ino +++ b/examples/Json/Json.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -34,7 +34,7 @@ static AsyncCallbackJsonWebHandler *handler = new AsyncCallbackJsonWebHandler("/ void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Logging/Logging.ino b/examples/Logging/Logging.ino index 3401559f..ae504b22 100644 --- a/examples/Logging/Logging.ino +++ b/examples/Logging/Logging.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -25,7 +25,7 @@ static AsyncLoggingMiddleware requestLogger; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/MessagePack/MessagePack.ino b/examples/MessagePack/MessagePack.ino index c5f44090..e038d03c 100644 --- a/examples/MessagePack/MessagePack.ino +++ b/examples/MessagePack/MessagePack.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -34,7 +34,7 @@ static AsyncCallbackMessagePackWebHandler *handler = new AsyncCallbackMessagePac void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Middleware/Middleware.ino b/examples/Middleware/Middleware.ino index 18d096ca..992a0a26 100644 --- a/examples/Middleware/Middleware.ino +++ b/examples/Middleware/Middleware.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -34,7 +34,7 @@ public: void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Params/Params.ino b/examples/Params/Params.ino index ddd4f738..416218c1 100644 --- a/examples/Params/Params.ino +++ b/examples/Params/Params.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -74,7 +74,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/PartitionDownloader/PartitionDownloader.ino b/examples/PartitionDownloader/PartitionDownloader.ino index 6484f842..1174640d 100644 --- a/examples/PartitionDownloader/PartitionDownloader.ino +++ b/examples/PartitionDownloader/PartitionDownloader.ino @@ -7,7 +7,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -34,7 +34,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/PerfTests/PerfTests.ino b/examples/PerfTests/PerfTests.ino index 6836b4b4..001512cd 100644 --- a/examples/PerfTests/PerfTests.ino +++ b/examples/PerfTests/PerfTests.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -91,7 +91,7 @@ static volatile size_t requests = 0; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/RateLimit/RateLimit.ino b/examples/RateLimit/RateLimit.ino index 6f69871c..5ae93e78 100644 --- a/examples/RateLimit/RateLimit.ino +++ b/examples/RateLimit/RateLimit.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -25,7 +25,7 @@ static AsyncRateLimitMiddleware rateLimit; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Redirect/Redirect.ino b/examples/Redirect/Redirect.ino index df594a40..8f105573 100644 --- a/examples/Redirect/Redirect.ino +++ b/examples/Redirect/Redirect.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/RequestContinuation/RequestContinuation.ino b/examples/RequestContinuation/RequestContinuation.ino index 015d7468..f59322e5 100644 --- a/examples/RequestContinuation/RequestContinuation.ino +++ b/examples/RequestContinuation/RequestContinuation.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -34,7 +34,7 @@ static AsyncWebServerRequestPtr gpioRequest; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/RequestContinuationComplete/RequestContinuationComplete.ino b/examples/RequestContinuationComplete/RequestContinuationComplete.ino index bf9d1398..cb4a53fa 100644 --- a/examples/RequestContinuationComplete/RequestContinuationComplete.ino +++ b/examples/RequestContinuationComplete/RequestContinuationComplete.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -94,7 +94,7 @@ static bool processLongRunningOperation(LongRunningOperation *op) { void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ResumableDownload/ResumableDownload.ino b/examples/ResumableDownload/ResumableDownload.ino index d87c816e..68646e72 100644 --- a/examples/ResumableDownload/ResumableDownload.ino +++ b/examples/ResumableDownload/ResumableDownload.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Rewrite/Rewrite.ino b/examples/Rewrite/Rewrite.ino index 721f650d..8dfeedc6 100644 --- a/examples/Rewrite/Rewrite.ino +++ b/examples/Rewrite/Rewrite.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -24,7 +24,7 @@ static AsyncWebServer server(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ServerSentEvents/ServerSentEvents.ino b/examples/ServerSentEvents/ServerSentEvents.ino index 4c608102..5567ec6d 100644 --- a/examples/ServerSentEvents/ServerSentEvents.ino +++ b/examples/ServerSentEvents/ServerSentEvents.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -58,7 +58,7 @@ static AsyncEventSource events("/events"); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino b/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino index dfa0bc87..cced7151 100644 --- a/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino +++ b/examples/ServerSentEvents_PR156/ServerSentEvents_PR156.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -64,7 +64,7 @@ static constexpr uint32_t timeoutClose = 15000; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/ServerState/ServerState.ino b/examples/ServerState/ServerState.ino index 7d58ff3d..4ceddbcb 100644 --- a/examples/ServerState/ServerState.ino +++ b/examples/ServerState/ServerState.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -25,7 +25,7 @@ static AsyncWebServer server2(80); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/SkipServerMiddleware/SkipServerMiddleware.ino b/examples/SkipServerMiddleware/SkipServerMiddleware.ino index 5d67d1e2..0e7f172b 100644 --- a/examples/SkipServerMiddleware/SkipServerMiddleware.ino +++ b/examples/SkipServerMiddleware/SkipServerMiddleware.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -27,7 +27,7 @@ static AsyncLoggingMiddleware logging; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/SlowChunkResponse/SlowChunkResponse.ino b/examples/SlowChunkResponse/SlowChunkResponse.ino index 266e07ce..7844ad6e 100644 --- a/examples/SlowChunkResponse/SlowChunkResponse.ino +++ b/examples/SlowChunkResponse/SlowChunkResponse.ino @@ -7,7 +7,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -89,7 +89,7 @@ static size_t charactersIndex = 0; void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/StaticFile/StaticFile.ino b/examples/StaticFile/StaticFile.ino index 2189a147..3074aed5 100644 --- a/examples/StaticFile/StaticFile.ino +++ b/examples/StaticFile/StaticFile.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -87,7 +87,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Templates/Templates.ino b/examples/Templates/Templates.ino index e4c21e0a..fdf4eb6f 100644 --- a/examples/Templates/Templates.ino +++ b/examples/Templates/Templates.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -36,7 +36,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/Upload/Upload.ino b/examples/Upload/Upload.ino index 811b8f87..fd80bd72 100644 --- a/examples/Upload/Upload.ino +++ b/examples/Upload/Upload.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -31,7 +31,7 @@ void setup() { LittleFS.begin(); } -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/WebSocket/WebSocket.ino b/examples/WebSocket/WebSocket.ino index fa31bf83..c8d37279 100644 --- a/examples/WebSocket/WebSocket.ino +++ b/examples/WebSocket/WebSocket.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -25,7 +25,7 @@ static AsyncWebSocket ws("/ws"); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/examples/WebSocketEasy/WebSocketEasy.ino b/examples/WebSocketEasy/WebSocketEasy.ino index f37a40b5..5229910c 100644 --- a/examples/WebSocketEasy/WebSocketEasy.ino +++ b/examples/WebSocketEasy/WebSocketEasy.ino @@ -6,7 +6,7 @@ // #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #elif defined(ESP8266) @@ -71,7 +71,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/idf_component_examples/catchall/main/main.cpp b/idf_component_examples/catchall/main/main.cpp index 4d54f120..0ba61ecd 100644 --- a/idf_component_examples/catchall/main/main.cpp +++ b/idf_component_examples/catchall/main/main.cpp @@ -78,7 +78,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/idf_component_examples/serversentevents/main/main.cpp b/idf_component_examples/serversentevents/main/main.cpp index 68d28674..b877f54a 100644 --- a/idf_component_examples/serversentevents/main/main.cpp +++ b/idf_component_examples/serversentevents/main/main.cpp @@ -50,7 +50,7 @@ static AsyncEventSource events("/events"); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/idf_component_examples/websocket/main/main.cpp b/idf_component_examples/websocket/main/main.cpp index 940f27bc..9d4e46aa 100644 --- a/idf_component_examples/websocket/main/main.cpp +++ b/idf_component_examples/websocket/main/main.cpp @@ -17,7 +17,7 @@ static AsyncWebSocket ws("/ws"); void setup() { Serial.begin(115200); -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI WiFi.mode(WIFI_AP); WiFi.softAP("esp-captive"); #endif diff --git a/library.json b/library.json index 233e912f..2b8d17f2 100644 --- a/library.json +++ b/library.json @@ -18,14 +18,18 @@ "platforms": [ "espressif32", "espressif8266", - "raspberrypi" + "raspberrypi", + "libretiny" ], "dependencies": [ { "owner": "ESP32Async", "name": "AsyncTCP", "version": "^3.4.4", - "platforms": "espressif32" + "platforms": [ + "espressif32", + "libretiny" + ] }, { "owner": "ESP32Async", diff --git a/platformio.ini b/platformio.ini index 4aff69c9..ee66331f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -111,6 +111,17 @@ lib_ignore = build_flags = ${env.build_flags} -Wno-missing-field-initializers +[env:libretiny] +platform = libretiny @ ^1.9.1 +board = generic-bk7231n-qfn32-tuya +; board = generic-rtl8710bn-2mb-788k +lib_compat_mode = off +lib_deps = + ESP32Async/AsyncTCP @ 3.4.3 +; use FreeRTOS v9.0.0 for RTL8710BN +; (BK7231 already uses it) +custom_versions.freertos = 9.0.0 + ; CI [env:ci-arduino-2] @@ -156,3 +167,13 @@ lib_ignore = lwIP_ESPHost build_flags = ${env.build_flags} -Wno-missing-field-initializers + +[env:ci-libretiny] +platform = libretiny @ ^1.9.1 +board = ${sysenv.PIO_BOARD} +lib_compat_mode = off +lib_deps = +; add DNS server library for LibreTiny + DNSServer + ESP32Async/AsyncTCP @ 3.4.3 +custom_versions.freertos = 9.0.0 diff --git a/src/AsyncEventSource.h b/src/AsyncEventSource.h index 96f0a899..49f65e85 100644 --- a/src/AsyncEventSource.h +++ b/src/AsyncEventSource.h @@ -6,7 +6,7 @@ #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #include #ifndef SSE_MAX_QUEUED_MESSAGES diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp index f86d6167..bc093b96 100644 --- a/src/AsyncWebSocket.cpp +++ b/src/AsyncWebSocket.cpp @@ -17,6 +17,8 @@ #include #elif defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) || defined(ESP8266) #include +#elif defined(LIBRETINY) +#include #endif using namespace asyncsrv; @@ -1327,11 +1329,20 @@ AsyncWebSocketResponse::AsyncWebSocketResponse(const String &key, AsyncWebSocket } k.concat(key); k.concat(WS_STR_UUID); +#ifdef LIBRETINY + mbedtls_sha1_context ctx; + mbedtls_sha1_init(&ctx); + mbedtls_sha1_starts(&ctx); + mbedtls_sha1_update(&ctx, (const uint8_t *)k.c_str(), k.length()); + mbedtls_sha1_finish(&ctx, hash); + mbedtls_sha1_free(&ctx); +#else SHA1Builder sha1; sha1.begin(); sha1.add((const uint8_t *)k.c_str(), k.length()); sha1.calculate(); sha1.getBytes(hash); +#endif #endif base64_encodestate _state; base64_init_encodestate(&_state); diff --git a/src/AsyncWebSocket.h b/src/AsyncWebSocket.h index 122aca9a..979c8be7 100644 --- a/src/AsyncWebSocket.h +++ b/src/AsyncWebSocket.h @@ -5,7 +5,8 @@ #define ASYNCWEBSOCKET_H_ #include -#ifdef ESP32 + +#if defined(ESP32) || defined(LIBRETINY) #include #include #ifndef WS_MAX_QUEUED_MESSAGES diff --git a/src/ESPAsyncWebServer.h b/src/ESPAsyncWebServer.h index 525a2847..ae45d131 100644 --- a/src/ESPAsyncWebServer.h +++ b/src/ESPAsyncWebServer.h @@ -15,7 +15,7 @@ #include #include -#ifdef ESP32 +#if defined(ESP32) || defined(LIBRETINY) #include #elif defined(ESP8266) #include diff --git a/src/Middleware.cpp b/src/Middleware.cpp index 890303de..5e9c3c27 100644 --- a/src/Middleware.cpp +++ b/src/Middleware.cpp @@ -172,7 +172,11 @@ void AsyncLoggingMiddleware::run(AsyncWebServerRequest *request, ArMiddlewareNex return; } _out->print(F("* Connection from ")); +#ifndef LIBRETINY _out->print(request->client()->remoteIP().toString()); +#else + _out->print(request->client()->remoteIP()); +#endif _out->print(':'); _out->println(request->client()->remotePort()); _out->print('>'); diff --git a/src/WebHandlers.cpp b/src/WebHandlers.cpp index acfc7c04..21dba006 100644 --- a/src/WebHandlers.cpp +++ b/src/WebHandlers.cpp @@ -209,11 +209,14 @@ void AsyncStaticWebHandler::handleRequest(AsyncWebServerRequest *request) { char buf[len]; char *ret = lltoa(lw ^ request->_tempFile.size(), buf, len, 10); etag = ret ? String(ret) : String(request->_tempFile.size()); +#elif defined(LIBRETINY) + long val = lw ^ request->_tempFile.size(); + etag = String(val); #else etag = lw ^ request->_tempFile.size(); // etag combines file size and lastmod timestamp #endif } else { -#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) +#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) || defined(LIBRETINY) etag = String(request->_tempFile.size()); #else etag = request->_tempFile.size(); diff --git a/src/WebRequest.cpp b/src/WebRequest.cpp index 8b735af3..1227f325 100644 --- a/src/WebRequest.cpp +++ b/src/WebRequest.cpp @@ -394,7 +394,7 @@ bool AsyncWebServerRequest::_parseReqHeader() { } _headers.emplace_back(name, value); } -#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) +#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) || defined(LIBRETINY) // Ancient PRI core does not have String::clear() method 8-() _temp = emptyString; #else @@ -419,7 +419,7 @@ void AsyncWebServerRequest::_parsePlainPostChar(uint8_t data) { _params.emplace_back(name, urlDecode(value), true); } -#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) +#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) || defined(LIBRETINY) // Ancient PRI core does not have String::clear() method 8-() _temp = emptyString; #else diff --git a/src/WebServer.cpp b/src/WebServer.cpp index 27af7d68..c3c3ee73 100644 --- a/src/WebServer.cpp +++ b/src/WebServer.cpp @@ -4,7 +4,7 @@ #include "ESPAsyncWebServer.h" #include "WebHandlerImpl.h" -#if defined(ESP32) || defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) +#if defined(ESP32) || defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350) || defined(LIBRETINY) #include #elif defined(ESP8266) #include @@ -15,7 +15,7 @@ using namespace asyncsrv; bool ON_STA_FILTER(AsyncWebServerRequest *request) { -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI return WiFi.localIP() == request->client()->localIP(); #else return false; @@ -23,7 +23,7 @@ bool ON_STA_FILTER(AsyncWebServerRequest *request) { } bool ON_AP_FILTER(AsyncWebServerRequest *request) { -#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED +#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI return WiFi.localIP() != request->client()->localIP(); #else return false;