Skip to content

Headless Setup ‐‐ connecting to wifi via cli

JohhnGoblin edited this page Dec 20, 2024 · 2 revisions

Headless Mode -- connection of wifi, setup of autoconnect to your home wifi

We're going to rely on NetworkManager.

  • via nmtui (recommended)
    enter nmtui into the command line and use the on-screen menu to establish a connection to your home wi-fi network. (ideally 2.4ghz as to not interfere with your video on 5.8ghz)

  • via nmcli
    Enter the following, replacing your_SSID and your_password as needed.

nmcli connection add ifname wlan1 type wifi ssid Your_SSID <---- enter your network name here

nmcli connection edit wifi-wlan1

nmcli> goto wifi
nmcli 802-11-wireless> set mode infrastructure
nmcli 802-11-wireless> back
nmcli> goto wifi-sec
nmcli 802-11-wireless-security> set key-mgmt wpa-psk
nmcli 802-11-wireless-security> set psk Your_Password  <---- enter your password here
nmcli 802-11-wireless-security> save
nmcli 802-11-wireless-security> quit

If your image does not come with NetworkManager

If your image does not ship with NetworkManager, you will need to make an initial manual connection via wpa_supplicant to download and install NetworkManager and then follow the steps above for autoconnection on boot. Wpa_supplicant will not persist after a reboot.

If this is your first boot, you will need to set the root password.

sudo passwd root

then as su:

wpa_passphrase your_SSID your_password > /etc/wpa_supplicant.conf

wpa_supplicant -B -i wlan1 -c /etc/wpa_supplicant.conf

dhclient wlan1

your_SSID is the name of your wifi network
your_password is the network's wifi password

exit su with exit

We should now have connection to the internet. Try pinging a website: ping www.google.com

If that works, run:

sudo apt install --no-install-recommends network-manager

Reboot and then follow the steps above for NetworkManager.


Your Radxa pi zero 3w is now headless, ready for an ssh connection on your home wifi network on bootup.