Configuring WiFi

To make Raspberry Pi connect the wireless network automatically, you need to create a configuration file on the operating system image you flashed. When Raspberry Pi boots, it reads the file you created to configure its wireless network settings. Then, it deletes the file from the directory.

Now, open Notepad or your favorite text editor and paste the following text block to it.

wpa_supplicant.conf
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
  ssid="SSID_1"
  psk="PASSWORD_1"
  id_str="NAME_1"
  priority=1
}

network={
  ssid="SSID_2"
  psk="PASSWORD_2"
  id_str="NAME_2"
  priority=2
}

Edit "SSID_n" and "PASSWORD_n" parameters according to your wireless settings. Optionally, you may wish to give it a name using the "NAME_n" parameter. Prioritize the networks by "priority" key. Add or remove new network names as required.

Then, save the file with the "wpa_supplicant.conf" filename to the "boot" drive of the micro SD card. Make sure its file extension is ".conf", not ".txt".

If you want to change the network setting in the future, create a new settings file. It replaces your previous network settings.

For more detailed information on setting up WiFi, visit Raspberry Pi's documentation at raspberrypi.org/documentation/configuration/wireless/wireless-cli.md address.

There is one more step left on configuring your operating system image, which is to allow remote access using SSH.

Last updated