1

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?

Fabian
  • 1,288
  • 1
  • 10
  • 19
No3x
  • 111
  • 1
  • 3

1 Answers1

3

Why your Raspberry Pi was not able to reconnect after reboot is really hard to tell from the information provided.

However, I am pretty sure that

wpa_cli select_network 0

did not work as you intended, as I can see that the WiFi-direct interface p2p-dev-wlan0 was used (this interface is selected as default, if you call wpa_cli on raspbian stretch). In my experience, you should specify the Interface (assuming that wlan0 is your regular wireless Interface, you want to use to connect to the Access point):

wpa_cli -i wlan0 select_network 0

Then manual switching between networks normally works without problems and without the need to reboot.

oh.dae.su
  • 934
  • 1
  • 5
  • 12