Skip to content

Add WiFi-on/off build presets and binary size compare workflow#2

Open
Stargazer2026 wants to merge 1 commit intomainfrom
codex/check-wled-firmware-wlan-behavior-with-lan-m3whn3
Open

Add WiFi-on/off build presets and binary size compare workflow#2
Stargazer2026 wants to merge 1 commit intomainfrom
codex/check-wled-firmware-wlan-behavior-with-lan-m3whn3

Conversation

@Stargazer2026
Copy link
Owner

Motivation

  • Provide a reproducible, side-by-side build workflow to produce WiFi-enabled and WiFi-forced-off firmware so the measurable binary-size delta can be used as an objective argument for upstream changes.

Description

  • Add two sample PlatformIO override environments to platformio_override.sample.ini: slwf09_eth_wifi_on and slwf09_eth_wifi_off, where the latter adds -D WLED_FORCE_WIFI_OFF while keeping all other flags identical.
  • Add tools/compare_wifioff_size.sh, a small automation script that builds both environments, locates both firmware.bin artifacts, prints their sizes and byte delta, and emits SHA256 checksums for traceability.
  • Include usage instructions in the sample override section so maintainers can copy to platformio_override.ini and run the compare script easily.

Testing

  • Ran a shell syntax check with bash -n tools/compare_wifioff_size.sh, which passed.
  • Executed ./tools/compare_wifioff_size.sh slwf09_eth_wifi_on slwf09_eth_wifi_off after creating a temporary platformio_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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +686 to +690
DEBUG_PRINTLN(F("WLED_FORCE_WIFI_OFF active. Skipping WiFi/AP init."));
lastReconnectAttempt = millis();
WiFi.disconnect(true);
WiFi.mode(WIFI_OFF);
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +514 to +517
#ifdef WLED_FORCE_WIFI_OFF
DEBUG_PRINTLN(F("WLED_FORCE_WIFI_OFF: forcing WiFi OFF."));
WiFi.mode(WIFI_OFF);
#else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant