How to add a second WiFi network to your Raspberry Pi 2

How to add a second WiFi network to your Raspberry Pi

Through the Raspberry Pi Installer, it has become very easy to configure the WiFi connection of your Pi.

However, there is only space for one network configuration. But what if you are building a digital picture frame as a present and want to have the network pre-configured, e.g., for your parents’ place?

You want your frame to be up and running when it is unwrapped, don’t you?

Fortunately, it is very easy to add second or even more additional networks. So when you move your photo frame to a new location, you just turn it on and immediately have a WiFi connection.

How to add another WiFi network

The network information is contained in the wpasupplicant.conf file which can be found when entering

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

If you have followed my setup instructions, the content will look something like this (your country code is likely to be different):

country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
ap_scan=1

update_config=1
network={
        ssid="yourfirstnetwork"
        psk="yourpassword"
}

If you want to add a second network, all you have to do is to amend a section like this

network={
        ssid="yoursecondnetwork"
        psk="yourpassword"
}

So, altogether, your file will look like this:

country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
ap_scan=1

update_config=1
network={
        ssid="yourfirstnetwork"
        psk="yourpassword"
}

network={
        ssid="yoursecondnetwork"
        psk="yourpassword"
}

Hit CTRL+O to save the config file and CTRL+X to exit and reboot.

Conclusion

If you are planning to give away your home-brewed Raspberry Pi photo frame, it is super easy and ultimately very convenient to enter the access data to other WiFi networks at a time when you still have the hardware in your possession.

Was this post helpful?

Scroll to Top