How to add a second WiFi network to your Raspberry Pi (updated for OS Bookworm)

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

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, adding a second or even more networks is very easy. So when you move your photo frame to a new location, you turn it on and immediately have a WiFi connection.

The latest Raspberry Pi operating system, Bookworm, has made several changes to the management of Wi-Fi networks. So this is the updated version for adding pre-configured wifi networks. On Raspberry Pi OS Bookworm, the wpa_supplicant.conf file is no longer used to configure Wi-Fi connections. Instead, Bookworm uses NetworkManager to manage network connections, including Wi-Fi.

How to add another WiFi network

The new method for configuring Wi-Fi connections on Raspberry Pi OS Bookworm is as follows:

NetworkManager stores Wi-Fi connection information in .nmconnection files located in the /etc/NetworkManager/system-connections/ directory.

So type

cd /etc/NetworkManager/system-connections/

With ls you can see

preconfigured.nmconnection

which you created by using the Raspberry Pi installer network settings.

You can now add further pre-configured networks by creating another *.nmconnection file.

Let’s say you set up the network for your parents’ place.

Enter

sudo nano parents.nmconnection

and paste the following text:

[connection]
id=second_wifi
uuid=95b17351-297c-4d9c-90f9-669d3ab81464
type=wifi

[wifi]
mode=infrastructure
ssid=YOUR_SSID_HERE

[wifi-security]
key-mgmt=wpa-psk
psk=YOUR_PASSWORD_HERE

[ipv4]
method=auto

[ipv6]
addr-gen-mode=default
method=auto

[proxy]

Replace YOUR_SSID_HERE with the network name and add YOUR_PASSWORD_HERE.

Your UUID must be unique so that if you have another network connection, you need to generate a new one with

uuid

Copy and paste that number in the above config file.

Save and close the file.

You can enter as many *.nmconnection files as you like. Bookworm will check if it can connect and use the relevant one.

Finally, for each *.nmconnection file, add the file permission with like

chmod 600 /etc/NetworkManager/system-connections/parents.nmconnection

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 article helpful?


Thank you for your support and motivation.


Scroll to Top