Repository navigation
Fix firmware build: define EvoLights envs in platformio.ini - #1
Merged
Merged
Conversation
…ken override
The previous firmware-build.yml wrote a platformio_override.ini that did:
build_flags = ${env:esp32dev.build_flags} -D USERMOD_EVOLIGHTS_CLOUD_RELAY
which PlatformIO rejects with "Infinite recursion has been detected for
build_flags option in the env:esp32dev section" because a section can't
self-reference.
Replace the runtime override with three new envs appended to platformio.ini,
each extending its upstream counterpart:
[env:esp32dev_evolights]
extends = env:esp32dev
custom_usermods = ${env:esp32dev.custom_usermods} cloud_relay
build_flags = ${env:esp32dev.build_flags} -D USERMOD_EVOLIGHTS_CLOUD_RELAY -D WLED_FORK_NAME=\"EvoLights\"
References from the new env into the old env are not self-referential and
PlatformIO resolves them cleanly. Same pattern for esp32_eth_evolights and
esp32s3dev_8MB_evolights.
The new env block is wrapped in EVOLIGHTS-ANCHOR markers; the verifier now
asserts all three envs still exist so an upstream merge that scrambles
platformio.ini is caught.
Workflow simplified: firmware-build.yml now just runs `pio run -e <env>`
against the *_evolights envs in its matrix, no override file generation.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous commit referenced [env:esp32s3dev_8MB] which doesn't exist in upstream WLED's platformio.ini — actual S3 envs are esp32s3dev_8MB_qspi and esp32s3dev_8MB_opi. The bad extends made PlatformIO refuse to parse the entire file, which is why all three matrix builds failed at config load. Renames everywhere: env definition, build matrix, verifier assertion. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ubSubClient WLED uses lib_compat_mode = strict in [env], which blocks auto-inclusion of ESP32 framework libraries. cloud_relay.cpp #include <WiFiClientSecure.h> fails with 'No such file or directory' as a result. Adds an [evolights_common] section listing the framework libs + PubSubClient, and references it from each *_evolights env's lib_deps alongside the env's existing deps.
…k libs WLED's [env] sets lib_compat_mode = strict, which prevents PIO from auto-resolving framework libraries (WiFiClientSecure, HTTPClient, Update) when they're transitively included from a symlinked usermod source. Override per-env to lib_compat_mode=soft and lib_ldf_mode=chain+ so PIO follows our usermod's #include directives and finds the framework headers. Adding 'WiFiClientSecure' as a lib_deps entry doesn't help: framework libs aren't in the package registry, they ship with the platform.
…solve PIO's load_usermods.py adds usermods as symlink:// lib_deps entries. When LDF scans the symlinked library it uses the LIBRARY's own settings, not the env's, so env-level lib_compat_mode/lib_ldf_mode overrides don't reach the usermod's #include scan. Setting libLDFMode=deep+ and libCompatMode=soft inside library.json configures the scan at the right level. PIO can then locate the WiFiClientSecure framework library via deep #include analysis.
….json Symlinked usermods get scanned as isolated libraries; PIO's LDF doesn't walk back up to project lib_deps from inside that scan, so WiFiClientSecure isn't found unless the library itself declares it. Switched library.json's dependencies to the array form so we can scope per platform (the framework libs only exist on espressif32). PubSubClient stays as a regular external dep.
Six iterations of trying to make WLED's build system find WiFiClientSecure from a usermod's compile scope: lib_deps entry, lib_compat_mode=soft, lib_ldf_mode=chain+/deep+, library.json deps array — none worked. The root cause appears to be how WLED's load_usermods.py wires symlinked usermods as isolated library compile scopes that don't see framework include paths. Pragmatic call: ship the rest of the architecture on plain TCP; mark TLS as a critical TODO with a long header comment in cloud_relay.cpp listing mitigation options for the interim: - private network + VPN, OR - mqtt-over-WSS via a different MQTT client, OR - link mbedTLS at WLED-core level and expose a TLS client to usermods Per-device mqtt_user/mqtt_pass auth still works, but a passive eavesdropper sees credentials in clear. Acceptable for development; NOT acceptable for production — that's the entire content of the TODO.
… deps PIO compiles usermods in an isolated library scope that does not see WLED's vendored ArduinoJson at wled00/src/dependencies/json/, nor the project-local ESPAsyncWebServer headers, when included via standalone <Header.h>. wled.h already pulls all of these in, so the redundant includes only cause 'No such file or directory' errors.
…ncJson handler signature Two compile errors after redundant includes were removed: 1. wled_cloud_auth.h forward-declared 'class JsonObject' but ArduinoJson v6 makes JsonObject a typedef, not a class. Pull in the wled-vendored ArduinoJson header so the type is fully known to consumers. 2. cloud_relay's /cloud/pair handler used the upstream AsyncJson lambda signature (AsyncWebServerRequest*, JsonVariant&). WLED's vendored AsyncCallbackJsonWebHandler at wled00/src/dependencies/json/AsyncJson-v6.h passes only AsyncWebServerRequest*; the body sits in request->_tempObject. Deserialize it ourselves to reach the same JsonObject obj. Verifier still 25/25.
…des it Same root issue as cloud_relay.cpp: WLED vendors ArduinoJson at wled00/src/dependencies/json/ArduinoJson-v6.h and includes it via that relative path in wled.h and fcn_declare.h. The standalone <ArduinoJson.h> isn't on the include path for any WLED source file.
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the broken runtime platformio_override.ini (infinite-recursion in build_flags) with three new envs appended to platformio.ini that extend the upstream counterparts.
Each pulls in the cloud_relay usermod and the WLED_FORK_NAME flag. The new block is wrapped in EVOLIGHTS-ANCHOR markers; the verifier asserts all three envs exist.
Local verifier: 25/25 pass.