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

Thanks, will do.

I have two RB01's (11/2021).

By default the device comes in netmode:0, so the method failed.

Master device became netmode:4 when other device was in mesh mode. The other device, meanwhile, became netmode:3.

Also in netmode:3 the method failed.

Telnet was activated without any problems. (netmode:4)

So, method succeeded only when netmode is 4.

1 Like

And write in more detail how you switched the device to whc_cap mode (4).
I will add this to the instructions.

1 Like

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

http://192.168.31.1/cgi-bin/luci/;stok={token}/api/xqnetwork/get_netmode

If result is {"netmode":4,"code":0} proceed;

Note: Only use this method when the router is connected to the computer via ethernet connection. Because wifi connection will not be available from the first command, when you restart after the 3rd command, wifi connection will be fixed. After the procedure is complete, I recommend that you reset the device back to factory settings.

1- Login to the router, in another browser tab use your token with link;

http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3B%20zz%3D%24%28dd%20if%3D%2Fdev%2Fzero%20bs%3D1%20count%3D2%202%3E%2Fdev%2Fnull%29%20%3B%20printf%20%27%A5%5A%25c%25c%27%20%24zz%20%24zz%20%7C%20mtd%20write%20-%20crash%20%3B%20

Link returns with result {"code":0}

Restart the router from the interface

2- When the device is turned on login to the router, in another browser tab use your new token with link;

http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3B%20bdata%20set%20telnet_en%3D1%20%3B%20bdata%20set%20ssh_en%3D1%20%3B%20bdata%20set%20uart_en%3D1%20%3B%20bdata%20commit%20%3B%20

Link returns with result {"code":0}

3- After this, open another browser tab use same token (used in the second step) with link;

http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3b%20mtd%20erase%20crash%20%3b%20

Link returns with result {"code":0}

Restart the router from the interface.

After reboot check the result with the link;

http://192.168.31.1/cgi-bin/luci/api/xqsystem/bdata
{"ssh_en":"1"..."telnet_en":"1"..."uart_en":"1"...}

Enabling telnet on second device;

First you need to factory reset both devices. You need to start the process again by assuming the device to which the procedure will be applied as the first device, telnet enabled device as the second device.

After resetting the device to factory settings, power on both devices. Skip the initial setup screen only in first device, after connecting the first device's lan port to the other device's wan port with ethernet cable it will become netmode 4 in five seconds.

After the all process is complete, factory reset both devices.

6 Likes

Hi @hck - https://github.com/MeIsReallyBa/immortalwrt.git doesnt seem to exist? Did you mean https://github.com/MeIsReallyBa/immortalwrtmt7622 ?

If using immortalwrtmt7622 build seems to fail with:

openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt_wifi/mt_wifi_ap/../mt_wifi/os/linux/rt_profile.c:43:10: fatal error: net/ra_nat.h: No such file or directory
   43 | #include <net/ra_nat.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

XMiR-Patcher: https://github.com/openwrt-xiaomi/xmir-patcher

Download: https://github.com/openwrt-xiaomi/xmir-patcher/archive/refs/heads/main.zip
Unzip xmir-patcher-main.zip into any directory.
Reboot your router before using these scripts.

  1. SSH activation via 2 clicks:
    Run file !START.bat (on *nix run python menu.py ).
    Follow the menu items: 1, 2
    Result: SSH is active (login: root and password: root)

  2. Flash OpenWrt factory image:
    Download OpenWrt factory image (AX6S) and copy into directory ...\<XMiR_DIR>\firmware
    Run file !START.bat (on *nix run python menu.py ).
    Follow the menu items: 1, 2, 7
    Result: flashed OpenWrt factory image.

These scripts working only with RB01, RB06, RB08 !!!

10 Likes

Yet another success story for AX3200/RB01.
BusyBox v1.25.1 (2021-08-07 08:04:56 UTC), and 1.0.35 FW version. Meaning I received the ultimate medium for openwrt.
Thank you for the detailed instructions, mikeeq!

Does this mean that I will be able to install OpenWRT without the UART method on RB01 routers?

Of course, I activated telnet to 4 devices (RB01) in this way without any problems. After this method, you can install the Openwrt firmware on the device with the telnet method. It is installed without any problems with the factory file of the v22.03.0 version. Do not install RC versions as in the manual. Just don't start the Openwrt installation without activating the telnet connection of the two devices.

Thank you for the reply! I will check it out and report back when I have it enabled on my RB01 devices. Can't wait! :slightly_smiling_face:

Update: Using your method, I have both of my routers RB01 running on OpenWRT 22.0.3 stable. Thank you so much for the detailed instructions!

Also, is there a way to set up a wired mesh like in the stock Xiaomi firmware or guides to run two routers connected via LAN for a wired backhaul setup? I’ve seen tutorials for dumb APs but I can’t seem to get the 5Ghz network to work correctly.

You're welcome. I think minor issues will be fixed over time. You can also try MTK wifi drivers. There is a comparison of both in this post, I think it will be useful for evaluating the differences between them.

https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/875

Thank you, it’s a helpful post. I’ve got it to work now, so far it’s been running great, appreciate the reply! :slightly_smiling_face:

To update on my earlier post about the wifi drivers -- I've switched to the proprietary drivers again. I still need to test on the stable release, and compare settings -- but I had issues with very slow speeds (~1 mbit) on certain devices when the signal was low/medium. Members of my household were unhappy, and the proprietary drivers fixed that.

The primary reason I preferred the open source drivers is support for FT over DS with 802.11r. Basically it would let me walk through the house without interruptions of video calls. I've found that this actually works reasonably well with the proprietary drivers, despite the "lag" you'd get from another handshake. It does help to instruct the clients to start roaming around -75 dB (rather than the default -85 dB).

Did anyone already create a working script to compile the 22.03 stable with proprietary MTK drivers? I have something in the works, but other priorities came up.

just grab the folder mtkwifi and put it in the openwrt/package that's all.
./scripts/feeds update -a
./scripts/feeds install -a

Grab it from where @bricco1981 ?

get luci-app-mtwifi, mt7622 and mt_wifi folders

1 Like

Hmm, I've tried from multiple repos (that one as well) and got the same result as I reported in this post: Adding OpenWrt support for Xiaomi "Redmi Router AX6S"/"Xiaomi Router AX3200" - #937 by spwnrpe

My build env is a clean/new VM (Ubuntu 22.04), whats yours? If it works for you?

are you sure you add only the folders i just say?

i use debian

Yes Sir, simply put:

  1. New Ubuntu 22.04 Server VM

  2. Install build tools

  3. Clone OpenWRT 22.03 and (some other) repo containing mtkwifi/mt_wifi

  4. Copy the three folders from mtkwifi/mt_wifi to openwrt/package and update/install feeds

  5. Build