wlan0 not available in Debian Bookworm
I recently did a full upgrade of my OrangePi Zero boards from Stretch to Bookwork.
These boards are darn slow, but hey, at 8 bucks per board, I'll take it! One of them is my VPN, the other is my Dropbox mirror, and they work fine with only one job.
Wifi is notoriously bad in these boards due to their choice of radio chip: the XR819. Wifi was completely unusable after the upgrades, although it did work with Debian Strech.
Debugging
So first I checked nmcli for a list of devices. nmcli dev
shows me wlan0
as unavailable.
Then I checked /etc/network/interfaces
to make sure wlan0
is not managed there. It isn't.
nmtui
is also not working. Usually you can go to "Activate a connection" to select a wifi network. It showed nothing in that menu.
Next, I checked the wpa_supplicant
logs: journalctl -xeu wpa_supplicant
:
wpa_supplicant[480]: Could not set interface wlan0 flags (UP): Invalid argument
wpa_supplicant[480]: WEXT: Could not set interface 'wlan0' UP
wpa_supplicant[480]: wlan0: Failed to initialize driver interface
wpa_supplicant[480]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
OK, something somewhere is calling the driver with the wrong values.
I also checked ifconfig
and wlan0
was not listed there either. nmcli
shows wlan0, but not available:
wlan0: unavailable
"ST-Ericsson Wi-Fi"
wifi (xradio_wlan), AE:84:xx:xx:xx:xx, hw, mtu 1500
So after some searching I finally found the issue: the xradio kernel module does not allow setting a MAC address from user space.
The fix? add this to /etc/NetworkManager/NetworkManager.conf:
[device]
wifi.scan-rand-mac-address=no
Now you do a systemctl restart NetworkManager
and wlan0
is back and available!
I run nmcli
again, and sure enough:
wlan0: disconnected
"ST-Ericsson Wi-Fi"
wifi (xradio_wlan), 12:42:xx:xx:xx:xx, hw, mtu 1500
p2p-dev-wlan0: disconnected
"p2p-dev-wlan0"
wifi-p2p, hw
I can now use nmtui
again to select a network and connect. Nice!