Raspberry Pi WiFi Automatic Connection

By default, RPi doesn’t connect to the WiFi automatically, which is annoying, especially when you don’t have keyboard/mouse/screen connected.

You can fix this by:

First connect to the WiFi using the WiFi app. This will include the following lines in /etc/network/interfaces:

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

Then edit /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="SSID"
        psk="pre-shared-key"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        auth_alg=OPEN
} 

You can repeat the network block for other networks you’d like to automatically connect to.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *