Score:1

Wifi not working (unavailable) 22.10 Mediatek MT7921

fj flag

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?

Jeremy31 avatar
ke flag
Does the wifi work in a supported Ubuntu kernel?
wunderbard avatar
fj flag
Same issue with 5.19.0-26-generic
pmanolov avatar
gb flag
Facing the same issue, any help would be appreciated. @wunderbard, any luck resolving it ?
wunderbard avatar
fj flag
Sorry @pmanolov, no luck yet. I wound up just using wired. You may find this useful though: -initially bt+wifi only worked from a completely cold (power supply shutoff) boot -there was a brief time where that issue was resolved and bt+wifi worked flawlessly -now bt works great, wifi doesn't So at some point, the issue was resolved. I'm not sure what changed. I tried moving up to newer kernels and going back to older, no luck. I suspect it's likely something related to the driver, but perhaps since the kernel didn't affect it maybe not the driver itself?
pmanolov avatar
gb flag
Thanks @wundebard, I manage to make it work finally by changing the PCI slot I was using. I guess I can share the summary of my efforts, hopefully, that might help someone in the future. 1. First make sure you are using the latest Linux kernel - I am using v6 and that should have all the drivers necessary 2. The pci slot being used seems to be important, I've seen a lot of people solving the problem by using a different slot. Try that before going deeper into this particular rabbit hole.
wunderbard avatar
fj flag
Glad you were able to figure out yours @pmanolov. I'm still trying to sort out mine. Thankfully I haven't needed wifi recently! I learned of the command iwlist wlp5s0 scanning and it successfully scans the wifi networks in the area. So it seems that the adapter/driver are likely okay, maybe something at the OS level? And mine is unfortunately not a pci card, it's built onto the motherboard so I'm unable to change the slot
wunderbard avatar
fj flag
Another update, I can associate with the procedures detailed here for WPA https://www.baeldung.com/linux/connect-network-cli Once associated, I can do ip link set wlp5s0 down and then ip link set wlp5s0 up and it will re-associate, but not getting an IP or internet. The OS UI for WIFI is still just showing a spinner. There's definitely something up with my wifi/networking but at this point still no idea what the issue is or how it was caused.
wunderbard avatar
fj flag
:facepalm: I missed the last step in that guide of running sudo dhclient wlp3s0 to get the IP I can get an IP and wifi works. So now how to fix the ui?
wunderbard avatar
fj flag
Meh, I can't be bothered, after a restart I lose the connection but I can easily reconnect with two commands that I've scripted. If I need wifi (which isn't often), I can just run the script and I'm good. Side note.... don't run the script twice, it does weird things.
Score:0
fj flag

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.

David avatar
cn flag
You need to include the commands from that link in your question. What if the link is gone in the future.
wunderbard avatar
fj flag
@David good point, updated
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.