Operating system: I use a Raspbian derivate called openhabian.
I had the following configuration wpa_supplicant.conf:
network={
ssid="NEW"
key_mgmt=NONE
}
network={
ssid="OLD"
key_mgmt=NONE
}
My /etc/network/interfaces
:
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Because the RPi connected to the OLD network and I want it to connect to the NEW network I added a priority:
network={
ssid="NEW"
key_mgmt=NONE
priority=2
}
network={
ssid="OLD"
key_mgmt=NONE
priority=1
}
~$ wpa_cli list_networks
Selected interface 'p2p-dev-wlan0'
network id / ssid / bssid / flags
0 NEW any
1 OLD any
~$ wpa_cli select_network 0
Selected interface 'p2p-dev-wlan0'
OK
~$ reboot
After this it does not connect to any network. I can't access the RPi anymore but I want to know why at least. I were very sure that I do not lock out because it has still the OLD network and it would be safe to add the priority. Maybe I just have to wait until it connects to the "fallback" OLD network?
Does the wpa_cli select_network 0
write any persistent configuration?
Raspbian
. Can you please add a tag for this? Does the NEW network ever works? For testing have you tried awpa_supplicant.conf
only with the NEW network block? – Ingo Mar 26 '18 at 11:57