Can not get wifi working for Mediatek MT7921

Creating a bug report/issue

I have searched the existing open and closed issues

dietpi@DietPi:~$ cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=9
G_DIETPI_VERSION_RC=0
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='applied'
G_LIVE_PATCH_STATUS[1]='applied'
G_LIVE_PATCH_STATUS[2]='not applicable'

dietpi@DietPi:~$ uname -a
Linux DietPi 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 GNU/Linux
dietpi@DietPi:~$ echo $G_HW_MODEL_NAME
Native PC (x86_64)

Additional Information (if applicable)

  • Kernel Module for MT7921 is not loading and when I load it manually it still does not work
  • On fresh install and from dietpi-config the kernel tries to load module cfg80211
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
    984acccc-02d4-4791-aecd-fc5594be5075

Steps to reproduce

  1. try to activate wifi via dietpi-control even after putting in all the details and using static ip

Actual behaviour

Nothing

Extra details

Here is the adapter

dietpi@DietPi:/mnt/dietpi_userdata/apps$ sudo lshw -C network
  *-network                 
       description: Ethernet interface
       product: Ethernet Controller I226-V
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 04
       serial: 
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igc driverversion=6.1.0-28-amd64 duplex=full firmware=2017:888d ip=10.0.100.17 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:39 memory:dc900000-dc9fffff memory:dca00000-dca03fff memory:dc800000-dc8fffff
  *-network DISABLED
       description: Wireless interface
       product: MT7921 802.11ax PCI Express Wireless Network Adapter
       vendor: MEDIATEK Corp.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlan0
       logical name: /dev/fb0
       version: 00
       serial: 
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm bus_master cap_list ethernet physical wireless fb
       configuration: broadcast=yes depth=32 driver=mt7921e driverversion=6.1.0-28-amd64 firmware=____010000-20230117170942 ip=10.0.100.17 latency=0 link=no mode=1920x1080 multicast=yes visual=truecolor wireless=IEEE 802.11 xres=1920 yres=1080
       resources: iomemory:7f0-7ef iomemory:7f0-7ef iomemory:7f0-7ef irq:102 memory:7ff0300000-7ff03fffff memory:7ff0400000-7ff0403fff memory:7ff0404000-7ff0404fff
dietpi@DietPi:/mnt/dietpi_userdata/apps$ 

Here is what happens after running dietpi-control network adapters

Jan 07 21:22:29 DietPi systemd[1]: Reloading.
Jan 07 21:22:30 DietPi systemd[1]: Stopping ifup@eth0.service - ifup for eth0...
Jan 07 21:22:30 DietPi systemd[1]: ifup@eth0.service: Deactivated successfully.
Jan 07 21:22:30 DietPi systemd[1]: Stopped ifup@eth0.service - ifup for eth0.
Jan 07 21:22:30 DietPi systemd[1]: Starting ifup@eth0.service - ifup for eth0...
Jan 07 21:22:30 DietPi systemd[1]: Finished ifup@eth0.service - ifup for eth0.
Jan 07 21:22:30 DietPi systemd[1]: Starting ifup@wlan0.service - ifup for wlan0...
Jan 07 21:22:30 DietPi wpa_supplicant[17374]: Successfully initialized wpa_supplicant
Jan 07 21:22:30 DietPi ifup[17378]: RTNETLINK answers: File exists
Jan 07 21:22:30 DietPi ifup[17359]: ifup: failed to bring up wlan0
Jan 07 21:22:30 DietPi systemd[1]: ifup@wlan0.service: Main process exited, code=exited, status=1/FAILURE
Jan 07 21:22:30 DietPi wpa_supplicant[17375]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 07 21:22:30 DietPi wpa_supplicant[17375]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Jan 07 21:22:30 DietPi wpa_supplicant[17375]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Jan 07 21:22:30 DietPi wpa_supplicant[17375]: wlan0: CTRL-EVENT-TERMINATING
Jan 07 21:22:30 DietPi systemd[1]: ifup@wlan0.service: Failed with result 'exit-code'.
Jan 07 21:22:30 DietPi systemd[1]: Failed to start ifup@wlan0.service - ifup for wlan0.
Jan 07 21:22:33 DietPi kernel: igc 0000:02:00.0 eth0: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: R

This is loading the module ( Unless I am wrong this module is supposed to handle mt7921 and all its variants)

dietpi@DietPi:~$ sudo modprobe mt7921e

After the above dmesg does not report anything

But if I do a grep on dmesg it obviously loads it at some piont

dietpi@DietPi:~$ sudo dmesg | grep mediatek
[    1.483784] bluetooth hci0: firmware: direct-loading firmware mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin
[    1.680852] mt7921e 0000:03:00.0: firmware: direct-loading firmware mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin
[    1.938959] mt7921e 0000:03:00.0: firmware: direct-loading firmware mediatek/WIFI_RAM_CODE_MT7961_1.bin
[    1.974017] mt7921e 0000:03:00.0: firmware: direct-loading firmware mediatek/WIFI_RAM_CODE_MT7961_1.bin
dietpi@DietPi:~$ 

not sure were to go from here.

This is a Minusforum pc UM690s

This error is coming from WPA_SUPPLICANT. Which settings are you passing to the Wifi interface?

1 Like

Not sure, this is just the default dietpi settings. I guess I have to figure out where and what those settings are, at least I have a starting point now.
I am reading over Debian’s help section now on systemd and wpa_supplicant.

usually this is managed by dietpi-config if the interface is working/detected correctly.

can you share following

ip a

Yes

dietpi@DietPi:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether  brd ff:ff:ff:ff:ff:ff
    inet 10.0.100.17/24 brd 10.0.100.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether  brd ff:ff:ff:ff:ff:ff
    inet 10.0.100.17/24 brd 10.0.100.255 scope global wlan0
       valid_lft forever preferred_lft forever

One thing I was wondering and now am working on is adding a password to wpa_supplicant.conf, currently it is as below. For some reason I thought this would be magically done for me :grinning:

dietpi@DietPi:~$ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf 
# WiFi country code, set here in case the access point does send one
country=US
# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
network={
	ssid="Birdbrain_5.1"
	scan_ssid=1
	key_mgmt=NONE
}

There is an adapter wlan0 indicating the availibility of the device. Bit it sees to have the very same IP address than Ethernet adapter. Usually this doesn’t work.

Anyway, the adapter is shown as not available in dietpi-config?

1 Like

OK, now it is working. But this was for DHCP and I want a static ip so will try a redo with static ip like I did yesterday.
Probably operator error as I somehow missed the part where you enter the password for the network.

Well this is new to me I have two ip address

dietpi@DietPi:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 58:47:ca:73:85:9d brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether  brd ff:ff:ff:ff:ff:ff
    inet 10.0.100.17/24 brd 10.0.100.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet 10.0.100.36/24 brd 10.0.100.255 scope global secondary dynamic wlan0
       valid_lft 86043sec preferred_lft 86043sec
dietpi@DietPi:~$ 

Not sure what you are doing but you can set a STATIC IP in dietpi-config. There as well you can connect to a WiFi network. Usually these are 2 different operations.

And you are free to use a STATIC IP address, but it should be one not already used (by any other device).

As an alternative, you can use IP address reservation on your DHCP server

probably due to your configuration changes you did manually.

This i what I will do. Thanks for having a look.
I think my confusion and then my other problems started on the first run of the installer because it would not connect to the network probably cuz I gave it a static ip that was already used by eth0 (I forgot I had it set in the router).
My bad, have e great day.