Setting up Wi-Fi connections can be smooth sailing until you encounter a network without a password. Although it’s less common, knowing how to connect via command line interface (CLI) can be handy.

In my experience, when it comes to changing Wi-Fi networks, the simplest method I’ve found is to restart the Pi. There might be other options available, but they’re beyond the scope of what I’ve explored here

wpa_suplicant.conf

// sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

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

network={
        ssid="ssid"
        psk="ssdfsdfsdf"
}

network={
        ssid="network"
        key_mgmt=NONE
}

network={
        ssid="Nope"
        psk="Unnnaaaaa"
}

network={
        ssid="Devices_AP"
        psk="esdrewrewrw"
}

Here’s a bit of guidance: you’ll need sudo privileges to edit this file.

The device will attempt connections to all networks listed on the left side.