I'm pulling my hairs out over what should be a simple network switch. I moved into a new home and we got a new router. To switch my Pis I booted up my old router, connected to the Pis (one 0W and a 3B+) via ssh and used raspi-config to change the wifi networks. Nothing seemed to have changed upon reboot. They still connected to the old network. Then I changed /etc/wpa_supplicant/wpa_supplicant to
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<My Country>
network={
ssid="<my new SSID>"
psk="<psk pw>"
}
and rebooted. Nothing happened, raspi boots into old network as if nothing changed.
The I looked at wpa_cli list_networks and got this error:
Selected interface 'p2p-dev-wlan0'
Interactive mode
Could not connect to wpa_supplicant: p2p-dev-wlan0
so i added
p2p_disabled=1
to the wpa_supplicant and could check that indeed everything got ignored, the only network listed was my old one.
I then added a prioritized second network to the wpa_supplicant.conf that, you guessed it, got ignored. I played around with different values (i understand that Priority has a 1-100 range) because i really haven't rebooted the Pi enough at this point.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<My Country>
network={
ssid="<my new SSID>"
psk="<psk pw>"
Priority=2
}
network={
ssid="<my old SSID>"
psk="<psk pw>"
Priority=1
}
From here i am stumped. Then I remembered that I set those Pis up headless by creating the ssh and wpa_supplicant.conf files and put the new one into /media/boot in the hope it gets transfered over the same way as the first time. No change. I did the same with mounting the SD-Card on a Desktop and saved it. Nada. Is there anything i missed, where does it get the info from if not from wpa_supplicant.conf? It's Debian Buster on both boxes if that helps. edit: the output of _ps aux | grep wpa_supplicant_
root 298 0.0 0.4 11004 4640 ? Ss Mar08 0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
pi 14786 0.0 0.0 7480 528 pts/0 S+ 08:43 0:00 grep --color=auto wpa_supplicant
UPDATE with info from comment:
About nm: I too am surprised how nm got into the mix here. The 3B+ is running homeassistant and the installation might have switched to network manager transparent to me. But for the Pi0W i am sure, because that thing is a pure raspbian buster testbed that i occasionally use just to run some python scripts. I didn't even know about network manager before. Unless buster does some translating of the wpa_supplicant.conf i can't imagine how that would work.
/media/boot
?? why can't you just edit/etc/wpa_supplicant/wpa_supplicant.conf
directly since you can run commands likewpa_cli
- also in my wpa_supplicant file I havekey_mgmt=WPA-PSK
andscan_ssid=1
in the network config - the latter is required if your AP doesn't broadcast SSID – Jaromanda X Mar 08 '20 at 00:58ps aux | grep wpa_supplicant
. – Ingo Mar 08 '20 at 08:21