feat: Wi-Fi station connectivity - #11
Merged
Merged
Conversation
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.
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.
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 asconnectivity/provisioning.IWifiStation(domain) +Status { Disconnected, Connecting, Connected }.WifiService(application) — reads SSID/password fromIWifiConfig; if there are no credentials it logs and returns without crashing.EspWifiStation(infrastructure) —esp_wifistation adapter. Event-driven (WIFI_EVENT/IP_EVENT), non-blocking, reconnects indefinitely on drop via a one-shotesp_timer. Caps TX power after start to work around the ESP32-C3 SuperMini antenna.Wifi(facade) —start()/stop()/isConnected()/onStatusChange(); wired inmainto start after provisioning.Design decisions: asynchronous + status query, BLE/Wi-Fi software coexistence (BLE keeps advertising), indefinite reconnection.
Build
esp_wifi esp_event esp_netif esp_timer; software coexistence enabled.partitions.csv(3 MB factory) is added, keepingnvsat0x9000/0x6000(provisioner contract). Flash usage ~33% of the new partition.Also included
Notes
start(); applying credentials freshly provisioned over BLE currently requires a reboot (the future orchestrator/FSM will coordinate live re-connection).config::wifi::MAX_TX_POWER(34 = 8.5 dBm) for boards with different RF.Verification
make -C firmwarebuilds cleanly (Flash ~33%, RAM ~11%).connectivity/wifilogs reachConnectedwith an IP; drop the AP and confirm it retries and reconnects; confirm BLE still advertises (coexistence).