WifiApModule¶
WiFi access point (AP) mode. Always starts an open AP on boot — the unconditional recovery path for connecting to the device. Introduced in Sprint 8.
What it does¶
WifiApModule starts a Wi-Fi soft access point in setup(). The AP:
- Uses the parent
NetworkModule'sdeviceName()as its SSID (e.g.MM-A3F2). - Is bound to the fixed IP
4.3.2.1viasoftAPConfig(). - Is open by default (no password). Define
WIFIAP_PASSWORDat compile time to add aap_passwordsensitive control. - Stays up even when
WifiStaModuleconnects to a home network — both run simultaneously viaWIFI_AP_STAmode set byNetworkModule.
The AP is the recovery path: even if STA credentials are wrong, the device is always reachable at http://4.3.2.1.
On PC, startAp() is a no-op; status is set to "PC (no WiFi)".
Controls¶
| Key | Type | Default | Description |
|---|---|---|---|
status |
display |
"starting" → "active" or "failed" |
AP state, updated after softAP() call |
ap_password |
password (sensitive) |
"" |
Only present when WIFIAP_PASSWORD is defined |
Data-flow input¶
WifiApModule reads the device name from NetworkModule via:
void setInput(const char* key, Module* source) override {
if (strcmp(key, "network") == 0)
network_ = static_cast<NetworkModule*>(source);
}
Wire it in state/modulemanager.json via "inputs": {"network": "network1"}.
Parent¶
WifiApModule is a child of NetworkModule. Its lifecycle is managed by the ModuleManager parent-child mechanism. teardown() calls WiFi.softAPdisconnect() cleanly.
Platform notes¶
PC: no-op; status is always "PC (no WiFi)".
Test coverage¶
→ Network and WiFi — lifecycle on PC does not crash; setInput("network") accepted without crash.