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

can post how you compile the packages ? :sweat_smile::sweat_smile:

Are you saying that the build works now and loads the wireless cards? Can you explain what works and if you needed to do anything above and beyond loading the image to get anything working?

This are the steps I took to build the image

# Config changes
#
# v1
# Kernel Modules > Wireless Drivers > kmod-mt7622 - inbuilt
# Kernel Modules > Wireless Drivers > kmod-mt_wifi - inbuilt
# Kernel Modules > Wireless Drivers > kmod-mt76 - removed
#
# v2
# Kernel Modules > Wireless Drivers > kmod-mt76 - unselect
# Kernel Modules > Wireless Drivers > kmod-mt7622 - inbuilt
# Kernel Modules > Wireless Drivers > kmod-mt7915e - module
# Kernel Modules > Wireless Drivers > kmod-mt7615-firmware - module
# Extra packages > l1profile - inbuilt



# 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-rc5

# 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/immortalwrt/package/mt_wifi ~/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-rc5/targets/mediatek/mt7622/config.buildinfo -O .config

# I 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.
# Fix below

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

# Configure the firmware image

make menuconfig

# Target Profile > Xiaomi Redme Router AX6S (select AX3200 if you have that)
# Advanced configuration options > BPF toolchain > Use prebuilt LLVM toolchain
# Kernel Modules > Wireless Drivers > kmod-mt76 - removed
# Kernel Modules > Wireless Drivers > kmod-mt7622 - inbuilt
# Kernel Modules > Wireless Drivers > kmod-mt7915e - changed from inbuilt to module
# Kernel Modules > Wireless Drivers > kmod-mt7615-firmware - changed from inbuilt to module
# Extra packages > l1profile - inbuilt
# Exit and save configuration

# Build prep
make download

# 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 time make -j $(nproc) defconfig download clean world

# Instructions on openwrt installation: https://github.com/mikeeq/xiaomi_ax3200_openwrt

Rc6 is ready

I need to know if my v2 build works. Still unsure based on @ayoub4t 's latest response. If it works, I'll build RC6.

you need to add "l1profile" and "luci-app-mtwifi"

this is from your v2 just install l1profile and luci-app-mtwifi

I have tried updating the latest OpenWrt snapshot image and lowering the 2.4GHz radio power output to 20dB from a month ago and the dropout problem was completely gone (or at least it didn't happen again yet). I also observed that the temperature doesn't have any correlation with the dropouts as my unit was semi-outdoor and the temperature was hovering around 61C. I don't know what causes the problem but updating to the latest firmware helps.

Here's the rc6 build with mtk drivers. Let me know if there are any issues.

openwrt-22.03.0-rc6-mediatek-mt7622-xiaomi_redmi-router-ax6s

Ok, likewise I have not yet worked out the cause. I am currently running rc6 with the power set to driver defaults so I will see what happens.

Hello guys.
So i bought yesterday AX3200 too [RB01 made 09/2011 with telnet enabled].
Everything is fine but i have a question about upgrading system.
I've installed snapshot and snapshot upgrade from "main" AX3200 site and then installed LuCI through console, now what if i want to try Your RC6 build? Do i have to install factory rc6 build first and then upgrade or can I just put upgrade version?

no for commercial purpose but were you find it, it's over a 3 week that i m looking for, but always i found 12/2021 version.

Polish store x-kom.pl

1 Like
#Get source
git clone https://github.com/MeIsReallyBa/immortalwrt.git -b openwrt-18.06-k5.4 immortalwrt
git clone https://git.openwrt.org/openwrt/openwrt.git -b v22.03.0-rc5 openwrt

#Import drivers etc.
mkdir mtwifi
cp -r immortalwrt/package/luci-app-mtwifi immortalwrt/package/mt7622 immortalwrt/package/mt_wifi mtwifi/
cp openwrt/feeds.conf.default openwrt/feeds.conf
echo src-link mtwifi $PWD/mtwifi/ >> openwrt/feeds.conf

#Tweaks
find mtwifi/ -type f | xargs -L 1 sed -i '/brctl/d'
find mtwifi/ -type f | xargs -L 1 sed -i 's/br-lan/none/g'
sed -i -E 's/^(.+?mt7615.)1(.+?mt7615.)1(.+?)$/\11\21\3\n\12\22\3/' mtwifi/luci-app-mtwifi/root/usr/lib/lua/mtkwifi.lua
sed -i -E 's/_\(\"Wireless\"\)/_("MTK Wifi")/' mtwifi/luci-app-mtwifi/luasrc/controller/mtkwifi.lua
sed -i -E 's/WscConfMode=[0-9]+/WscConfMode=0/' mtwifi/luci-app-mtwifi/files/*.dat
sed -i -E 's/WscConfStatus=[0-9]+/WscConfStatus=2/' mtwifi/luci-app-mtwifi/files/*.dat
sed -i -E '/(macaddr|MacAddress)=/d' mtwifi/luci-app-mtwifi/files/*.dat

#Translation
ch=("正在处理,请耐心等待"                        "无线中继"           "中继参数"                   "上级无线SSID" "上级无线信道"      "设置完成后,请回到上级页面点击“连接中继”" "上级无线加密模式"              "上级无线加密算法"     "上级无线密码"      "重启无线"      "保存设置" "重置设置" "无线名称" "加密方式"  "信号强度" "动作"    "配置无线高级设置"         "无线高级设置"            "区域代码"      "无线模式"        "信道带宽"           "2G 40MHZ模式辅助信道"    "范围0到-100,-100最不容易剔除,推荐-85"  "弱信号剔除"             "保存&应用"     "重置"   "无线参数(直接修改无线配置)"                           "警告"    "如果你不了解请不要修改"                            "保存" "你将修改无线参数,确认要修改?"                                     "恢复出厂设置"                         "确认恢复<%=devname%> 至出厂设置?"                                                       "正常模式"    "绿色模式"     "模式" "信道"     "范围"   "默认值"  "无线概况"           "高级设置" "添加SSID"           "添加" "接口"      "停用"    "启用无线"                   "禁用无线"                    "修改无线基本设置"          "基本设置" "删除网络"                   "移除"   "已连接"     "无线中继未连接"                           "未连接"       "上级SSID" "连接中继" "断开中继"    "修改中继参数" "中继设置" "加密"       "算法"          "密钥更新时间"          "密码" "隐藏 SSID"   "隔离客户端"    "WMM 模式"     "强制发射速率 ( 0为自动,建议值 )" "扫描网络"               "类型"  "中继" "状态"    "启用"   "禁用")
en=("Please waiting while the page is loading" "Wireless Repeater" "Connection Configurations" "Root AP SSID" "Root AP Channel" "This will overwrite ap channel"       "Root AP Authentication Mode" "Root AP Encryption" "Root AP WPA Key"  "Restart Wifi" "Save"    "Reset"   "SSID"    "Security" "RSSI"    "Action" "Configure Wi-Fi device" "Device Configurations"  "Country Code" "Operating Mode" "Channel BandWidth" "2.4G 40Mhz Ext Channel" "range 0 to -100, -85 is recommended" "Weak Signal Rejection" "Save \& Apply" "Reset" "Raw Configurations ( Edit WiFi profile directly )" "WARNING" "DO NOT MESS WITH IT IF YOU DON'T UNDERSTAND IT" "Save" "You are going to overwrite the profile directly, are you sure?" "Restore Profile to Factory Setting"  "You are going to reset the profile of <%=devname%> to factory default, are you sure?" "Mixed Mode" "Green Field" "Mode" "Channel" "range" "default" "Wireless Overview" "Config"   "Add Wi-Fi network" "Add" "Interface" "Disable" "Enable this Wi-Fi network" "Disable this Wi-Fi network" "Edit this Wi-Fi network" "Config"  "Delete this Wi-Fi network" "Remove" "Connected" "Wireless is disabled or not associated" "Disconnected" "SSID"     "Reload"  "Disconnect" "Config"      "Config"  "Auth Mode" "WPA Algorithm" "Key Renewal Interval" "Key" "Hidden SSID" "AP Isolation" "WMM Capable" "Force TX Rate"                "Scan Wireless Network" "Type" "STA"  "Status" "Enable" "Disable")
for l in {99..1}; do
    for i in ${!ch[*]}; do
        if [[ ${#ch[$i]} -eq $l ]]; then
            find mtwifi/luci-app-mtwifi/ -type f | xargs -L 1 sed -i "s/${ch[$i]}/${en[$i]}/g"
        fi
    done
done

#Build
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
wget -O .config https://downloads.openwrt.org/releases/22.03.0-rc5/targets/mediatek/mt7622/config.buildinfo
make menuconfig
#mark "M" Kernel Modules -> Wireless Drivers: kmod-mt7622, kmod-mt_wifi, LuCI -> Applications: luci-app-mtwifi, Extra Packages: l1profile
make -j $(nproc)

#Packages in ./bin

You can install rc6 sysupgrade version and it would be fine. Of course, make a backup first.

Had issues with wifi. Device not associated.
Reverted to official openwrt

Thanks, I'll hopefully get my router this week so I can get this working properly.

Stand-alone MTK drivers for rc6 https://mega.nz/folder/eYFzkCLZ#iVPXwKfTDVCv1HirtduzAg

How can we install these drivers?

@SparkyDan555 I seem to have somewhat similar experience to adzil, in which, changing\upgrading firmware may solve this.
Last post I said I'm trying to go back to stock, to check if the the complete crash issue I had with it originally would still happen.
It still happened but, less frequently. the router would last longer before the crash.
So I decided to try again on openWRT (rc4) and so far its running 9 days without issue.
one thing that has changed in my network, I moved my LG TV from using wireless to wired.

Do you know how to change the "Generic Mediatek mt7615.1.dat" and "Generic Mediatek mt7615.2.dat" to more meaningful names such as Mediatek MT7622 2.4GHz and Mediatek MT7915 5GHz?

Received my AX6S today.

Working RC6 build with in-built Mediatek drivers here:

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