Is it possible to configure the Raspberry Pi to connect to nearest open network? I like to take advantage of the Pi's size and SSH, but I have to use a monitor or Ethernet cord to connect to the same network.

How do you configure Pi to automatically connect to nearest network?

1 Answer 1


You can let the RPi connect to open networks with some adjustments in /etc/network/interfaces

allow-hotplug wlan0
iface wlan0 inet manual
   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

and in /etc/wpa_supplicant/wpa_supplicant.conf


With this, the RPi will connect to Open WiFis automatically.

If you want to connect to the "nearest" network, you should write a small script. With iwlist wlan0 scan you get a list of Wifis an its signal level. You can select which are

  1. open networks, means no WEP or WPA
  2. best dBM level this ESSID you can use with iwconfig wlan0 essid $bestwifi.

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.