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

Flashed immortalwrt with closed wireless driver. Performance is really amazing.

Hope to have this driver or something like that on openwrt

telnet still disable.now asking my fellow countrymen who own rb01/rb03 telnet enable to swap with mine

1 Like

You could also try to contact the Xiaomi support (service.global at xiaomi.com). I wrote them today:

Hi,

we like to use Xiaomi Access Points for Wifi infrastructure projects. However the Stock firmware does not allow to do so. So we need to flash upstream OpenWRT on the devices instead your modified vendor firmware image.

However on the latest model (AX3200), the firmware update page of the stock firmware doesn't accept OpenWRT images. I would like to ask you to provide an easy way to flash upstream OpenWRT on your devices. For instance, this is easily possible with competitive Wifi Routers to AX3200 like the Belkin RT3200 or Linksys WRT3200.

I would be very happy if you could forward my request to the corresponding development department.

Hope hearing from you soon.

Exact model:
1. Product Name: XIAOMI Router ax3200
2. Model: RB01
3. System Version: 1.2.7
4. Description of Fault Symptom: When I try to update to the latest OpenWRT version, the FW-Update-File is not accepted.
5. Snapshot of Fault Symptom: Not applicable
6. Country: GERMANY

Short description: Please provide a simple way to update the stock system to OpenWRT since then we could use your AP for rolling out our Wifi-Infrastructure.

Further information:
forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200

2 Likes

did you build on your own or there is some build existing already?

Install Immortalwrt ... see

All in Chinese, you may need translation.

compile these things into openwrt directly
Notice:

  1. You need to cancel the compile option of the mt76 open source driver first
  2. Add mtkwifi reload to the startup script

Drivers code comes from here:https://www.downloads.netgear.com/files/GPL/WAX206_V1.0.4.0_Source.rar

1 Like

Immortalwrt_Xiaomi_AX6s

2022-3-14 Release with some fixes

Does anyone of you know of better ways to contact Xiaomi? The mail support (service.global@xiaomi.com) seems only to be "customer calming"

Dear Sir/Madam,

Hello, Greetings from Xiaomi Customer Support! This is Ida. 

We at Xiaomi value your trust and we apologize for the inconvenience. Rest assured that we'll assist you on this.

Thanks for your valuable suggestion. I will record this as your feedback and surely will share your valuable feedback with our concerned authorities.  

We hope the above information helps you.

Best Regards

Xiao Mi Global Email Service

If you have any other questions, welcome to visit again. Always believe that something wonderful is about to happen! 

Here's the reply I got:

Hello,Greetings from Xiaomi Customer Support!This is Cassie.

Thank you for your support and love to Xiaomi. 

Thank you for sharing your feedback with us.            

According to you wants to flash upstream OpenWRT, I would inform you that as of now we don't have any official information regarding this. Hence, we would not be able to assist you accordingly. However, I will record this as your feedback and surely will share your valuable feedback with our concerned authorities,  our technical staff will further process and optimize the product accordingly.

Till the time, please have some patience and wait for the update.

We would appreciate your patience and understanding.

Best Regards

Xiao Mi Global Email Service

If you have any other questions, welcome to visit again. Always believe that something wonderful is about to happen! 

If you have any feedback or suggestions for us, please send an email to Xiaomi VOC (complaint-to-mi@xiaomi.com), we will value it and continue to improve our Customer Care.

Follow Twitter@XiaomiSupport to get latest product tips and service information. https://twitter.com/XiaomiSupport```
3 Likes

Cool, I hope for the best :slight_smile:

In my experience, the wifi is pretty solid and I'd really like to see some comparisons with stock and/or immortalwrt. Do they comply with regulations? Since both are for china mainland usage and china allows for at least 3 more dbm in UNII2 and 3 which essentially is double the power (200mw vs 400mw in unii2 and 400mw vs 1000mw in unii3)
You can get these numbers in openwrt if you set your country to China but then you are breaking the law.

I got my AX6S delivered today (RB3). The 1.2.7 as expected enabled telnet, and I followed the instructions posted here (which is of course the same as the github commit here)

The nvram values all set appropriately, I got the "factory.bin" in the /tmp directory and ran mtd -r write factory.bin firmware

After the reboot, the Xiaomi firmware was the one that was booting. I thought I made a mistake so I tried 2 more times, both with the same result.

At this point I decided to also try writing factory.bin to firmware1. The router came up with openwrt.

From Luci I decided to do a reset just to be sure. The router didn't come back up.
I connected UART, and noticed that the boot menu gives options to start from firmware0 firmware1, and "firmware selected by Xiaoqiang".

The default is the latter, which dies ouit due to (I believe it was) bad checksum. firmware1 doesn't load either (I believe it's the same error, leading me to believe they point to the same), firmware0 loads correctly.

I changed the "boot_auto=bootxq" to "boot_auto=run boot_rd_ig;bootm" so that the device starts up without UART.

I'm positive that I did something wrong, but it also feels like there's something missing in the instructions. e.g.: Is there a flag that says which is the active stock firmware partition based on which the other should be flashed? Or something along those lines?

Given that my device is up and running as is, do I just leave it as is, or is there anything I should do to the other partition (I believe firmware1?) from UART?

Thanks,

PS. The flash method in the main openwrt git's PR (the top/original post) is showing the old instructions.


EDIT: A post above by @Timbo resolved it.. Had to get back into UART to update boot_auto back to what it was initially (bootxq), and set the value of boot_fw1 appropriately for openwrt AX6s.

This should be added to the instructions: nvram set "boot_fw1=run boot_rd_img;bootm"

Still unsure whether there's a need to flash both firmware as well as firmware1 though.

Which image did you use? The latest images will drop firmware1 partition after the initial writing.

I’m guessing that it’s because it was out of factory booting to fw1.

So flashing (the latest image) to firmware didn’t “do anything” because it would just go back to the non-flashed firnware1 Xiaomi partition, given the missing nvram set command in the instructions to point boot_fw1 to boot_rd_img.

The failures after that (once OpenWRT was “installed”) was because firmware1 was gone, but uboot was still trying to boot from there.

In short, the missing nvram set is important. :slight_smile:

1 Like

The instructions still need some "refining" and updating on the wiki, which will no doubt come as things progress, the unit becomes more popular and the RB03 changes get merged into the master snapshot.

hei i too just got the router from china (rb03 variant), and tried these instructions on the git repo over here

so as of now i am not having UART adapter,
so dont want to kill the router

so executing these instructions
nvram set "boot_fw1=run boot_rd_img;bootm"
before flashing the factory.bin firmware will do the trick is it?

thanks

@mikeeq instructions are amazing. It’s basically a line by line recipe.

The only question/thought is why make the two commented out nvram set items an “if”:

# Set NVRAM flags
## Run also first commented two lines if after flashing sysupgrade.bin image router restarts to stock firmware instead of OpenWRT
# nvram set flag_boot_rootfs=0
# nvram set "boot_fw1=run boot_rd_img;bootm"
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit

And in that case, does it make sense to make the generic instructions flash both firmware partitions?

# Flash image
mtd write factory.bin firmware
mtd -r write factory.bin firmware1
1 Like

Not with the latest images, you'll definitely kill it. Basically, writing the first factory.bin overwrites the last several partitions and makes 2 new ones - kernel and overlay. If you do the second write, it'll write in place of the overlay partition and corrupt it.

Another note is, you can't do a mtd write -r factory.bin firmware after you do it once, as there is no more partition called firmware.

The rest of the steps is on point.

You do need the nvram set "boot_fw1=run boot_rd_img;bootm". I'm not sure why it is commented out. (Maybe the instructions still refer to an older image layout). If it is not set, the boot system will not be able to boot openwrt. You'll either need to recover to stock or connect to uart to manually select the partition to boot.

To reiterate dekomote's message... Do not do mtd write on firmware1 with the latest images. If you've read the entire thread, you'll see I had some specific issues. I think it was writing to firmware1 that actually caused my issues.

As with any flashing activity, be prepared to recover to stock either using the xiaomi recovery tool or setting up a tftp server. Mikeeq's recovery instructions should work. I found recovery to stock very reliable. As long as you are only touching the firmware partition and nothing else, recovery should work.

2 Likes

Makes sense.

In my case, having missed the post about nvram set "boot_fw1=run boot_rd_img;bootm (but having seen the fw1 one :frowning: ), I ended up flashing both.

I could be wrong about this (and I don't recommend it), but potentially it was fine in my case because the compiled image was smaller than the firmware and firmware1 partitions.

So basically I flashed firmware partition, it didn't update the partitions as it didn't boot from it. I flashed both firmware and firmware1 (no reboot in between), at which point it did start openwrt's factory flash, which repartitioned the layout, removing firmware and firmware1.

My layout as I type this:

root@AX6S:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "Preloader"
mtd1: 00040000 00020000 "ATF"
mtd2: 00080000 00020000 "u-boot"
mtd3: 00040000 00020000 "u-boot-env"
mtd4: 00040000 00020000 "bdata"
mtd5: 00080000 00020000 "factory"
mtd6: 00040000 00020000 "crash"
mtd7: 00040000 00020000 "crash_log"
mtd8: 00400000 00020000 "kernel"
mtd9: 06f00000 00020000 "ubi"