Skip to content

[Bug]: WiFiManager::getNetworkIdBySSID returns Null when wpa_cli list_networks doesn't return any flag for a given SSID #2007

Description

@meandthemachine

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Issue reporting checklist

Operating System

Raspberry Pi OS Desktop 64-bit Debian 12 (bookworm)

Installation method

Quick install

Onboard wireless chipset or external adapter?

External adapter

Hardware

Raspberry Pi 4 Model B

RaspAP version

Latest

Other software or services running with RaspAP?

No other software

Contact details (optional)

No response

Bug description

I observed this behaviour for the WiFi network provided by my phone's hotspot.

I seems wpa_cli -i $iface list_networks which is used by WiFiManager::getNetworkIdBySSID does not return flags for some networks. It also doesn't output a final tab \t in such a case, so there is no fourth column for such networks, then.

As getNetworkIdBySSID only respects rows with at least four columns (see line 460) it does not return the ID in such a case, but returns null, even if the SSID matches.

This leads to index -1 being used for that network on the WiFi client page. So, it is still being displayed as a known WiFi but you can't connect to it because of the missing/invalid index/ID.

Steps to reproduce

Happens when connected to my iPhone's hotspot and I turn off that hotspot on the phone's end.

Screenshots

No response

Additional context

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions