Adding OpenWrt support for Xiaomi "Redmi Router AX6S"/"Xiaomi Router AX3200"

Try today, should be ok. There was an issue with building yesterday.
Also you can try to build by your own using GitHub actions for example
On the end, why don't you use firmware selector and customize image with your packages?

Thanks for the quick answer. Gonna try to build again now. I didn't use firmware selector because I have to inject a custom folder (which is not a official package) that contains the proprietary mtk drivers

Both builds still fail tho. Its in the package that I'm trying to ingest, seems like that package doesnt't work with a current release.

ERROR: package/mtk/mt7622 failed to build.
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/ole/build/openwrt/include/toplevel.mk:248: world] Error 1

Regarding the Error Message with building with -j1. I already did that, but it still seems to fail

Please paste last 50 lines. The last one does not say anything.
Or paste somewhere whole log:

make -j1 V=s package/mtk/mt7622/{clean,compile}

Here's the latest one where I compiled the official mediatek MTK drivers into SNAPSHOT

ole@localhost:~/build/openwrt$ make -j1 V=s package/mtk/mt7622/{clean,compile}
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/crypto-eip/Makefile' has a dependency on 'kmod-tops', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/flowtable/Makefile' has a dependency on 'kmod-nf-flow-netlink', which does not exist
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a dependency on 'libpcre', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/pce/Makefile' has a dependency on 'kmod-mediatek_hnat', which does not exist
WARNING: Makefile 'package/feeds/mtk_openwrt_feed/tops-tool/Makefile' has a dependency on 'kmod-tops', which does not exist
make[2]: Entering directory '/home/ole/build/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ole/build/openwrt/scripts/config'
time: target/linux/prereq#0.25#0.13#0.38
make[1]: Entering directory '/home/ole/build/openwrt'
make[1]: *** No rule to make target 'package/mtk/mt7622/clean'.  Stop.
make[1]: Leaving directory '/home/ole/build/openwrt'
make: *** [/home/ole/build/openwrt/include/toplevel.mk:248: package/mtk/mt7622/clean] Error 2
ole@localhost:~/build/openwrt$ 

And here's the one with the special folder from bricco1981's Repo (also on latest SNAPSHOT):

ole@localhost:~/build/openwrt$ make -j1 V=s package/mtk/mt7622/{clean,compile}
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a dependency on 'libpcre', which does not exist
WARNING: Makefile 'package/mtk/luci-app-mtwifi/Makefile' has a dependency on 'luci-lib-jquery-1-4', which does not exist
WARNING: Makefile 'package/mtk/luci-app-mtwifi/Makefile' has a dependency on 'luci-lib-jquery-1-4', which does not exist
make[2]: Entering directory '/home/ole/build/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ole/build/openwrt/scripts/config'
make[1]: Entering directory '/home/ole/build/openwrt'
make[2]: Entering directory '/home/ole/build/openwrt/package/mtk/mt7622'
rm -rf /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi
rm -f /home/ole/build/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.mt7622_installed
rm -f /home/ole/build/openwrt/staging_dir/target-aarch64_cortex-a53_musl/packages/mt7622.list
make[2]: Leaving directory '/home/ole/build/openwrt/package/mtk/mt7622'
time: package/mtk/mt7622/clean#0.70#0.21#1.17
make[1]: Leaving directory '/home/ole/build/openwrt'
WARNING: Makefile 'package/feeds/telephony/freeswitch/Makefile' has a dependency on 'libpcre', which does not exist
WARNING: Makefile 'package/mtk/luci-app-mtwifi/Makefile' has a dependency on 'luci-lib-jquery-1-4', which does not exist
WARNING: Makefile 'package/mtk/luci-app-mtwifi/Makefile' has a dependency on 'luci-lib-jquery-1-4', which does not exist
make[2]: Entering directory '/home/ole/build/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ole/build/openwrt/scripts/config'
make[1]: Entering directory '/home/ole/build/openwrt'
+ mkdir -p /home/ole/build/openwrt/staging_dir/target-aarch64_cortex-a53_musl
+ cd /home/ole/build/openwrt/staging_dir/target-aarch64_cortex-a53_musl
+ mkdir -p bin lib stamp usr/include usr/lib
mkdir -p /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/stamp
touch /home/ole/build/openwrt/staging_dir/target-aarch64_cortex-a53_musl/.prepared
make[2]: Entering directory '/home/ole/build/openwrt/package/mtk/mt7622'
touch /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.prepared_2f141e4c49b3e6f90d2d20d81c583889_6664517399ebbbc92a37c5bb081b5c53_check
true
[ ! -d ./src/ ] || cp -fpR ./src/. /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi
touch /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.prepared_2f141e4c49b3e6f90d2d20d81c583889_6664517399ebbbc92a37c5bb081b5c53
rm -f /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.configured_*
rm -f /home/ole/build/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.mt7622_installed
(cd /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/./; if [ -x ./configure ]; then find /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/ -name config.guess | xargs -r chmod u+w; find /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/ -name config.guess | xargs -r -n1 cp --remove-destination /home/ole/build/openwrt/scripts/config.guess; find /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/ -name config.sub | xargs -r chmod u+w; find /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/ -name config.sub | xargs -r -n1 cp --remove-destination /home/ole/build/openwrt/scripts/config.sub; AR="aarch64-openwrt-linux-musl-gcc-ar" AS="aarch64-openwrt-linux-musl-gcc -c -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi=mt7622_mt_wifi -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD="aarch64-openwrt-linux-musl-ld.bfd" NM="aarch64-openwrt-linux-musl-gcc-nm" CC="aarch64-openwrt-linux-musl-gcc" GCC="aarch64-openwrt-linux-musl-gcc" CXX="aarch64-openwrt-linux-musl-g++" RANLIB="aarch64-openwrt-linux-musl-gcc-ranlib" STRIP=aarch64-openwrt-linux-musl-strip OBJCOPY=aarch64-openwrt-linux-musl-objcopy OBJDUMP=aarch64-openwrt-linux-musl-objdump SIZE=aarch64-openwrt-linux-musl-size CFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi=mt7622_mt_wifi -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi=mt7622_mt_wifi -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CPPFLAGS="-I/home/ole/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/usr/include -I/home/ole/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/include -I/home/ole/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/include/fortify " LDFLAGS="-L/home/ole/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/usr/lib -L/home/ole/build/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/lib -fuse-ld=bfd -znow -zrelro "   ./configure --target=aarch64-openwrt-linux --host=aarch64-openwrt-linux --build=x86_64-pc-linux-gnu --disable-dependency-tracking --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  ; fi; )
touch /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.configured_27dd583c57e46430539b783eab9bd3fe
rm -f /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.built
touch /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.built_check
make -C "/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-6.6.47" V=0 CROSS_COMPILE="aarch64-openwrt-linux-musl-" ARCH="arm64" M="/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap"  CONFIG_RT_FIRST_CARD=7622 CONFIG_RT_SECOND_CARD=7915 CONFIG_RT_FIRST_IF_RF_OFFSET=0xc0000 CONFIG_RT_SECOND_IF_RF_OFFSET=0xc8000 CONFIG_MT_WIFI=m CONFIG_WIFI_BASIC_FUNC=y CONFIG_MT_WIFI_PATH="7622_mt_wifi"  CONFIG_FIRST_IF_EEPROM_FLASH=y  CONFIG_RT_FIRST_CARD_EEPROM="flash"  CONFIG_SECOND_IF_EEPROM_FLASH=y   CONFIG_RT_SECOND_CARD_EEPROM="flash" CONFIG_MULTI_INF_SUPPORT=y CONFIG_WIFI_BASIC_FUNC=y    CONFIG_DOT11_N_SUPPORT=y CONFIG_DOT11_VHT_AC=y     CONFIG_WIFI_DRIVER=y CONFIG_G_BAND_256QAM_SUPPORT=y CONFIG_BRCM_256QAM_SUPPORT=y CONFIG_ICAP_SUPPORT=y CONFIG_MT_AP_SUPPORT=m CONFIG_BACKGROUND_SCAN_SUPPORT=y CONFIG_SMART_CARRIER_SENSE_SUPPORT=y    CONFIG_HDR_TRANS_TX_SUPPORT=y  CONFIG_HDR_TRANS_RX_SUPPORT=y     CONFIG_WSC_INCLUDED=y  CONFIG_WSC_V2_SUPPORT=y CONFIG_DOT11W_PMF_SUPPORT=y  CONFIG_TXBF_SUPPORT=y CONFIG_IGMP_SNOOP_SUPPORT=y   CONFIG_RTMP_FLASH_SUPPORT=y CONFIG_ATE_SUPPORT=y  CONFIG_UAPSD=y          CONFIG_WIFI_MODE_AP=m     CONFIG_WDS_SUPPORT=y CONFIG_MBSS_SUPPORT=y CONFIG_APCLI_SUPPORT=y   CONFIG_MAC_REPEATER_SUPPORT=y     CONFIG_VOW_SUPPORT=y CONFIG_BAND_STEERING=y        CONFIG_WIFI_MT_MAC=y   CONFIG_MT_MAC=y  CONFIG_SUPPORT_OPENWRT=y  CONFIG_MUMIMO_SUPPORT=y CONFIG_MU_RA_SUPPORT=y      CONFIG_GREENAP_SUPPORT=y  CONFIG_TPC_SUPPORT=y     CONFIG_RED_SUPPORT=y  CONFIG_FIRST_IF_IPAILNA=y   CONFIG_SECOND_IF_EPAELNA=y         CONFIG_DOT11K_RRM_SUPPORT=y                            CONFIG_FIRST_IF_MT7622=y    CONFIG_SECOND_IF_MT7915=y   CONFIG_THIRD_IF_NONE=y    CONFIG_CHIP_MT7915=y       CONFIG_SPECTRUM_SUPPORT=y    CONFIG_MCAST_RATE_SPECIFIC=y       CONFIG_WNM_SUPPORT=y  CONFIG_LINUX_NET_TXQ_SUPPORT=y CONFIG_CHIP_MT7622=y         CONFIG_FQ_SCH_SUPPORT=y CONFIG_BRCM_256QAM_SUPPORT=y CONFIG_VHT_TXBF_2G_EPIGRAM_IE_SUPPORT=y   CONFIG_PCIE_ASPM_DYM_CTRL_SUPPORT=y          CONFIG_MT76XX_COMBO_DUAL_DRIVER_SUPPORT=y modules
make[3]: Entering directory '/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-6.6.47'
  CC [M]  /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.o
In file included from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/include/rtmp_os.h:46,
                 from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/include/rtmp_comm.h:84,
                 from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/include/rt_config.h:34,
                 from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.c:29:
/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/include/os/rt_linux.h:343:9: error: unknown type name 'mm_segment_t'
  343 |         mm_segment_t fs;
      |         ^~~~~~~~~~~~
/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.c: In function 'APStartUpForMbss':
/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.c:904:15: error: unused variable 'phy_mode' [-Werror=unused-variable]
  904 |         UCHAR phy_mode = pAd->CommonCfg.cfg_wmode;
      |               ^~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:243: /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.o] Error 1
make[4]: *** [/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-6.6.47/Makefile:1921: /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap] Error 2
make[3]: *** [Makefile:234: __sub-make] Error 2
make[3]: Leaving directory '/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-6.6.47'
make[2]: *** [Makefile:263: /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/.built] Error 2
make[2]: Leaving directory '/home/ole/build/openwrt/package/mtk/mt7622'
time: package/mtk/mt7622/compile#1.61#0.67#2.96
    ERROR: package/mtk/mt7622 failed to build.
make[1]: *** [package/Makefile:177: package/mtk/mt7622/compile] Error 1
make[1]: Leaving directory '/home/ole/build/openwrt'
make: *** [/home/ole/build/openwrt/include/toplevel.mk:248: package/mtk/mt7622/compile] Error 2
ole@localhost:~/build/openwrt$ 

I've now found a workaround for that, it's using LEDE (I've also compiled that) by some guy on github thats using bricco1981's special folder. Only downside is that it's on an old 5.10 Kernel

And you have an error:

make[3]: Entering directory '/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-6.6.47'
  CC [M]  /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.o
In file included from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/include/rtmp_os.h:46,
                 from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/include/rtmp_comm.h:84,
                 from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/include/rt_config.h:34,
                 from /home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.c:29:
/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/include/os/rt_linux.h:343:9: error: unknown type name 'mm_segment_t'
  343 |         mm_segment_t fs;
      |         ^~~~~~~~~~~~
/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.c: In function 'APStartUpForMbss':
/home/ole/build/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt7622_mt_wifi/mt_wifi_ap/../mt_wifi/embedded/ap/ap.c:904:15: error: unused variable 'phy_mode' [-Werror=unused-variable]
  904 |         UCHAR phy_mode = pAd->CommonCfg.cfg_wmode;
      |               ^~~~~~~~
cc1: all warnings being treated as errors

If you disable werror it will work but you should avoid doing that.

And yes, mediatek lib will work only on openwrt 21.02.

But theres Instructions for SNAPSHOT as well in their instructions

With the method I applied, two devices are required.

If an ethernet cable is connected from the lan port of the device to which the method will be applied to the wan port of the second RB01, and the second device is returned to its factory settings from the button, it is added to the first device in mesh mode (mode 3). So the main device will be in mode 4.

First we will confirm that the device is in netmode 4 from this link.

Login to the router, in another tab use your token with link
...

I followed these steps with a single router, having used jmceleney's method to put the router into netmode 4. Everything in your instructions worked and the final bdata link showed "telnet_en":"1", but when I check the telnet status using the method on the OpenWrt wiki (192.168.31.1/cgi-bin/luci/api/xqsystem/fac_info) it still says false.

Why the discrepancy? Which one do I trust? Shall I assume telnet is on and just go ahead with the OpenWrt install? Or do I need to do something different?

There are two situations where telnet can be used on the device. 1- The device comes from the factory with telnet enabled. 2- By activating and using telnet with this method. The other query you made is used to query whether telnet is enabled from the factory. That result is also correct. Therefore, you can continue with the installation.

Telnet comes disabled on all newer devices, xmir_patcher is the only usable way to reflash those.

1 Like

Ah great, thank you so much.

no it will not, you need that and also fix the funcions for drivers, also fix luci app mtkwifi. i have all done, hope to find some free time soon.

Nice, do you mind putting it all in a Github repo or do you want wo keep it private? If so I could compile on my own in the future and don't have to rely on you compiling images

Hi, @hwole sorry for delay, but a thunder broke my main pc and alot stuff, even my redmi ax3200,that's crazy. I recovered the hard drive,but now i need another pc and another redmi ax3200.sorry i ll do my best.

Oh that's bad to hear. Hopefully you're all good and maybe insurance will cover some of the stuff that broke

EDIT: From googling real quick all appliances that were damaged by the lightning should be covered by the property/home-insurance if you have one

Hi, for those that want MTK builds there is great news.
I wrote an E-Mail to Mediatek regarding the build issues last week and they didn't respond, so I thought they just didn't read.

But they fixed something with mt7622 in they're repo and now it works. So yesterday I've built on the latest SNAPSHOT and tested for 24h before creating a repo with instructions etc.

So for those that want the images or the instructions just look here
Hope that helps

that has nothing to do with mtk drivers, that is mt76.

That could make sense, but I followed the offical Mediatek instructions, i'll have to rebuild tomorrow to verify

can you do iperf in wifi on that build?

Seems like this was a mt76 build, so no mtk drivers. But on that build i had around 750Mbit/s over wifi as the average for the test