Add WiFi-on/off build presets and binary size compare workflow#2
Add WiFi-on/off build presets and binary size compare workflow#2Stargazer2026 wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 503a709f28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| DEBUG_PRINTLN(F("WLED_FORCE_WIFI_OFF active. Skipping WiFi/AP init.")); | ||
| lastReconnectAttempt = millis(); | ||
| WiFi.disconnect(true); | ||
| WiFi.mode(WIFI_OFF); | ||
| return; |
There was a problem hiding this comment.
Register websocket callbacks before WiFi-off early return
When WLED_FORCE_WIFI_OFF is enabled, initConnection() returns before reaching ws.onEvent(wsEvent), and this is the only websocket callback registration in the repo (wled00/wled.cpp). In that configuration (notably Ethernet-only builds with websockets enabled), websocket clients can connect but incoming websocket events are never handled, which breaks the live UI/control path that relies on wsEvent.
Useful? React with 👍 / 👎.
| #ifdef WLED_FORCE_WIFI_OFF | ||
| DEBUG_PRINTLN(F("WLED_FORCE_WIFI_OFF: forcing WiFi OFF.")); | ||
| WiFi.mode(WIFI_OFF); | ||
| #else |
There was a problem hiding this comment.
Preserve connection startup flow in WiFi-off setup path
The WLED_FORCE_WIFI_OFF branch skips the startup findWiFi(true) call, but handleConnection() still has an early guard that returns while wifiConfigured && multiWiFi.size() > 1 && WiFi.scanComplete() < 0. On devices with multiple saved SSIDs, scanComplete() can stay in the negative "no scan complete" state, so the loop keeps returning before initConnection()/interface initialization runs, causing startup networking services to stall even if Ethernet is present.
Useful? React with 👍 / 👎.
Motivation
Description
platformio_override.sample.ini:slwf09_eth_wifi_onandslwf09_eth_wifi_off, where the latter adds-D WLED_FORCE_WIFI_OFFwhile keeping all other flags identical.tools/compare_wifioff_size.sh, a small automation script that builds both environments, locates bothfirmware.binartifacts, prints their sizes and byte delta, and emits SHA256 checksums for traceability.platformio_override.iniand run the compare script easily.Testing
bash -n tools/compare_wifioff_size.sh, which passed../tools/compare_wifioff_size.sh slwf09_eth_wifi_on slwf09_eth_wifi_offafter creating a temporaryplatformio_override.ini; environment resolution and PlatformIO invocation worked, but the full build could not complete due to an external network/proxy error (PlatformIO failed to download platform packages with HTTP 403), so firmware artifacts were not produced in this environment.Codex Task