Xiaomi mi wifi 3 support

it has been a long time. too much going on in the thread and havent really caught up.

i am interested in bringing official "xiaomi mi router 3" support in the latest master branch of openwrt.

here is my current cloned branch: https://github.com/thanasxda/openwrt

the only commit i could find regarding the device is on the x-wrt fork:

tried simply cherry-picking but probably due to changes in firmware isnt compatible.

if anyone is interested to help i would like to add official support for this device on openwrt.
if this already happened by someone please let me know and show me your sources :slight_smile:


(it does run fine on x-wrt fork, as im currently running it on my mi router 3)


after experimenting in source and finding a somewhat compatible device tree i experimented and modified the source and finally managed to output an image without compilation errors. thinking that if id manage to brick the router id still be able to recover with a serial adapter. i flashed the sysupgrade only (coming from x-wrt) which under normal conditions should work with a regular working image. however after flashing this sysupgrade now i get no serial console output anymore. is there some kind of chance due to the nand patches somehow the bootloader could have been wiped by a sysuprade?
furthermore i also have a jtag adapter is there anyway i could pin it to the nand chip and reprogram it?

as a worst case scenario if it didnt work on the openwrt source itself i was planning to create a modified version of x-wrt to resemble openwrt more or less. if anyone is interested the custom defconfig is usable on the source, however do not flash the images created for the mir3 by my source as you can tell from above.

however i do have a fake prolific serial chip which sometimes has issues, when i looped tx and rx onto itself i could type as a test. furthermore i have tried holding the reset button with a plugged usb having miwifi.bin stock firmware and it does blink orange till now. this could mean the bootloader is still intact? its been a while since i tinkered with this device i dont remember anymore.

its not blinking actually its more like a pulsating orange led. this happens when i plug it on while holding reset with or without a usb stick in the router. furthermore if i do the same while having serial connected nothing happens. the router on itself as long as serial isnt connected shows a short loop of purple led while booting for a second then orange for 2 seconds and repeat if i dont do anything to it.

update: turns out pandorabox bootloader was still fine. flashed the factory-breed image and recovered. for now i will release a modified image preferably on 5.4 testkernel of x-wrt for whoever is interested.

strangely enough i just found out i get this exact issue on x-wrt on a custom build with more or less exactly the same defconfig which i had used on openwrt which worked on the mi wifi mini with openwrt appears not to work with x-wrt on the mir3 one change of which the 5.4 testkernel.

hello, x-wrt working on my Mir3 but 2.4ghz band is so weak. Its going disappear for no reason and only gives 5 mbps at speedtest

my throughput on mir3 using x-wrt is fine. but then again i cannot compare how the range should be since im using two 9dbi omni antennas for 2.4ghz on the mir3.

furthermore concerning openwrt. most probably it is the defconfigs fault why it didnt boot after importing the mir3 device tree. im still at it but could use some help since my pc isnt the fastest in compilation.

x-wrt custom compilations boot now however no matter what i ty the 5.4 kernel doesnt get enabled using x-wrt on mir3 unfortunately.

theres no commit in source for the original defconfig used by x-wrt buildbot to show up in /proc/config.gz or something. does anyone know how i can get the config they use for wrt?

Hi, here are settings for X-Wrt, 2.4GHz wifi, from 4pda forum user 'kasper145'.
He got from 40 to 70Mbps. He found that problem lies is "Maximum transmit power" setting. Some dBm settings does not work well (26 and 28 works well). Also try changing channels, maybe your neighbors use the same.

If nothing works post to X-WRT creator feedback here: https://github.com/x-wrt/x-wrt/issues/79

1 Like

Hi, just as a warning (and some questions) if anyone is planning to buy this device for custom firmware.

  1. OpenWRT is NOT officially supported for this device. It has been 2 years without any updates, and most likely will continue until someone can resurrect it (which....looking at Xiaomi devices so far, if it doesn't, it doesn't).

  2. PandoraBox has been shut down by the Chinese government (or so I heard) and is pretty much dead, but seems to be picking up speed little by little. However, the last release targeting this device is 19.01, which is more than a year ago. The latest release, 19.02, appears to NOT target this device, and hence the future is uncertain.

Can someone confirm whether this is working, stable, and if not, what stable release have you used, and recommend the community to use?

  1. X-WRT, another fork, is having some serious issues regarding the stability on BOTH 2.4Ghz and 5Ghz as seen in #52 on its GitHub. The issue has been going on for 9 months, and appears to have no solution for now.

Can someone let us know which X-WRT is considered stable for the community to use?

Also, can we apply this: Smartphone USB Tethering to an OpenWrt router using PandoraBox, X-WRT, and Padavan?

Thank you.

my experience with x-wrt despite of the issues you mentioned has been really good. on openwrt normally i need to install some extra packages to get good throughput. in case of x-wrt on mi3 i have been running it ever since it was supported. however i did experience issues of source not always being able to compile an image and have had trouble even building off of their buildbot used defconfig at times it worked at other times it didnt, despite of checking out at certain release tags.

im not sure but i think their breed boodloader uses pandorabox bootloader in case of a brick you simply switch your router to recovery mode and can access it always through to directly flash an image so there would be no need even to go back to stock through usb and do that whole process all over again or even use a serial adapter once youre on that. all over im very pleased.

as we speak i updated both miwifi mini and mir3 which are the same hardware part from storage, to their latest published release as i usually do and all continues to work for me.

you could also try if you have no issues compiling now and then like me, enabling option "HAVE_TESTINGKERNEL" or something like this to switch to kernel 5.4 and checkout how that works for you. all over i have to say they also are very prompt with upstreaming, at least their kernel patchlevel is quite ahead compared to openwrt last time i checked.


Go for Padavan if u want the best wifi performance and stability, even better than stock firmware.

1 Like

btw my mistake with compilation issues. when i downloaded their tags without messing with scripts/feeds all worked like a charm

Thanks for your suggestion.

Hmm I checked Padavan, but their installation seems to not mention anything about "Enabling Write to Console" or "Get SSH/dropbear access" which is found in the OpenWRT MIR3 wiki

If I may want to revert to stock in the future, is enabling write to console & get ssh/dropbear access necessary before I flash Padavan?

EDIT: Also, does any of the custom roms support WPA3? Seems like OpenWRT 19.07 already supports it.

No, the prometheus script will do everything for u...all u need to do is flash the old dev firmware, reset it and set password then do the prometheus script thing..the script will do every trick automatically what the wiki has. @templeIsland2

1 Like

Are there newer versions of padavan or how can you update the version after the first installation of padavan? What's the way back to original or openwrt?

To revert back to stock, there's a section on the wiki describing how to do it https://openwrt.org/toh/xiaomi/mir3.

If the Prometheus script really does enable SSH & dropbear access, then stock reverting should be exactly the same.

I'm curious though, I'm using stock ROM, and only get 2Mbps/5Mbps DL/UL out of repeater mode (from the 50Mbps UL/DL internet I have). If I flash custom ROM, will it improve?

EDIT: Also, Padavan has not been updated for 2 years. Looks like its time to move on from my brand new device haha. I think I'm going to resell it and buy a new one. Does OpenWRT has a "abandoned" banner available for devices that are abandoned? Otherwise more users might buy this device and instantly regrets it.

Don't, that is a unique piece of hardware. Asus/Netgear will ask u double for the same hardware. I bricked mine over an year ago and can't find it anywhere bcoz xiaomi don't make it anymore. @templeIsland2

Hi everyone I am trying to unbrick my xiomi mi router 3, and I try using hyperterminal putty(windows) cu, minicom on linux, and I can send the number and another thing is so fast to try to press some number, could you help me? thanks in advance I read this post Bricked Xiaomi Mi WiFi Router 3. Stuck in infinite loop but didnt work for me

U-Boot1.13(Apr 15 2016 - 7:6:3)

Board: RalinkAPoC RAM:  128 MB
owr o mmory test. emoy ize 128 MB...OK!
rloatecode Pointer t: 7f8000
enableeph lock.done.rf reg 29= 
!! nn pag ize = 2048,add ln=4
Ralnk Bot Vrsion: 4.2.S.1
AIC762_MP (Port5<->Nne
RAM_CONF_ROM: ut-deecion 
DRAM componnt: 04 Mbts
Total meory: 2 MBye
Flash componet:NAN Flash
dcche: sets:256,was:4 inesz:3 ,total3268

 stmat memorysize 128Mbtes ### 

lase coose the peatin: 
   1: Lod ystm ode to DRAM vi FTP 
                                     2: Load sysem od then writ toFlsh iaTFTP. 
   3:Boo sste code via Flah defult).
   4: ntrbot ommand line intrace
  9 Load Boo Lode code then write t las via TFTP.

: ystem Boot sysem od via Flash.
Botig ystm 2
..raanders_write: offs4000,count:20000
## otingimage at bc60000..
  Imge ame:   IPS Oenrt inx-4.14.89
   Data Size:   59367 Bytes =  . M(lzma cmpessd)
  Lad Address: 800000
  Entry Point: 800000
.........................  Veifyng Checksm .. O
  Uncompresin Kere Imae ... K
                             comandline uart_en= actoy_mde=0 mem=12m
                                                                    No nitrd
# Tranferin cntrol to Liux ataddess80000000) ..
                                               ## iving linux memiz inMB, 128

Statin krnel ...

[   0.000000 Liuxversion 4.14.89(aor@bntu) (gcc versin .3. (OpenWrt GCC .3. r365-95daf4c441)) 0 Te ec 18 17:25:50 01
[  .000000] Boad hs DR2
[    0.0000] Aalg PU set to h cntrl
[    0.00000]Digtl PMU set to hwcotro
    0.000000]SoCTye: MediaTekMT62A vr: eco:6
    0.000000]Linx erson 4.14.89 (aorubntu) (gcc version7.30 OpenWrt GCC 73.0r765-5da4c441)) # Tu Dc 18 17:25:50 2018
                                                                                                                       0.00000] Boar ha DR2
                                                                                                                                           [    0.000000 Aalo PMU set to h conrl
    .000000] iita PU set to hwconro
[   0.00000] oC Tp: MediaTek MT7620Ave:2 co:6
[   0.000000] Linx erson 4.4.89 (ado@bunt) (gcc versio 7..0(OpnWrt CC 7.3. r36595af4c441)) #0 Te ec 8 17:25:0 201
   0000000] Board hs DR2
                        [    0.00000] Aalg MU se to hw cotrl
    0.000000]Digta PM set to hw cotrol
                                          0.000000] SoC yp: MdiaTek MT7620 ve:2eco6
[   .000000] Liu vesin 4.14.9 (adorubntu (gcc version7.3. (penrt CC 7.3.0 r36-95af4c441) #0 Te Dc 1 17:25:50 2018
[   0.000000] Anao PMUset t hw conrol                                                                            [   .00000] Board ha DR2
[   0.000000] SoC Tye:MeiaTek MT720A vr: ec:0000] Diial PUset to w contrl
[   0000000] Linuxverso 4.14.89 (ador@ubut) (cc versin 7.30 OpeWt GCC 7.3.0 r735-5df4c441)) #0 Tu Dc 1 1:25:50 018
[   0.000000 Anlo PM st to hw contrl
   0000000] Digita PM st to hw conrl
[  0.00000] SoC Typ: ediTk MT7620A ver: ec:6
                                            [   .000

Really? But isn't WPA3 coming out (like in OpenWRT 19.01)? Kinda pointless to keep it if the device doesn't support WPA3 officially nor unofficially though. Its a shame Xiaomi decided to go with a crippled U-Boot that restricted a lot of modding capabilities, or we really have a great device.

Also, the router repeating capability is quite bad (on the official firmware), I've only managed 2Mbps (from 30Mbps direct) even under extremely close distance, which is impossible for anything other than light browsing. Can I expect something better with unofficial firmware though?

is it possible to share build scripts for 19.07.3 ?

Hello everyone!

I started hunting for something for the Xiaomi Mi Router 3 because I would like to use its USB port for access via NFS, but the X-WRT does not have it built in.

Apparently the X-WRT maintainer tried to include official support through this PR: https://github.com/openwrt/openwrt/pull/597

If you install the newest version of X-WRT you will see that the kernel used is 5.4.61: Linux X-WRT 5.4.61 # 0 Sat Sep 5 18:58:19 2020 GNU / Linux mips

And even several packages are updated. So it works, but I don't know why the support doesn't exist.

Guys, we don't need to invent the wheel. Execute further commands in Linux:

git clone git://git.openwrt.org/openwrt/openwrt.git openwrt-mir3
cd openwrt-mir3
./scripts/feeds update -a && ./scripts/feeds install -a
git rev-parse --short HEAD

Put mir3-support.patch to git cloned openwrt-mir3 directory

patch -p1 <mir3-support.patch 
make menuconfig

In menuconfig select:
Target System (MediaTek Ralink MIPS)
Subtarget (MT7620 based boards)
Target Profile (Xiaomi Mi Router R3)
and Luci and whatever packets you want, NFS or other. Than click save, push Enter and exit menuconfig.

make -j5

After half an hour you will find your build firmware in "bin" directory.

Or you can try prebuilt firmware link
How to install/flash link
Just know, that by default after you install firmware, wifi is disabled and Luci service is not started.
So you must connect through LAN, SSH to using Linux or Putty, make password for Lucy, start Luci service, enter web interface, start wifi, set wifi password.
Information taken from Link

ssh -root@

BusyBox v1.31.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 OpenWrt SNAPSHOT, r14390-7716a43092
root@MiR3:~# cat /proc/cpuinfo 
system type		: MediaTek MT7620A ver:2 eco:6
machine			: Xiaomi Mi Router R3


There is no official MIR3 OpenWrt support, because of the copyright of NAND driver code for this device and will not be probably.


I will like to try flashing prebuilt image,any flashing tips? (Steps). Can u please share some info.