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

I think you have to disable the open source driver, otherwise you'll have a conflict. Try disabling Kernel Modules > Wireless Drivers > kmod-mt76

Also, try compiling with the mtk drivers as modules rather than in-built. Let me know if that changes anything.

1 Like

I'm running MTK drivers for several months on self built SNAPSHOT r19309. I've just built it for 22.03.0-rc5 release. You can take it here https://mega.nz/folder/eYFzkCLZ#iVPXwKfTDVCv1HirtduzAg
Install all packages and reboot.
LUCI configuration is at Network -> MTK Wifi
ra0 and rai0 interfaces should be bridged with lan interfaces at Network -> Interfaces -> Devices

6 Likes

Thanks for this mate.

In order for myself and others to be self sufficient so that they can build their own images, could you check over the following procedure and tell me if this is the same as what you did to successfully build your image? Or do I need to change anything in here?

# Disable apt service restart warnings
sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y

# Make build directory
mkdir ~/build
cd ~/build

# Get necessary packages for build
sudo apt update && sudo apt -y install git build-essential libncurses5-dev unzip

# Download and update the openwrt sources
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git pull

# Select a specific code revision
git branch -a
git tag
# git checkout <RELEASE YOU WANT TO USE IN HERE>
git checkout v22.03.0-rc4

# Update the feeds
./scripts/feeds update -a
./scripts/feeds install -a

# Download MTK driver packages and copy into the openwrt build image from https://github.com/MeIsReallyBa/immortalwrt
cd ~/build
git clone https://github.com/MeIsReallyBa/immortalwrt.git

cp -R ~/build/immortalwrt/package/luci-app-mtwifi ~/build/openwrt/package/
cp -R ~/build/immortalwrt/package/mt_wifi ~/build/openwrt/package/
cp -R ~/build/immortalwrt/package/mt7622 ~/build/openwrt/package/
cd ~/build/openwrt

# Download default build config for mt7622
# wget https://downloads.openwrt.org/releases/<REPLACE WITH RELEASE VERSION>/targets/mediatek/mt7622/config.buildinfo -O .config
wget https://downloads.openwrt.org/releases/22.03.0-rc4/targets/mediatek/mt7622/config.buildinfo -O .config


# Configure the firmware image
make menuconfig

# Target Profile > Xiaomi Redme Router AX6S (select AX3200 if you have that)
# Exclude: Kernel Modules > Wireless Drivers > kmod-mt76
# Left MTK drivers as modules, not built-in

Exit and save configuration

# Build prep
make defconfig
make download

# Get the following error message - not sure why this is happening but I've ignored it for the moment.
# make[2] -C package/network/config/qosify download
#    ERROR: package/network/config/qosify failed to build.

# Not necessary to build the kernel seperately?
# Build kernel (I compile over an ssh connection so I use screen as a daemon running in the background to ensure the build continues if I lose ssh. Logs output to screen*.log)
# To connect/view progress: screen -r, disconnect from screen and return to console: ctrl-a then press d
#screen -dmSL openwrt-kernel make -j $(nproc) kernel_menuconfig

# Build the firmware image - DO NOT RUN THIS UNTIL THE KERNEL BUILD ABOVE HAS FINISHED
screen -dmSL openwrt make -j $(nproc) defconfig download clean world

I'm still waiting on my router to arrive but I've built an image from RC5 with the proprietary Mediatek drivers included. Can someone test this out and let me know if it works ok?

openwrt-22.03.0-rc5-mediatek-mt7622-xiaomi_redmi-router-ax6s.zip

1 Like

i did the same for xiaomi mi 4a gigabit and works great I don't know what's the problem with ax3200.

i will test packages provided by "hck" i hope luci mtk wifi config not in Chinese :sweat_smile::sweat_smile:

i will test your build image too and leave you a feedback.

1 Like

thanks for your work :+1::+1:

1 Like

This router looks attractive, easiliy accessible and it seems support exists, so I'd get one and flash OpenWRT - I'm still hesitating because it seems that there's no ax support on the 2 GHz band. Is that correct? Can the owrt image enable it, or is it a HW limitation?

The hardware does not support AX on the 2.4 GHz band.

Thanks, too bad. Gonna wait for AX3600...

installed sysupgrade from original rc5. All seems to work as it should,,,
will keep testing

works on a rb01 wifi open source driver not mtk driver

Thanks for letting me know. My unit should arrive in the week or so but if you want, I can keep trying to build images for testing?

What's the output of sudo lsmod?

Edit: Also, for anyone building, you'll likely encounter the following error compiling qosify:

make[2] -C package/network/config/qosify download
    ERROR: package/network/config/qosify failed to build.

The reason for the error is that it's missing llvm-bpf or there's trying to compile an older version of it from the toolchain. The fix is from the build root:

wget https://downloads.openwrt.org/releases/22.03.0-rc5/targets/mediatek/mt7622/llvm-bpf-13.0.0.Linux-x86_64.tar.xz
tar xvf llvm-bpf-13.0.0.Linux-x86_64.tar.xz
make defconfig

then from make menuconfig

Select "Use prebuilt LLVM toolchain" (deselect other options if they're selected) from Advanced configuration options > BPF toolchain

I've compiled a new build here if you want to test it? If it doesn't work, can you please send me the output of sudo dmesg and sudo lsmod?

openwrt-22.03.0-rc5-mediatek-mt7622-xiaomi_redmi-router-ax6s_v2

Thanks mate. Is that with the v2 firmware or the original firmware?

[openwrt-22.03.0-rc5-mediatek-mt7622-xiaomi_redmi-router-ax6s_v2] (https://mega.nz/file/AZIkEQrB#615hMPNsToQ-8Z3RodHbSe_MzINGf5Z4jwULNeBhJVI)

OK thanks. I think I'll wait until I get my router to do more testing.

v2 it's like mine need l1profile.ipk from "hck" and should works

What have changed?

Do you mean this?

yep tested on your build v2 and works :blush: