Skip to content

Fix WiFi auto-connect skipping open networks - #2820

Open
sergarsilla wants to merge 1 commit into
BruceDevices:devfrom
sergarsilla:fix/wifi-connect-open-networks
Open

Fix WiFi auto-connect skipping open networks#2820
sergarsilla wants to merge 1 commit into
BruceDevices:devfrom
sergarsilla:fix/wifi-connect-open-networks

Conversation

@sergarsilla

Copy link
Copy Markdown

Proposed Changes

The background auto-connect task wifiConnectTask skipped every OPEN
(passwordless) network because it bailed out on pwd == "". Known open
networks are stored with an empty password, so they could never be joined
automatically.

wifiConnectTask now treats an empty stored password as "unknown network"
only for secured APs. When a scanned network's auth mode is WIFI_AUTH_OPEN
and it is present in the stored credentials, it is connected without a
password. Behaviour for secured (WPA/WPA2/WPA3) networks is unchanged.

A small BruceConfig::hasWifiCredential() helper distinguishes a known open
network (stored, empty password) from an unknown network (not stored), without
changing the credential storage format.

Types of Changes

Bugfix

Verification

  1. Save an open network's SSID to the stored WiFi credentials (empty password).
  2. Enable WiFi auto-connect and let wifiConnectTask run near that network.
  3. The device now connects to the open network instead of skipping it; secured
    networks keep connecting exactly as before.

Builds clean for lilygo-t-embed-cc1101; the change is board-agnostic.

Testing

Not covered by automated tests (no harness for this path); verified by building
the firmware and by inspecting the connect path.

Linked Issues

Resolves the TODO in src/core/wifi/wifi_common.h:
"rn it skips open networks due to password == "" check".

User-Facing Change

Fix WiFi auto-connect skipping open (passwordless) networks.

Further Comments

Minimal, non-breaking change; no unrelated refactors. The helper is const and
adds no per-connection allocation, so the ESP32 memory impact is negligible.

Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Aug 22, 2026
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