0

I am using a Raspberry Pi 2 with a USB wifi adapter (headless setup). The wpa_supplicant.conf file contains authentication information only for my wifi access point, and the pi connects to it as expected. But I don't really know what would happen if my access point is down and there are other open wifi networks available nearby? Will the pi-

A. automatically connect to an available open wifi network?

or

B. do nothing, stay disconnected and only connect to my access point once it is back?

I am trying to avoid option A and I prefer option B. What can I do?

3

To answer your questions:

A. automatically connect to an available open wifi network?

wpa_supplicant will only connect to networks that are specified in /etc/wpa_supplicant/wpa_supplicant.conf. To connect to an open WiFi network you have to set this in wpa_supplicant.conf:

network={
   key_mgmt=NONE
}

Then wpa_supplicant will automatically connect to the open WiFi network.

B. do nothing, stay disconnected and only connect to my access point once it is back?

If the network block, as shown above, is not in the wpa_supplicant.conf, it will do nothing. If you have the network block for your protected WiFi network available then the RasPi will connect to it as usual.

I am trying to avoid option A and I prefer option B. What can I do?

Just don't add the network block for an open network to wpa_supplicant.conf.

0

I cannot comment yet, so posting here. I believe the discussion here answer your question (B).

Hence, marking this question as duplicate seems reasonable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.