Skip to content

feat: Wi-Fi station connectivity - #11

Merged
JMTamayo merged 4 commits into
mainfrom
feat/wifi-station
Jun 20, 2026
Merged

feat: Wi-Fi station connectivity#11
JMTamayo merged 4 commits into
mainfrom
feat/wifi-station

Conversation

@JMTamayo

Copy link
Copy Markdown
Owner

Summary

Adds connectivity/wifi: a Wi-Fi station that uses the credentials provisioned over BLE (IWifiConfig) to connect to the network, so the device actually goes online. Same hexagonal structure as connectivity/provisioning.

  • Port IWifiStation (domain) + Status { Disconnected, Connecting, Connected }.
  • WifiService (application) — reads SSID/password from IWifiConfig; if there are no credentials it logs and returns without crashing.
  • EspWifiStation (infrastructure) — esp_wifi station adapter. Event-driven (WIFI_EVENT/IP_EVENT), non-blocking, reconnects indefinitely on drop via a one-shot esp_timer. Caps TX power after start to work around the ESP32-C3 SuperMini antenna.
  • Wifi (facade) — start() / stop() / isConnected() / onStatusChange(); wired in main to start after provisioning.

Design decisions: asynchronous + status query, BLE/Wi-Fi software coexistence (BLE keeps advertising), indefinite reconnection.

Build

  • Requires esp_wifi esp_event esp_netif esp_timer; software coexistence enabled.
  • The BLE + Wi-Fi binary exceeds the default 1 MB app partition, so a custom partitions.csv (3 MB factory) is added, keeping nvs at 0x9000/0x6000 (provisioner contract). Flash usage ~33% of the new partition.

Also included

  • Doxygen comments for the override methods of the existing config/provisioning adapters (consistency cleanup).

Notes

  • Credentials are read at start(); applying credentials freshly provisioned over BLE currently requires a reboot (the future orchestrator/FSM will coordinate live re-connection).
  • TX power is tunable via config::wifi::MAX_TX_POWER (34 = 8.5 dBm) for boards with different RF.

Verification

  • make -C firmware builds cleanly (Flash ~33%, RAM ~11%).
  • On hardware: provision Wi-Fi credentials, reboot, watch connectivity/wifi logs reach Connected with an IP; drop the AP and confirm it retries and reconnects; confirm BLE still advertises (coexistence).

JMTamayo added 4 commits June 20, 2026 18:08
Require the esp_wifi/esp_event/esp_netif/esp_timer components and enable
software BLE/Wi-Fi coexistence. Add a custom partition table with a larger app
partition, since the BLE + Wi-Fi binary exceeds the default 1 MB; nvs is kept at
0x9000/0x6000 to preserve the host provisioner contract.
Add connectivity/wifi following the hexagonal structure: the IWifiStation port,
WifiService (reads credentials from IWifiConfig), the esp_wifi adapter and the
Wifi facade. Connects asynchronously in station mode using the stored
credentials, reports connection status and reconnects indefinitely on drop. Caps
TX power after start to work around the ESP32-C3 SuperMini antenna. Wire it in
main to start after provisioning.
Add Doxygen comments to the override methods of the flash-backed config adapters
and the NimBLE GATT server, matching the documentation style used elsewhere.
@JMTamayo
JMTamayo merged commit 6fb03f7 into main Jun 20, 2026
2 checks passed
@JMTamayo
JMTamayo deleted the feat/wifi-station branch June 20, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant