Skip to content

feat(net): fl::net::wifi connection API + netActivity RPC (#3576 Phase 6) - #3584

Merged
zackees merged 1 commit into
masterfrom
feat/fl-net-wifi-api-3576
Jul 2, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/fl-net-wifi-api-3576

Conversation

@zackees

@zackees zackees commented Jul 2, 2026

Copy link
Copy Markdown
Member

Phase 6 of #3576: the fl-level WiFi connection API (explicit program goal: "FastLED should implement the APIs for connection for WiFi and Bluetooth") and the network-activity RPC for the dual-device bench.

fl::net::wifi (src/fl/net/wifi.h)

  • connectSta(ssid, pass) — asynchronous station join; poll status() / isConnected(). Event-driven state machine: CONNECTING → CONNECTED on GOT_IP, bounded 6-retry reconnect, then FAILED.
  • startAp(ssid, pass, channel) — SoftAP (WPA2 with ≥8-char pass, open otherwise); APSTA coexistence with a station join.
  • stop(), status(), ipAddress(), apIpAddress(), toString(Status).
  • FL_WIFI_AVAILABLE = FL_IS_ESP32 && SOC_WIFI_SUPPORTED && FL_HAS_INCLUDE(<esp_wifi.h>). Real implementation in platforms/esp/32/net/wifi_esp32.cpp.hpp; all other platforms (host, WiFi-less MCUs like ESP32-H2) get safe no-op stubs reporting Status::UNSUPPORTED — same real/stub split as fl/net/ble.
  • Bluetooth connections: the existing fl::net::ble GATT transport API already covers create/status/teardown; documented as the BLE counterpart.

AutoResearch RPC (dual-device prep)

wifiConnect / wifiAp / wifiStatus / wifiStop + netActivity (NetworkDetector snapshot: wifiActive, wifiConnected, bluetoothActive, anyNetworkActive/Connected — the same detector the LED drivers consult for deep-yield decisions).

Verification

  • WROOM bench, live RPC session: netActivity IDLE → wifiAp brings up 192.168.4.1 and flips the detector (wifiActive:true, anyNetworkActive:true) → wifiStatus AP_ACTIVE → wifiStop → IDLE. RMT regression 4/4.
  • Host: 346/346 (new stub-contract + toString tests); lint clean; esp32dev compile clean.

Refs #3576.

🤖 Generated with Claude Code

…e 6)

FastLED had no reusable network connection manager: the only
credential-taking API was OTA-scoped (OTA::beginWiFi) and examples
hand-rolled esp_wifi_* calls. This adds the fl-level WiFi connection
surface the rest of fl::net (fetch, HTTP server, remote RPC) runs on,
plus the network-activity RPC for the dual-device bench.

fl::net::wifi (src/fl/net/wifi.h):
- connectSta(ssid, pass): async station join; poll status()/
  isConnected(). Event-driven state machine (CONNECTING -> CONNECTED on
  GOT_IP; bounded 6-retry reconnect then FAILED).
- startAp(ssid, pass, channel): SoftAP (WPA2 when pass >= 8 chars,
  open otherwise); coexists with STA (APSTA).
- stop() / status() / ipAddress() / apIpAddress(); toString(Status).
- FL_WIFI_AVAILABLE: FL_IS_ESP32 && SOC_WIFI_SUPPORTED &&
  FL_HAS_INCLUDE(<esp_wifi.h>). Real impl in
  platforms/esp/32/net/wifi_esp32.cpp.hpp; every other platform
  (host, WiFi-less MCUs like ESP32-H2) gets safe no-op stubs reporting
  Status::UNSUPPORTED — same split as fl/net/ble.
- Bluetooth connections remain the existing fl::net::ble GATT
  transport API (createTransport/queryStatus).

AutoResearch RPC (dual-device bench prep):
- wifiConnect {ssid,password} / wifiAp {ssid,password,channel} /
  wifiStatus / wifiStop — thin wrappers over fl::net::wifi.
- netActivity — NetworkDetector snapshot (wifiActive, wifiConnected,
  bluetoothActive, anyNetworkActive/Connected) + wifi status string;
  this is the detector the LED drivers consult for deep-yield.

Verified on WROOM bench: netActivity IDLE -> wifiAp (192.168.4.1,
detector flips wifiActive/anyNetworkActive true) -> AP_ACTIVE ->
wifiStop -> IDLE; RMT regression 4/4. Host: 346/346 (new stub-contract
+ toString tests), lint clean. Compile matrix unaffected (H2 keeps
stubs via SOC_WIFI_SUPPORTED gate).

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fl-net-wifi-api-3576

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant