Feature: Station-mode Fallback and Periodic Reconnection Loop (#112) - #114
Feature: Station-mode Fallback and Periodic Reconnection Loop (#112)#114dfry-lhzn wants to merge 5 commits into
Conversation
…JHC#111) - Adds CONFIG_REQUIRE_PMF_S to allow users with modern hotspots (like Pixel 9 Pro) to enforce Protected Management Frames. - Defaults PMF to capable but not required to preserve compatibility with legacy WPA2 networks. - Sets sae_pwe_h2e to WPA3_SAE_PWE_BOTH where available to enable WPA3 SAE flow.
Replaces the hard ESP.restart() failure loop when Station connection exhausts its retries. Instead: - State machine drops to AP-Fallback mode headlessly via apSetup() - Triggers non-blocking background async scans WiFi.scanNetworks(true) - Polls for configured hotspot presence over the air - Transitions seamlessly back to Station mode if detected - Configured via new parameter CONFIG_STATION_SCAN_INTERVAL_S exposed to Web UI (default: 30000 ms / 30s)
Intercepts CONFIG_MDNS_NAME_S (default value: "wibl") and assigns it using WiFi.setHostname() and WiFi.softAPsetHostname() respectively prior to network connection. Ensures tethered networks explicitly register the logger.
|
Hello @dfry-lhzn, In a rather suprising coincidence, I just logged into Github to create my own PR to expose You can find my changes here: main...parkercoates:WIBL:dual-mode-wifi There are some differences in our approaches, but I don't know that they are fundamental or irreconcilable:
I'll hold off on creating my own PR for now. Perhaps Dr. Calder can weigh in on his thoughts on the two different approaches. |
Gents, with apologies for the delay in responding to this (other projects and deadlines), I've read through the approach here, and although I like the functionality addition (and appreciate the bugfix), I think I like the idea of having the AT+STA on all of the time, particularly for debugging and testing. I have had concerns in the past about having an access point on full time on the bridge of a ship --- surely a place where we'd prefer to have as few radios running as we can get away with --- but users don't appear to have the same concerns that I do! Therefore, I feel that leaving the AP running even if we connect in STA mode is not a major concern. I would, however, like to see a separate parameter to how long to wait before attempting to reconnect in STA mode to the infrastructure AP, rather than dual-using an existing parameter. That's how things get broken :-) Perhaps there's opportunity to merge the two approaches? |
Stacked on #113. Review #113 first.
Resolves #112
This PR addresses the indefinite fallback behavior observed when the logger transitions into AP-Mode due to a missing target Station network. It implements a non-blocking background scanner that gracefully restores the Station connection whenever the target Hotspot returns.
Key Changes
AP-Fallback, theConnectionStateMachinetriggers a non-blockingWiFi.scanNetworks(true). If the target SSID is spotted, it transitions toSTATION_CONNECTING.WIFI_AP_STA. This ensures the logger can continue hosting its configuration access point while the Station interface asynchronously scans the airways in the background.WiFi.setHostnameis now executed prior to interface initialization on boot, binding the custommDNSproperty to the DHCP negotiation so it correctly resolves instead of leaving it stranded as 'espressif'.WiFi.begin(ssid, pass)was forcefully overriding the structure memory. It now builds thewifi_config_tcleanly to preserve SAE and PMF constants and performs a hardWiFi.disconnect(true)during transition to kill underlying SDK tracking states from stale attempts.