1

I've got a Mediatek MT7921 for bt/wifi that's given me some problems in the past. It had been working for both BT+wifi but now only works for wifi.

I'm using Ubuntu 22.10 with kernel 6.0.9

lshw -C network gives the following:

  *-network                 
       description: Wireless interface
       product: MT7921 802.11ax PCI Express Wireless Network Adapter
       vendor: MEDIATEK Corp.
       physical id: 0
       bus info: pci@0000:05:00.0
       logical name: wlp5s0
       version: 00
       serial: 
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=mt7921e driverversion=6.0.9-060009-generic firmware=____010000-20220608210922 latency=0 link=no multicast=yes wireless=IEEE 802.11
       resources: iomemory:7c0-7bf iomemory:7c0-7bf iomemory:7c0-7bf irq:109 memory:7c10100000-7c101fffff memory:7c10200000-7c10203fff memory:7c10204000-7c10204fff

nmcli d shows that the wifi is 'unavailable'

DEVICE             TYPE      STATE         CONNECTION         
enp6s0             ethernet  connected     Wired connection 1 
                   bt        disconnected  --                 
wlp5s0             wifi      unavailable   --                 
lo                 loopback  unmanaged     --     

I've tried restarting wpa_supplicant.service and then restarting NetworkManager, same issue.

Any ideas for what to try next?

wunderbard
  • 39
  • 6

1 Answers1

0

So the end result is that my issue was an OS/UI thing.

nmcli d

This showed the wifi interface to be unavailable.

iwlist wlp5s0 scanning

Despite the interface showing as unavailable to nmcli, iwlist was able to scan the nearby wifi SSIDs indicating the hardware, driver, etc. were in fact working at least to some degree.

Following the procedure at https://www.baeldung.com/linux/connect-network-cli I was able to create a wpa_supplicant.conf file, test it, run it and then use dhcp to get a connection.

Steps:

  • check your wireless interface (iwconfig)
  • activate the interface (sudo ifconfig up>)
  • scan to verify it's working (sudo iwlist s)
  • as was the situation in my case, create a wpa_supplicant.conf file to handle the passphrase (sudo wpa_passphrase <wlan_name>)
  • this will interactively prompt for pw and generate stdout that we need to put into the conf file (I put it in /etc/wpa_supplicant.conf but put it wherever you please)
  • check the drivers (wpa_supplicant)
  • test (wpa_supplicant -i -c <wpa_supplicant.conf file path> -D ) - I used wext
  • if it connects then add a -B arg to the wpa_supplicant command above to run it in the background (if it doesn't, start troubleshooting :-) )
  • use dhclient to get an IP (sudo dhclient )

I lose the connection when I restart, but scripting the following makes it easy to connect again

#/bin/bash
wpa_supplicant -B -i wlp5s0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext
dhclient wlp5s0 

iwconfig shows the association with the AP and ifconfig shows the IP etc, however nmcli still shows wlp5s0 as being unavailable. The UI still shows a spinner and won't list SSIDs or do anything useful but I don't know if I can be bothered to deal with that when I seldom use wifi and at that, mostly on just one AP.

wunderbard
  • 39
  • 6