Mt7915e wifi not working

I have an AsiaRF AW7915-NPD card which I have trouble with.
system is

OpenWrt 23.05.2 r23630-842932a63d x86-64

Syslog is showing:

[    8.198604] mt7915e 0000:04:00.0: enabling device (0000 -> 0002)
[    8.330380] mt7915e 0000:04:00.0: Direct firmware load for mediatek/mt7915_rom_patch.bin failed with error -2
[    8.331115] mt7915e 0000:04:00.0: Falling back to sysfs fallback for: mediatek/mt7915_rom_patch.bin
[    8.373171] mt7915e: probe of 0000:04:00.0 failed with error -12

I have installed the following relevant packages:

kmod-mt76-connac - 5.15.137+2023-08-14-b14c2351-1
kmod-mt76-core - 5.15.137+2023-08-14-b14c2351-1
kmod-mt7915e - 5.15.137+2023-08-14-b14c2351-1

and any attempt to make the device work fail. Not sure where to take it form here.

If I install kmod-mt7915-firmware, the device takes exceptionally long to become SSH-responsive and luci stops working altogether, and the card is still not working.

techinfodepot shows this card is using MT7915DAN and MT7975DN
Not sure if there is a driver for this on 23.05.2 but the card definitely worked with a pre-23 build.

AsiaRF says it uses MT7915 and they could all be the same; we'll figure it out.
Probably don't need them all but I'm too lazy to edit them out.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
"kernel": "5.15.137",
	"rootfs_type": "ext4",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.2",
		"revision": "r23630-842932a63d",
		"target": "x86/64",
		"description": "OpenWrt 23.05.2 r23630-842932a63d"

/etc/config/network

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd2c:0296:8ce3::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	list ip6class 'local'

config interface 'wan'
	option device 'eth4'
	option proto 'dhcp'
	option peerdns '0'
	list dns '103.86.96.100'
	list dns '103.86.99.100'

config interface 'wan6'
	option device 'eth4'
	option proto 'dhcpv6'
	option reqaddress 'try'
	option reqprefix 'auto'
	option peerdns '0'
	list dns '103.86.96.100'
	list dns '103.86.99.100'

config interface '4G'
	option proto 'modemmanager'
	option device '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4'
	option auth 'none'
	option allowedmode '4g|3g|2g'
	option preferredmode '4g'
	option iptype 'ipv4v6'
	option loglevel 'ERR'
	option auto '0'

config interface 'wg'
	option proto 'wireguard'
	option private_key 'private_keyprivate_keyprivate_keyprivate_keyprivate_keyprivate_key'
	list addresses '10.5.0.2/32'
	list dns '103.86.96.100'
	list dns '103.86.99.100'

config wireguard_wg
	option description 'uk1905.nordvpn.com'
	option public_key 'public_keypublic_keypublic_keypublic_keypublic_keypublic_keypublic_key'
	list allowed_ips '0.0.0.0/0'
	option endpoint_host 'uk1905.nordvpn.com'
	option endpoint_port '51820'
	option persistent_keepalive '25'
	option route_allowed_ips '1'

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:1b.3/0000:04:00.0'
	option channel 'auto'
	option band '2g'
	option cell_density '0'
	option country 'GB'
	option htmode 'HE20'
	option txpower '20'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'XXXXXXXXXXXXXX'
	option encryption 'psk-mixed'
	option key 'XXXXXXXXXXXXX'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:1b.3/0000:04:00.0+1'
	option channel '36'
	option band '5g'
	option cell_density '0'
	option country 'GB'
	option htmode 'HE40'
	option txpower '23'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'XXXXXXXXXXXX'
	option encryption 'psk-mixed'
	option key 'XXXXXXXXXXXXXXX'

config wifi-device 'radio2'
	option type 'mac80211'
	option path 'virtual/mac80211_hwsim/hwsim0'
	option channel '36'
	option band '5g'
	option htmode 'HE80'
	option disabled '1'

config wifi-iface 'default_radio2'
	option device 'radio2'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

config wifi-device 'radio3'
	option type 'mac80211'
	option path 'virtual/mac80211_hwsim/hwsim1'
	option channel '36'
	option band '5g'
	option htmode 'HE80'
	option disabled '1'

config wifi-iface 'default_radio3'
	option device 'radio3'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

/etc/config/firewall:

config defaults
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option synflood_protect '1'

config zone
	option name 'lan'
	list network 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'

config zone
	option name 'wan'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'
	list network 'wan'
	list network 'wan6'
	list network '4G'

config forwarding
	option src 'lan'
	option dest 'wan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-Ping'
	option src 'wan'
	option proto 'icmp'
	option icmp_type 'echo-request'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-IGMP'
	option src 'wan'
	option proto 'igmp'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-MLD'
	option src 'wan'
	option proto 'icmp'
	option src_ip 'fe80::/10'
	list icmp_type '130/0'
	list icmp_type '131/0'
	list icmp_type '132/0'
	list icmp_type '143/0'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Input'
	option src 'wan'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	list icmp_type 'router-solicitation'
	list icmp_type 'neighbour-solicitation'
	list icmp_type 'router-advertisement'
	list icmp_type 'neighbour-advertisement'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Forward'
	option src 'wan'
	option dest '*'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-IPSec-ESP'
	option src 'wan'
	option dest 'lan'
	option proto 'esp'
	option target 'ACCEPT'

config rule
	option name 'Allow-ISAKMP'
	option src 'wan'
	option dest 'lan'
	option dest_port '500'
	option proto 'udp'
	option target 'ACCEPT'

config zone
	option name 'wgfirewall'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	list network 'wg'
	option masq '1'
	option mtu_fix '1'

config forwarding
	option src 'lan'
	option dest 'wgfirewall'

/etc/config/dhcp

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option cachesize '1000'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option localservice '1'
	option ednspacket_max '1232'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '3'

there is no problem with internet connectivity, I am connected via ethernet to the device and have Internet access, it is only the wifi adapter which is not working. I have ran wifi config, it spits errors:

WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object

radios are not showing a valid mac address in LuCI either.

Get some isopropyl alcohol ready and q-tip.

Power the system down.

The antenna connectors are usually rated around 100, so gently pry them off, remembering which goes where,
Remove the card and clean the pin contacts and as much of the female plug you can with the q-tip and alcohol.
Let dry.

Replace the card but wiggle it, a little, from side to side ( we want it in) screw it down, gently replace the antennas. Place electrical tape over the antenna couplings (for good measure)

Power it up.

What happens?

maybe I didn't clean it properly but still no signal and LuCI still gives bad gateway over ethernet when trying to connect to the router.

Mind you, this card worked on a pre-23 build, but what you are saying might indeed be causing issues, given how this card is actually inside an mPCIe to m2 adapter, which itself is connected via an extension cable because it would not fit where the original m2 wifi card for this mobo was. So it very much be an issue due to the jankiness of the build. Oh, and also the card is dangling loosely inside the case, but then again there really isn't a lot of space in the case anyway.

You know im just gonna run a linux live usb to see if it is working...

This is why I thought it was a physical issue cleaning might fix, but now I think either the card is bad or the m.2 is not configured correctly and is expecting a storage device.

The M.2 behavior may be changed/configured in the bios.

I edited my reply, I am pretty sure the jankiness of the system might be causing this. THen again, I did see other folk complaining about timeouts for the mt7915 when I initially troubleshot the problem

I disassembled the router and reassembled it - still not working. I can't really run a live linux on it because it has no video output (well, technically there is, but I dont have an hdmi cable lying around). I will write again once I get a cable and see if this card can be ran on a different system.

Or I might just revert back to OpenWrt pre-23 and see if it is working there.

I found an hdmi cable and booted onto a live manjaro session from usb.
The wifi adapter is recognised and I can connect to a wifi network no hiccups, no error messages.
That means there is something definitely wrong with mt7915e or mt7915-firmware, or the way they communicate, for my x86 OpenWrt system.

Think I will just have to go back to the previous stable build.

One day when I finally stop jerking around and start reading more and more, I will be knowledgeable enough to just set up a full-blown linux distro as running OpenWrt on x86 is just an overkill, it was never intended to be, it's not really the point of OpenWrt so not placing blame there, besides I can definitely use the resources on my router for more complex tasks anyway.

You clearly need MT7915 firmware (mediatek/mt7915_rom_patch.bin) installed to get wireless. Installing firmware allows mt76 to operate. It seems like there may be a problem with mt76 that causes some kernel issue.

You need to start debugging on what happens once mt76 works (it has required firmware). Are there some error messages in kernel log? Can you see any process out of control in top?

If getting that info is impossible because of system being network-unresponsive the next step would be to use serial console.

I have dropped quite deep into the mt7915e rabbit hole and I suspect it is a firmware issue.
I have installed Debian on the same machine and the wifi is working fine.

Given how my knowledge is very limited, I am unsure on how to proceed. I have a few questions:
Would compiling from source on that same machine make any difference?
Where is the firmware for this card stored? Is it physically on the card, i.e. do I need to flash it, or is it on the storage drive? If it is on the storage drive, what is the difference between a firmware and a driver, then, conceptually speaking?

Debian reports the following regarding the firmware:

mt7915_rom_patch.bin
HW/SW version: 0x8a108a10, build time: 20220929104113a
mt7915_wm.bin
WM Firmware version: ____000000, build time: 20220929104145
mt7915_wa.bin
WA Firmware Version: DEV_000000, build time: 20220929104205

Is it possible to use those files in the OpenWrt installation, or maybe more recent ones?
I see a lot of folk on github complaining about issues with this chip but none have concluded what exactly causes it.

Update: it more and more seems like a firmware issue: even on Debian, just before reboot the system froze and started giving the same message timeouts I had seen on OpenWrt, however what I suspect triggered this behaviour was after I left my PC for 20 minutes, upon coming back it had gone to sleep - so it seems that there is an issue either with mt7915e power management or the state it is coming back from sleep.

For all intents and purposes though, it does not seem that this is an issue specifically with OpenWrt, might be a hardware issue, might be the firmware. However, given how it worked pre-going to sleep, I am inclined to believe the problem lies indeed with the firmware.

I have also found this super long thread about mt7915e:

Inside of it there is a script to update the device firmware, I ran that script then I realised the files on the server were empty so now my

/lib/firmware/mediatek/mt7915_eeprom.bin

is 0 bytes. Any idea how to fix that?

Try copying the firmware file from Manjaro, because it worked with your card.

1 Like

did not work, it was the same firmware version. I also managed to find updated firmware, that did not work either. very, very strange.

That’s weird. One other thing to try could be to compare hostapd.conf between Manjaro and OpenWrt or just use the former on OpenWrt.

I can't find hostapd.conf on the router.

root@OpenWrt:~# find / -name *hostapd* -print
/lib/netifd/hostapd.sh
/lib/upgrade/keep.d/hostapd-mbedtls
/sys/fs/cgroup/services/wpad/hostapd
/tmp/run/hostapd
/usr/lib/opkg/info/hostapd-common.control
/usr/lib/opkg/info/hostapd-common.postinst
/usr/lib/opkg/info/hostapd-common.prerm
/usr/lib/opkg/info/hostapd-common.list
/usr/lib/opkg/info/hostapd-mbedtls.conffiles
/usr/lib/opkg/info/hostapd-mbedtls.control
/usr/lib/opkg/info/hostapd-mbedtls.postinst
/usr/lib/opkg/info/hostapd-mbedtls.prerm
/usr/lib/opkg/info/hostapd-mbedtls.list
/usr/sbin/hostapd
/usr/sbin/hostapd-radius
/usr/share/hostap/hostapd.uc

running /lib/netifd/hostapd.sh does nothing.
wifi config gives:

WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
WARNING: Variable 'wlan' does not exist or is not an array/object
cat /usr/lib/opkg/info/hostapd-mbedtls.conffiles

/etc/config/radius
/etc/radius/clients
/etc/radius/users
root@OpenWrt:~# cat /etc/config/radius
config radius
        option disabled '1'
        option ca_cert '/etc/radius/ca.pem'
        option cert '/etc/radius/cert.pem'
        option key '/etc/radius/key.pem'
        option users '/etc/radius/users'
        option clients '/etc/radius/clients'
        option auth_port '1812'
        option acct_port '1813'

root@OpenWrt:~# cat /etc/radius/clients
0.0.0.0/0 radius

root@OpenWrt:~# cat /etc/radius/users
{
        "phase1": {
                "wildcard": [
                        {
                                "name": "*",
                                "methods": [ "PEAP" ]
                        }
                ]
        },
        "phase2": {
                "users": {
                }
        }
}

can't install hostapd as it conflicts with hostapd-mbedtls which I think is the intended behaviour.

It looks like the network service doesn’t generate hostapd configs. Is your wireless config correct? No typos?

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:1b.3/0000:04:00.0'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'sta'
        option ssid 'OpenWrt'
        option encryption 'none'
        option disabled '1'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:1b.3/0000:04:00.0+1'
        option channel '36'
        option band '5g'
        option disabled '1'
        option cell_density '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'sta'
        option ssid 'OpenWrt'
        option encryption 'none'

I haven't even touched it since flashing OpenWrt image.

for pci0000:00/0000:00:1b.3/0000:04:00.0 I get

[base-manager] couldn't check support for device '/sys/devices/pci0000:00/0000:00:1b.3/0000:04:00.0': not supported by any plugin

EDIT: this is most probably generated by modemmanager so I don't think it is actually related to the issue

Networks and radios are disabled so no hostapd configs are created. Anyway that doesn’t matter since your problem is somewhere with the driver. Maybe Manjaro has some kernel configs that enable it to work with this card. As a last ditch attempt maybe try to build OpenWrt image with Manjaro kernel config?

I don't think I am up for a task like that, I am in no way confident I can do it without messing something in the process.