North RivetTechnical Library
Embedded SystemsImplementation GuideA Validus Group technical publication
Back to library
North Rivet Technical Library
A Validus Group technical publication | Fred Fisher - President, Validus Group Inc.; Founder & Principal Engineer, North Rivet

Validus Group Inc. | Technical Publication

Headless Wi‑Fi setup on Raspberry Pi 4 (Debian Trixie) using NetworkManager + nmcli
Document: VG‑TECH‑NET‑PI4‑WIFI‑NMCLI
Revision: 1.0
Date: 2026‑01‑03

Headless Wi‑Fi Setup on Raspberry Pi 4
Debian Trixie + NetworkManager (nmcli)

This procedure configures and validates Wi‑Fi connectivity on a Raspberry Pi 4 running headless Debian Trixie. The workflow uses NetworkManager and its CLI tool nmcli, which is suitable for unattended systems and repeatable deployments.

Document Owner

Name
Fred Fisher
Title
President, Validus Group Inc. | Founder & Principal Engineer, North Rivet
Organization
Validus Group Inc.
Website
validusgroup.com

At‑a‑glance

When troubleshooting headless Wi‑Fi, focus on three layers:

  • RF kill switch: rfkill soft/hard blocks must be cleared.
  • NetworkManager radio state: nmcli radio must show Wi‑Fi enabled.
  • Management + profile: wlan0 must be managed and have an active connection profile.
Security note: Avoid placing Wi‑Fi passwords directly in shell history on shared systems. Consider using nmcli -a for interactive prompts or run commands in a root shell with history disabled.

1) Scope and assumptions

Platform
Raspberry Pi 4 (Wi‑Fi interface wlan0)
OS
Debian Trixie (headless)
Network stack
NetworkManager + nmcli
Outcome
Wi‑Fi connects, persists across reboot, and is verifiable via CLI

This guide assumes you have local console access or a working network path via Ethernet to reach the Pi for initial setup. After Wi‑Fi is configured, Ethernet can be removed if desired.

2) Quick validation (current state)

The following output indicates the Wi‑Fi interface exists and is currently connected via NetworkManager.

2.1 Device status (NetworkManager)

fred@8channel:~$ nmcli dev status
DEVICE         TYPE      STATE                   CONNECTION
wlan0          wifi      connected               xxxxxxx
lo             loopback  connected (externally)  lo
p2p-dev-wlan0  wifi-p2p  disconnected            --
eth0           ethernet  unavailable             --

2.2 WLAN state

xxx@xxxx:~$ nmcli dev show wlan0 | egrep 'GENERAL.STATE|GENERAL.MANAGED|GENERAL.DRIVER|GENERAL.FIRMWARE'
GENERAL.STATE:                          100 (connected)

2.3 Driver / firmware confirmation (dmesg excerpt)

[    6.086517] brcmfmac: F1 signature read @0x18000000=0x15264345
[    6.094348] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.353332] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[    6.354060] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Aug 29 2023 01:47:08 version 7.45.265 (28bca26 CY) FWID 01-b677b91b
Interpretation: brcmfmac is the Broadcom FullMAC driver used on Pi 4. The log shows firmware was selected and initialized, and the interface is operational.

3) Install + enable NetworkManager

Install packages and enable NetworkManager:

sudo apt update
sudo apt install -y network-manager iw rfkill
sudo systemctl enable --now NetworkManager
nmcli general status
Firmware: If your image is minimal and does not include Wi‑Fi firmware, scanning may fail. On Raspberry Pi 4, the Wi‑Fi chipset typically requires Broadcom firmware packages provided by Debian.

4) Unblock Wi‑Fi (rfkill + NM radio)

Clear soft blocks, bring the interface up, and ensure NetworkManager radios are enabled:

rfkill list
sudo rfkill unblock wifi
sudo ip link set wlan0 up

sudo nmcli networking on
sudo nmcli radio wifi on
nmcli radio all

If Wi‑Fi is still “unavailable”, proceed to the management checks in the next section.

5) Ensure NetworkManager manages wlan0

5.1 Confirm management

nmcli dev status
nmcli dev show wlan0 | egrep 'GENERAL.STATE|GENERAL.MANAGED'

5.2 Fix: unmanaged interface

If you see GENERAL.MANAGED: no, NetworkManager is not controlling the interface (often due to legacy ifupdown / /etc/network/interfaces configuration).

  1. Edit NetworkManager config:
    sudo nano /etc/NetworkManager/NetworkManager.conf
  2. Ensure it includes:
    [ifupdown]
    managed=true
  3. Restart NetworkManager:
    sudo systemctl restart NetworkManager
Important: If /etc/network/interfaces contains a stanza for wlan0, NetworkManager may continue to treat the device as unmanaged. Comment out that stanza or migrate the configuration into NetworkManager.

6) Scan and connect with nmcli

6.1 Scan for networks

sudo nmcli dev wifi rescan
nmcli dev wifi list --rescan yes

6.2 Connect (WPA2/WPA3 Personal)

Connect to a network and automatically create a persistent connection profile:

nmcli dev wifi connect "YOUR_SSID" password "YOUR_PASSWORD" ifname wlan0
Tip: To avoid exposing the password in command history, use interactive mode:
nmcli -a dev wifi connect "YOUR_SSID" ifname wlan0

6.3 Connect to a hidden SSID (optional)

sudo nmcli con add type wifi ifname wlan0 con-name "wifi-hidden" ssid "YOUR_SSID"
sudo nmcli con modify "wifi-hidden" wifi.hidden yes
sudo nmcli con modify "wifi-hidden" wifi-sec.key-mgmt wpa-psk
sudo nmcli con modify "wifi-hidden" wifi-sec.psk "YOUR_PASSWORD"
sudo nmcli con up "wifi-hidden"

7) Verify connectivity

7.1 Check active connection

nmcli -p con show --active
ip -br addr show wlan0

7.2 Validate routing + DNS

ping -c 3 1.1.1.1
ping -c 3 debian.org
Expected result: wlan0 shows an IPv4 address, ping to an IP succeeds, and ping to a hostname succeeds.

8) Operational tips (autoconnect, priorities, logs)

8.1 Ensure Wi‑Fi reconnects automatically

nmcli con show
nmcli con modify "YOUR_SSID" connection.autoconnect yes
nmcli con up "YOUR_SSID"

8.2 Set connection priority (optional)

Higher values win if multiple connections are eligible:

nmcli con modify "YOUR_SSID" connection.autoconnect-priority 50

8.3 Review logs

journalctl -u NetworkManager --no-pager -n 200
nmcli general logging

8.4 Power management note

Some Pi deployments prefer disabling Wi‑Fi power saving to reduce latency spikes or intermittent drops. Your dmesg indicates power save is enabled:

[156349.676507] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

If you observe stability issues, mention your usage (interactive touchscreen / kiosk / low‑latency control) and we can select the correct persistent method for your Debian Trixie image.

9) Troubleshooting

9.1 “Wi‑Fi unavailable” in nmcli dev status

  1. Confirm rfkill:
    rfkill list
    sudo rfkill unblock wifi
  2. Confirm NM radios:
    nmcli radio all
    sudo nmcli radio wifi on
  3. Confirm interface is up:
    ip -br link show wlan0
    sudo ip link set wlan0 up
  4. Bypass NM and scan at the driver level:
    sudo iw dev wlan0 scan | head -n 40
  5. Inspect firmware/driver messages:
    dmesg | egrep -i 'brcm|brcmfmac|wlan0|firmware' | tail -n 120

9.2 Empty scan list

9.3 “Device unmanaged”

Enable NM management via managed=true and remove conflicting legacy configuration (Section 5.2).

Appendix A: Command reference

A.1 Status and diagnostics

nmcli general status
nmcli dev status
nmcli dev show wlan0
nmcli -p con show --active
rfkill list
ip -br addr
journalctl -u NetworkManager --no-pager -n 200

A.2 Scan and connect

sudo nmcli dev wifi rescan
nmcli dev wifi list --rescan yes
nmcli -a dev wifi connect "YOUR_SSID" ifname wlan0

A.3 Reset a connection profile (if needed)

nmcli con show
nmcli con down "YOUR_SSID"
nmcli con delete "YOUR_SSID"
nmcli -a dev wifi connect "YOUR_SSID" ifname wlan0
Deployment tip: For repeat builds, keep the “copy/paste checklist” from Sections 3-7 in your internal runbook and store site-specific SSIDs in a secure password manager.

Publishing and ownership

Original technical content: Validus Group Inc. This web edition is maintained in the North Rivet Technical Library.

Author: Fred Fisher - President, Validus Group Inc.; Founder & Principal Engineer, North Rivet.

North Rivet develops practical engineering software for real equipment. Validus Group Inc. provides industrial engineering, automation, and precision manufacturing expertise.