From 63b02919617790de0ea25e74473cab888a8acc70 Mon Sep 17 00:00:00 2001 From: Alex Hope-O'Connor Date: Wed, 26 Aug 2026 01:06:22 +1000 Subject: [PATCH] fix: declare async TCP PlatformIO dependencies --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 4 ++++ README.md | 37 ++++++++++++++++++++++------- library.json | 29 ++++++++++++++++++---- platformio.ini | 2 ++ scripts/compile-check.sh | 17 +++++++++++++ test/compile-project/platformio.ini | 33 +++++++++++++++++++++++++ test/compile-project/src/main.cpp | 10 ++++++++ 8 files changed, 119 insertions(+), 15 deletions(-) create mode 100755 scripts/compile-check.sh create mode 100644 test/compile-project/platformio.ini create mode 100644 test/compile-project/src/main.cpp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ed1387..00f909f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,4 +20,4 @@ jobs: with: python-version: '3.11' - run: python -m pip install --upgrade platformio==6.1.19 - - run: pio test -e ${{ matrix.environment }} --without-uploading --without-testing + - run: ./scripts/compile-check.sh --platform ${{ matrix.environment }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 567fdcb..f977f86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.0.3 + +- Declare the ESP8266 and ESP32 async TCP libraries explicitly in the PlatformIO package manifest so clean consumers resolve the headers required by the asynchronous portal. + ## 3.0.2 - Update the pinned DFTE dependency to the iterator-lifecycle and configuration-safe 1.0.2 release. diff --git a/README.md b/README.md index bf5de98..683b795 100644 --- a/README.md +++ b/README.md @@ -208,15 +208,34 @@ When developing both libraries together, use a local `symlink://` or ## Installation -Use the release tag in an application: +Use the release tag and list the asynchronous web/TCP packages at project level. +PlatformIO installs the manifest dependencies automatically, but its dependency +finder requires these headers to be direct project dependencies before it adds +their include paths: ```ini -[env:your_environment] -platform = espressif8266 ; or espressif32 -board = d1_mini ; your board +[common] +lib_deps = + WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.0.3 + ESP32Async/ESPAsyncWebServer@3.9.1 + +[env:esp8266] +extends = common +platform = espressif8266 +board = d1_mini framework = arduino lib_deps = - WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.0.2 + ${common.lib_deps} + ESP32Async/ESPAsyncTCP@2.0.0 + +[env:esp32] +extends = common +lib_deps = +platform = espressif32 +board = esp32dev +framework = arduino + ${common.lib_deps} + ESP32Async/AsyncTCP@3.4.9 ``` The text after `#` is a Git ref. PlatformIO clones the repository and checks @@ -231,12 +250,12 @@ lib_deps = ## Tests and releases -The CI workflow compile-checks the Unity test suite for both supported targets. -These commands need no connected board: +The CI workflow compiles a minimal clean consumer project for both supported +targets. These commands need no connected board: ```bash -pio test -e esp8266 --without-uploading --without-testing -pio test -e esp32 --without-uploading --without-testing +./scripts/compile-check.sh --platform esp8266 +./scripts/compile-check.sh --platform esp32 ``` Before publishing a version, update `library.json`, `CHANGELOG.md`, and this diff --git a/library.json b/library.json index 5595b5b..4dbe870 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "WiFiManager", - "version": "3.0.2", + "version": "3.0.3", "keywords": [ "wifi", "wi-fi", @@ -38,10 +38,29 @@ "espressif8266", "espressif32" ], - "dependencies": { - "ESP32Async/ESPAsyncWebServer": "3.9.1", - "DeviceFrameworkTemplateEngine": "https://github.com/alexhopeoconnor/DFTE.git#v1.0.2" - }, + "dependencies": [ + { + "owner": "ESP32Async", + "name": "ESPAsyncWebServer", + "version": "3.9.1" + }, + { + "owner": "ESP32Async", + "name": "ESPAsyncTCP", + "version": "2.0.0", + "platforms": "espressif8266" + }, + { + "owner": "ESP32Async", + "name": "AsyncTCP", + "version": "3.4.9", + "platforms": "espressif32" + }, + { + "name": "DeviceFrameworkTemplateEngine", + "version": "https://github.com/alexhopeoconnor/DFTE.git#v1.0.2" + } + ], "build": { "includeDir": "lib/WiFiManager/include", "srcDir": "lib/WiFiManager/src" diff --git a/platformio.ini b/platformio.ini index 43e73ca..947ef85 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,6 +17,7 @@ build_flags = lib_deps = ESP32Async/ESPAsyncWebServer@3.9.1 DeviceFrameworkTemplateEngine=https://github.com/alexhopeoconnor/DFTE.git#v1.0.2 + ESP32Async/ESPAsyncTCP@2.0.0 [env:esp32] platform = espressif32@6.13.0 @@ -34,6 +35,7 @@ build_flags = lib_deps = ESP32Async/ESPAsyncWebServer@3.9.1 DeviceFrameworkTemplateEngine=https://github.com/alexhopeoconnor/DFTE.git#v1.0.2 + ESP32Async/AsyncTCP@3.4.9 ; Optional: compile tests with DFTE logs bridged into WiFiManager::log (see README) [env:esp8266_dfte_log] diff --git a/scripts/compile-check.sh b/scripts/compile-check.sh new file mode 100755 index 0000000..99974de --- /dev/null +++ b/scripts/compile-check.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + echo "Usage: $0 --platform esp8266|esp32" >&2 + exit 2 +} + +[[ "${1:-}" == "--platform" ]] || usage +platform="${2:-}" +[[ "$platform" == "esp8266" || "$platform" == "esp32" ]] || usage +[[ $# -eq 2 ]] || usage + +root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +pio run -d "$root/test/compile-project" -e "$platform" + +echo "WiFiManager consumer compile check passed for $platform" diff --git a/test/compile-project/platformio.ini b/test/compile-project/platformio.ini new file mode 100644 index 0000000..82e21ad --- /dev/null +++ b/test/compile-project/platformio.ini @@ -0,0 +1,33 @@ +[platformio] +default_envs = esp8266 + +[common] +framework = arduino +lib_ldf_mode = chain +lib_deps = + WiFiManager=symlink://../.. + ESP32Async/ESPAsyncWebServer@3.9.1 + +[env:esp8266] +extends = common +platform = espressif8266 +board = d1_mini +platform_packages = + platformio/framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git#521ae60a89e64bb0d1eb7a0b7addf620ced5cad3 +build_flags = + -DWM_LOG_LEVEL=3 +lib_deps = + ${common.lib_deps} + ESP32Async/ESPAsyncTCP@2.0.0 + +[env:esp32] +extends = common +platform = espressif32@6.13.0 +board = esp32dev +build_unflags = -std=gnu++11 +build_flags = + -std=gnu++14 + -DWM_LOG_LEVEL=3 +lib_deps = + ${common.lib_deps} + ESP32Async/AsyncTCP@3.4.9 diff --git a/test/compile-project/src/main.cpp b/test/compile-project/src/main.cpp new file mode 100644 index 0000000..2dd1f85 --- /dev/null +++ b/test/compile-project/src/main.cpp @@ -0,0 +1,10 @@ +#include +#include + +WiFiManager wifiManager; + +void setup() { + wifiManager.setConfigPortalTimeout(1); +} + +void loop() {}