Configuring Wi-Fi on Raspberry Pi Using NetworkManager and raspi-config
Step 1: Disable Auto-Connect Configuration
By default, NetworkManager is preconfigured to connect to RedRover. If you want to change the network that your Raspberry Pi Zero connects to, you need to remove the configuration file that NetworkManager uses to connect to the wifi automatically and create a manual connection.
Rather than delete this configuration file, we are going to move it to a different location and create a backup, so that you can undo this configuration change in the future.
- Open a terminal on your Raspberry Pi.
-
Move the preconfigured network connection file to a backup location:
This moves the file to the home directory so it can be restored if needed. -
Reload NetworkManager to apply the changes:
This ensures that the removed configuration no longer affects network connections.
Undoing the Configuration to Reconnect to RedRover Automatically
If you want your Raspberry Pi to reconnect to the RedRover network automatically, you can restore the original configuration file.
- Open a terminal on your Raspberry Pi.
-
Move the backup configuration file back to its original location:
This restores the original configuration file that was moved earlier. -
Reload NetworkManager to apply the changes:
This ensures that the restored configuration takes effect and the Raspberry Pi will automatically connect to RedRover. -
Verify the connection by checking the connected Wi-Fi SSID:
This will display the current SSID that the Raspberry Pi is connected to, confirming it is connected to RedRover.
Step 2: Configure a New Wi-Fi Connection Using raspi-config
Once the default configuration has been removed, use raspi-config
to set up a new connection.
- Open
raspi-config
: - Using the arrow keys, enter, and esc, navigate to: System Options -> Wireless LAN
- Enter the SSID (network name) and Wi-Fi passphrase when prompted.
- Exit (esc)
raspi-config
and allow the Raspberry Pi to apply the settings.
Step 3: Verify the Connection
After configuring the connection, confirm that the Raspberry Pi is connected to the new Wi-Fi network.
-
Check internet connectivity by running:
This will send continuous pings to Google’s servers. If the connection is successful, you will see responses showing latency times. -
Stop the ping test by pressing:
-
Verify the connected Wi-Fi SSID:
This will display the current SSID that the Raspberry Pi is connected to.
Step 4: Important Notes About Wi-Fi SSIDs
- SSID names are case-sensitive and space-sensitive. Be sure to enter them exactly as they appear in the network settings.
- Apostrophes (
'
) in SSIDs may cause issues with some connection methods. Ifraspi-config
fails to connect to a network with an apostrophe in the SSID, try manually configuring it usingwpa_supplicant.conf
(this is an advanced method and may require additional troubleshooting).
Conclusion
By following these steps, you have configured your Raspberry Pi to disable auto-connect, set up a new Wi-Fi connection, and verify the connection using ping
and iwgetid
. If you experience any connection issues, ensure that the Wi-Fi SSID and passphrase are correct and try restarting the Raspberry Pi.