RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
565 stars 207 forks source link

When wireless network added, wpa_cli list_networks does not see it? #178

Closed Jibun-no-Kage closed 2 years ago

Jibun-no-Kage commented 2 years ago

When wireless network added, wpa_cli list_networks does not see it? If I use raspi-config nonint , the /etc/wpa_supplicant/wpa_supplicant.conf has said network, but if I use wpa_cli list_networks, the list is empty. This means that if wpa_cli is used to add any networks, it will step on the previous configuration.

XECDesign commented 2 years ago

Are you passing the interface to wpa_cli? (For example, wpa_cli -i wlan0 list_networks)

Jibun-no-Kage commented 2 years ago

Interesting... if you let wpa_cli find the interface, everything works, via the typical cli use, but if you do explicitly provide the interface, the original configuration is never presented via wpa_cli list_networks, even though it exists under explicit wlan0. The found interface is p2-dev-wan0, but if the actual interface is wlan0, as raspi-config sees it, then wpa_cli list_networks never displays the configuration.

So the wpa_supplicant.conf is identical for wlan0 and p2p-dev-wlan0, but wpa_cli sees the difference internally. Maybe the conf file should have some type of comment note, noting the interface used for configuration?

Why list_networks or any other command does not show all configurations when no interface is explicitly provided, maybe an issue for wpa_cli development to address. Given wpa -i wlan0 list_networks and wpa_cli list_networks (with no prior interface or network specified) return different results.

Explains why my ansible script that does not quality the interface explicitly could not see what raspi-config did.

XECDesign commented 2 years ago

I don't know why they changed that behaviour, but I find always specifying the interface, just works in all cases. There's not much I can do about it, so if you think it should do something different, it might be something to raise upstream.

Jibun-no-Kage commented 2 years ago

Yeah, I will change my ansible script to use the explicit interface, like raspi-config does. Solves my issue. But I think I will also asked why the behavior is such, it does 'feel' like the explicit interface and discovered interface are the same interface... from my specific. A bit of catch 22 to be sure.