Mt7921e fails to start AP on 22.03.x and newer

Hello!

I am trying to get RZ608 WiFi card working on OpenWrt 22.03.5 (also tried 22.05.0-rc2) on a mini PC for testing purposes. Both are able to scan the radios surrounding the device, but not able to create a AP.
When I run wifi up I can see in log that hostapd is not found:

Tue Jul  4 18:45:14 2023 daemon.notice netifd: radio0 (3102): ./mac80211.sh: eval: line 573: /usr/sbin/hostapd: not found
Tue Jul  4 18:45:44 2023 daemon.notice netifd: radio0 (3102): Command failed: Request timed out
Tue Jul  4 18:45:44 2023 daemon.notice netifd: radio0 (3102): Command failed: Not found
Tue Jul  4 18:45:44 2023 daemon.notice netifd: radio0 (3102): Device setup failed: HOSTAPD_START_FAILED
Tue Jul  4 18:45:44 2023 daemon.notice netifd: Wireless device 'radio0' set retry=0
Tue Jul  4 18:45:44 2023 daemon.crit netifd: Wireless device 'radio0' setup failed, retry=0
Tue Jul  4 18:45:44 2023 daemon.notice netifd: Wireless device 'radio0' is now down
# opkg list_installed
base-files - 1502-r20134-5f15225c1e
bnx2-firmware - 20220411-1
busybox - 1.35.0-5
ca-bundle - 20211016-1
cgi-io - 2022-08-10-901b0f04-21
dnsmasq - 2.86-16
dropbear - 2022.82-2
e2fsprogs - 1.46.5-2
firewall4 - 2022-10-18-7ae5e14b-1
fstools - 2022-06-02-93369be0-2
fwtool - 2019-11-12-8f7fe925-1
getrandom - 2021-08-03-205defb5-2
grub2 - 2.06-3
grub2-bios-setup - 2.06-3
grub2-efi - 2.06-3
hostapd-common - 2022-01-16-cff80b4f-16.2
iw - 5.16-1
iwinfo - 2022-12-15-8d158096-1
jansson4 - 2.13.1-2
jshn - 2022-05-15-d2223ef9-1
jsonfilter - 2018-02-04-c7e938d6-1
kernel - 5.10.176-1-c90b8cdeba326c5459f96b8e3bd16c5a
kmod-amazon-ena - 5.10.176-1
kmod-amd-xgbe - 5.10.176-1
kmod-bnx2 - 5.10.176-1
kmod-button-hotplug - 5.10.176-3
kmod-cfg80211 - 5.10.176+5.15.92-1-1
kmod-crypto-aead - 5.10.176-1
kmod-crypto-ccm - 5.10.176-1
kmod-crypto-cmac - 5.10.176-1
kmod-crypto-crc32c - 5.10.176-1
kmod-crypto-ctr - 5.10.176-1
kmod-crypto-gcm - 5.10.176-1
kmod-crypto-gf128 - 5.10.176-1
kmod-crypto-ghash - 5.10.176-1
kmod-crypto-hash - 5.10.176-1
kmod-crypto-hmac - 5.10.176-1
kmod-crypto-manager - 5.10.176-1
kmod-crypto-null - 5.10.176-1
kmod-crypto-rng - 5.10.176-1
kmod-crypto-seqiv - 5.10.176-1
kmod-crypto-sha256 - 5.10.176-1
kmod-e1000 - 5.10.176-1
kmod-e1000e - 5.10.176-1
kmod-forcedeth - 5.10.176-1
kmod-fs-vfat - 5.10.176-1
kmod-hwmon-core - 5.10.176-1
kmod-i2c-algo-bit - 5.10.176-1
kmod-i2c-core - 5.10.176-1
kmod-igb - 5.10.176-1
kmod-igc - 5.10.176-1
kmod-input-core - 5.10.176-1
kmod-ixgbe - 5.10.176-1
kmod-lib-crc-ccitt - 5.10.176-1
kmod-lib-crc32c - 5.10.176-1
kmod-libphy - 5.10.176-1
kmod-mac80211 - 5.10.176+5.15.92-1-1
kmod-mdio - 5.10.176-1
kmod-mdio-devres - 5.10.176-1
kmod-mii - 5.10.176-1
kmod-mt76-connac - 5.10.176+2022-09-06-d7054646-5
kmod-mt76-core - 5.10.176+2022-09-06-d7054646-5
kmod-mt76-usb - 5.10.176+2022-09-06-d7054646-5
kmod-mt7921-common - 5.10.176+2022-09-06-d7054646-5
kmod-mt7921-firmware - 5.10.176+2022-09-06-d7054646-5
kmod-mt7921e - 5.10.176+2022-09-06-d7054646-5
kmod-nf-conntrack - 5.10.176-1
kmod-nf-conntrack6 - 5.10.176-1
kmod-nf-flow - 5.10.176-1
kmod-nf-log - 5.10.176-1
kmod-nf-log6 - 5.10.176-1
kmod-nf-nat - 5.10.176-1
kmod-nf-reject - 5.10.176-1
kmod-nf-reject6 - 5.10.176-1
kmod-nfnetlink - 5.10.176-1
kmod-nft-core - 5.10.176-1
kmod-nft-fib - 5.10.176-1
kmod-nft-nat - 5.10.176-1
kmod-nft-offload - 5.10.176-1
kmod-nls-base - 5.10.176-1
kmod-nls-cp437 - 5.10.176-1
kmod-nls-iso8859-1 - 5.10.176-1
kmod-nls-utf8 - 5.10.176-1
kmod-phy-realtek - 5.10.176-1
kmod-ppp - 5.10.176-1
kmod-pppoe - 5.10.176-1
kmod-pppox - 5.10.176-1
kmod-pps - 5.10.176-1
kmod-ptp - 5.10.176-1
kmod-r8169 - 5.10.176-1
kmod-slhc - 5.10.176-1
kmod-tg3 - 5.10.176-1
kmod-usb-core - 5.10.176-1
libblkid1 - 2.37.4-1
libblobmsg-json20220515 - 2022-05-15-d2223ef9-1
libc - 1.2.3-4
libcomerr0 - 1.46.5-2
libext2fs2 - 1.46.5-2
libf2fs6 - 1.14.0-3
libgcc1 - 11.2.0-4
libiwinfo-data - 2022-12-15-8d158096-1
libiwinfo-lua - 2022-12-15-8d158096-1
libiwinfo20210430 - 2022-12-15-8d158096-1
libjson-c5 - 0.15-2
libjson-script20220515 - 2022-05-15-d2223ef9-1
libkmod - 27-2
liblua5.1.5 - 5.1.5-10
liblucihttp-lua - 2023-03-15-9b5b683f-1
liblucihttp0 - 2023-03-15-9b5b683f-1
libmnl0 - 1.0.5-1
libnftnl11 - 1.2.1-2
libnl-tiny1 - 2021-11-21-8e0555fb-1
libpci - 3.8.0-2
libpthread - 1.2.3-4
librt - 1.2.3-4
libsmartcols1 - 2.37.4-1
libss2 - 1.46.5-2
libubox20220515 - 2022-05-15-d2223ef9-1
libubus-lua - 2022-06-01-2bebf93c-1
libubus20220601 - 2022-06-01-2bebf93c-1
libuci20130104 - 2021-10-22-f84f49f0-6
libuclient20201210 - 2023-04-13-007d9454-1
libucode20220812 - 2022-12-02-46d93c9c-1
libustream-wolfssl20201210 - 2022-12-08-9217ab46-2
libuuid1 - 2.37.4-1
libwolfssl5.5.4.ee39414e - 5.5.4-stable-1
logd - 2021-08-03-205defb5-2
lua - 5.1.5-10
luci - git-23.093.42303-d58cd69
luci-app-firewall - git-23.093.42704-1c01c64
luci-app-opkg - git-23.093.42303-e16f620
luci-base - git-23.093.57104-ce20b4a
luci-lib-base - git-20.232.39649-1f6dc29
luci-lib-ip - git-20.250.76529-62505bd
luci-lib-jsonc - git-22.097.61921-7513345
luci-lib-nixio - git-20.234.06894-c4a4e43
luci-mod-admin-full - git-19.253.48496-3f93650
luci-mod-network - git-23.093.42704-52965f4
luci-mod-status - git-23.093.42411-713f701
luci-mod-system - git-23.013.73113-588381e
luci-proto-ipv6 - git-21.148.48881-79947af
luci-proto-ppp - git-21.158.38888-88b9d84
luci-ssl - git-20.244.36115-e10f954
luci-theme-bootstrap - git-23.093.42704-b47268a
mkf2fs - 1.14.0-3
mtd - 26
netifd - 2022-08-25-76d2d41b-1
nftables-json - 1.0.2-2.1
odhcp6c - 2022-08-05-7d21e8d8-18
odhcpd-ipv6only - 2023-01-02-4a673e1c-2
openwrt-keyring - 2022-03-25-62471e69-3
opkg - 2022-02-24-d038e5b6-1
partx-utils - 2.37.4-1
pciids - 0.359-1
pciutils - 3.8.0-2
ppp - 2.4.9.git-2021-01-04-3
ppp-mod-pppoe - 2.4.9.git-2021-01-04-3
procd - 2022-06-01-7a009685-2
procd-seccomp - 2022-06-01-7a009685-2
procd-ujail - 2022-06-01-7a009685-2
px5g-wolfssl - 6.2
r8169-firmware - 20220411-1
rpcd - 2022-12-15-7de4820c-1
rpcd-mod-file - 2022-12-15-7de4820c-1
rpcd-mod-iwinfo - 2022-12-15-7de4820c-1
rpcd-mod-luci - 20210614
rpcd-mod-rrdns - 20170710
ubox - 2021-08-03-205defb5-2
ubus - 2022-06-01-2bebf93c-1
ubusd - 2022-06-01-2bebf93c-1
uci - 2021-10-22-f84f49f0-6
uclient-fetch - 2023-04-13-007d9454-1
ucode - 2022-12-02-46d93c9c-1
ucode-mod-fs - 2022-12-02-46d93c9c-1
ucode-mod-ubus - 2022-12-02-46d93c9c-1
ucode-mod-uci - 2022-12-02-46d93c9c-1
uhttpd - 2022-10-31-23977554-1
uhttpd-mod-ubus - 2022-10-31-23977554-1
urandom-seed - 3
urngd - 2020-01-21-c7f7b6b6-1
usign - 2020-05-23-f1f65026-1
wireless-regdb - 2023.05.03-1
zlib - 1.2.11-6

Is hostapd replaced by some other application/package in 22.03.x?
Hostapd is presented in 21.02.7 packages, however the mt7921e driver is faulty in there. Also hostapd from 21.02 fails to work on newer 22.03 due to missing symbols.

Has anyone else experienced such behaviour?
Thank You in advance
Taavi

I compiled hostapd for the 22.03.5 and made some advances - at least Luci now shows me that there are possible to use encryptions on AP and log does not complain on missing hostapd but rather its configuration:

Wed Jul  5 15:43:39 2023 daemon.notice hostapd: Configuration file: /var/run/hostapd-phy0.conf (phy wlan0) --> new PHY
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 15: unknown configuration item 'ieee80211ax'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 16: unknown configuration item 'he_default_pe_duration'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 17: unknown configuration item 'he_rts_threshold'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 18: unknown configuration item 'he_mu_edca_qos_info_param_count'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 19: unknown configuration item 'he_mu_edca_qos_info_q_ack'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 20: unknown configuration item 'he_mu_edca_qos_info_queue_request'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 21: unknown configuration item 'he_mu_edca_qos_info_txop_request'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 22: unknown configuration item 'he_mu_edca_ac_be_aifsn'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 23: unknown configuration item 'he_mu_edca_ac_be_aci'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 24: unknown configuration item 'he_mu_edca_ac_be_ecwmin'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 25: unknown configuration item 'he_mu_edca_ac_be_ecwmax'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 26: unknown configuration item 'he_mu_edca_ac_be_timer'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 27: unknown configuration item 'he_mu_edca_ac_bk_aifsn'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 28: unknown configuration item 'he_mu_edca_ac_bk_aci'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 29: unknown configuration item 'he_mu_edca_ac_bk_ecwmin'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 30: unknown configuration item 'he_mu_edca_ac_bk_ecwmax'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 31: unknown configuration item 'he_mu_edca_ac_bk_timer'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 32: unknown configuration item 'he_mu_edca_ac_vi_ecwmin'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 33: unknown configuration item 'he_mu_edca_ac_vi_ecwmax'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 34: unknown configuration item 'he_mu_edca_ac_vi_aifsn'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 35: unknown configuration item 'he_mu_edca_ac_vi_aci'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 36: unknown configuration item 'he_mu_edca_ac_vi_timer'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 37: unknown configuration item 'he_mu_edca_ac_vo_aifsn'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 38: unknown configuration item 'he_mu_edca_ac_vo_aci'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 39: unknown configuration item 'he_mu_edca_ac_vo_ecwmin'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 40: unknown configuration item 'he_mu_edca_ac_vo_ecwmax'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Line 41: unknown configuration item 'he_mu_edca_ac_vo_timer'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: 27 errors found in configuration file '/var/run/hostapd-phy0.conf'
Wed Jul  5 15:43:39 2023 daemon.err hostapd: Failed to set up interface with /var/run/hostapd-phy0.conf
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884): Command failed: ubus call hostapd config_add {"iface":"wlan0", "config":"/var/run/hostapd-phy0.conf"} (Invalid argument)
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884): Usage: ubus [<options>] <command> [arguments...]
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884): Options:
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  -s <socket>:		Set the unix domain socket to connect to
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  -t <timeout>:		Set the timeout (in seconds) for a command to complete
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  -S:			Use simplified output (for scripts)
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  -v:			More verbose output
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  -m <type>:		(for monitor): include a specific message type
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884): 			(can be used more than once)
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  -M <r|t>		(for monitor): only capture received or transmitted traffic
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884): Commands:
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - list [<path>]			List objects
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - call <path> <method> [<message>]	Call an object method
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - subscribe <path> [<path>...]	Subscribe to object(s) notifications
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - listen [<path>...]			Listen for events
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - send <type> [<message>]		Send an event
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - wait_for <object> [<object>...]	Wait for multiple objects to appear on ubus
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):  - monitor				Monitor ubus traffic
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884):
Wed Jul  5 15:43:39 2023 daemon.notice netifd: radio0 (17884): Device setup failed: HOSTAPD_START_FAILED
Wed Jul  5 15:43:39 2023 daemon.notice netifd: Wireless device 'radio0' set retry=0
Wed Jul  5 15:43:39 2023 daemon.crit netifd: Wireless device 'radio0' setup failed, retry=0

/var/run/hostapd-phy0.conf:

driver=nl80211
logger_syslog=127
logger_syslog_level=2
logger_stdout=127
logger_stdout_level=2
hw_mode=g
beacon_int=100
channel=1
chanlist=1


ieee80211n=1
ht_coex=0
ht_capab=[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935]
ieee80211ax=1
he_default_pe_duration=4
he_rts_threshold=1023
he_mu_edca_qos_info_param_count=0
he_mu_edca_qos_info_q_ack=0
he_mu_edca_qos_info_queue_request=0
he_mu_edca_qos_info_txop_request=0
he_mu_edca_ac_be_aifsn=8
he_mu_edca_ac_be_aci=0
he_mu_edca_ac_be_ecwmin=9
he_mu_edca_ac_be_ecwmax=10
he_mu_edca_ac_be_timer=255
he_mu_edca_ac_bk_aifsn=15
he_mu_edca_ac_bk_aci=1
he_mu_edca_ac_bk_ecwmin=9
he_mu_edca_ac_bk_ecwmax=10
he_mu_edca_ac_bk_timer=255
he_mu_edca_ac_vi_ecwmin=5
he_mu_edca_ac_vi_ecwmax=7
he_mu_edca_ac_vi_aifsn=5
he_mu_edca_ac_vi_aci=2
he_mu_edca_ac_vi_timer=255
he_mu_edca_ac_vo_aifsn=5
he_mu_edca_ac_vo_aci=3
he_mu_edca_ac_vo_ecwmin=5
he_mu_edca_ac_vo_ecwmax=7
he_mu_edca_ac_vo_timer=255

radio_config_id=1df8e0a0715a58a578826e401c5a8943
interface=wlan0
ctrl_interface=/var/run/hostapd
ap_isolate=1
bss_load_update_period=60
chan_util_avg_period=600
disassoc_low_ack=1
skip_inactivity_poll=0
preamble=1
wmm_enabled=1
ignore_broadcast_ssid=0
uapsd_advertisement_enabled=1
utf8_ssid=1
multi_ap=0
auth_algs=1
wpa=0
ssid=OpenWrt
bridge=br-lan
wds_bridge=
snoop_iface=br-lan
qos_map_set=0,0,2,16,1,1,255,255,18,22,24,38,40,40,44,46,48,56
config_id=dd14ec6a7c90e36831b63d55e3b34a8b
bssid=10:6f:d9:29:df:d1

Commenting out ieee80211ax=1 to he_mu_edca_ac_vo_timer=255 resolved this as a temporary workaround and I was able to start the AP. Still need to verify if everything works as expected and figure out the ax mode enabling.

Hi taavi, first of all welcome to the community!

What is the actual mt7921e device? Does this device normally have WiFi? If not, then the OpenWrt build for it won't have the underlying WiFi support baked in and you'll need to add it.

The standard basic WiFi support for OpenWrt right now is wpad-basic-mbedtls - this will get you both the wpa supplicant and hostapd your system needs for WiFi. The "basic" version just means that certain things most people don't need aren't included, like enterprise authentication methods.

Hi VA1DER,

Yes the device has Wifi by default - Mediatek RZ608 card which is able to scan other APs after install, however activating AP on it failed since hostapd is missing (as You can see from the logs). While I tried to find wpad or hostapd from repository using opkg list | grep -E "wpad|hostapd" I received 0 results - packages are not available. I also did not see *wpad* packages on the 23.05.0-rc2 list for x86_64 architecture. As I understood the wpad-basic-mbedtls is default from 23.05.0 and I did not see it under 22.03.5 tag configuration.
So I cloned openwrt git repository and built myself a hostapd package just to verify that I can get AP to work - which I managed (but no ax mode, yet). This might be also kernel support issue and at this point I feel more and more that I need to build a custom image for myself to take full advantage of the WiFi card.

Best regards,
Taavi

What is the main device? I'd be very surprised if the repositories have no wpad or hostapd for your device.

cat /etc/openwrt_release

The main device is a mini PC, Minisforum HM90 to be more precise, on which I am testing things out.

# cat ~/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='22.03.5'
DISTRIB_REVISION='r20134-5f15225c1e'
DISTRIB_TARGET='x86/64'
DISTRIB_ARCH='x86_64'
DISTRIB_DESCRIPTION='OpenWrt 22.03.5 r20134-5f15225c1e'
DISTRIB_TAINTS=''

I replaced the hostapd package with wpad and I got everything to work as it should including the 80211ax.

It also seems that now there are given packages available in the repository!
Thank You for the support!

I had same issue here: Anyone got MT7921K WiFi6E card running in x86 OpenWrt?

I got it working too.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.