Raspberry Pi‎ > ‎

Connect Your Raspberry Pi to a WiFi Network

posted Oct 25, 2015, 5:14 AM by Chris G   [ updated Nov 18, 2017, 2:58 PM ]
Connecting your Raspberry Pi to a WiFi network is actually pretty straightforward.


sudo nano /etc/wpa_supplicant/wpa_supplicant.conf



ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="yourssid"
        psk="yourpassword"
        scan_ssid=1
        key_mgmt=WPA-PSK
        priority=5

}



Reboot the device and it should be on the network.

These networks can be given different priorities using the priority field, with a higher number indicating a higher priority.

If you have multiple networks, use the following:



ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="yourssid"
psk="yourpassword"
scan_ssid=1 key_mgmt=WPA-PSK priority=5 } # A remote office SSID network={ ssid="yourssid"
psk="yourpassword"
key_mgmt=WPA-PSK priority=1 }