Xiaomi Mi Router 4A Gigabit Edition (R4AG/R4A Gigabit) -- fully supported and flashable with OpenWRTInvasion

Hi all,

Any idea when the firmware will be part of stable x.x.x and no more from snapshots?

Thank you

hi , i have the Xiaomi MIR4AG gigabit model , but mine has chinese firmware 2.28.65 ,
and i see that all the talk is about 2.28.62 - 2.28.132 - 3.0.24 , i already gained access to the router using acecilia/OpenWRTInvasion , should i flash your 19.07.7-1.5.2 firmware, or should i upgrade or downgrade to one of the tested spoken about firmware in this forum ?
does me having this 2.28.65 firmware affect anything , is the uboot similar ?!

First of huge thanks to people here for the great work!

I recently got my Xiaomi Mi Router 4A Gigabit Edition - international version. Exploit worked fine. I played around with some firmware builds (now using a snapshot build and so far so good). During my tests, I had to debrick the device. Thanks again to @hoddy for the great guide.

Only issue I encountered: @hoddy method stresses: use English firmware for Int router and Chinese for orig.Chinese version.
For me: the other way around worked: Using INT firmware: Router took the firmware (log showed ..test.bin B:0 T:0) but then the lights started hectically blinking white. (waited and retried).
Then I had another try with the Chinese firmware (I believe hoddy packs 2.28.62 in the test.bin). Router took it. Lights blinked yellow and after some time blinked blue and I had a fresh Chinese version Router 4A Gigabit!

PS: I am quite sure - I bought an international Version. It had English 3.0.9 firmware (sorry made no backup; and also I did not upgrade stock firmware). Packaging has multiple European languages on it.

Also after the OpenWRT flash here is the result of cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "Bdata"
mtd3: 00010000 00010000 "factory"
mtd4: 00010000 00010000 "crash"
mtd5: 00010000 00010000 "cfg_bak"
mtd6: 00100000 00010000 "overlay"
mtd7: 00e80000 00010000 "firmware"
mtd8: 0023e5e4 00010000 "kernel"
mtd9: 00c41a1c 00010000 "rootfs"
mtd10: 00930000 00010000 "rootfs_data"

Thought I'd let you know and best regards.

1 Like

All fine, you can use my 1.5.2 firmware as it can access the official software repository.

My uboot will work fine as well.

Might have been an issue with my tool for the international version, though I'm not sure. Someone recently reported that the int tool wasn't working so I've swapped the firmware in the tool now to the one in the OpeWrtInvasion GitHub it may work now, would be great if you can test it to prove its working for me!

I know you can't recover the Global with the International firmware but some have said you can do the other way round but may incur wifi problems.

Sounds like db's uboot fix will solve a lot of these issues in the future, I will hopefully soon do another more updated version of the video a lot has changed since it was created!

1 Like

In case people are not aware - Xiaomi Mi Router 4A Gigabit Edition CN version only u-boot upgrade test

This uboot works perfectly fine for international, chinese version - any Xiaomi MIR4AG with a uboot installed.

To be honest, any MT7621 device with the correct ram size and flash id will work with my uboot.

@Gingernut has tested it and says its works fine.

My recent fix for the snapshot version of openwrt has now been added, so snapshot and 21.02 is fully working again.

If people are going to try it, make sure to use my firmware to backup the entire flash chip (from the web ui), in case anything goes bad, can always recover via a programmer.

3 Likes

please please help,
i can't connect the MIR4AG to the ISP directly because i don't have RJ45 from the wall and i can't do it anyway,
i have the main router configured and it have internet , everything is good , now before i flashed the new Openwrt firmware ,
on xiaomi firmware i just connected as from LAN1 to the WAN port and i didn't do any configuration and everything worked flawlessly ,
i got internet working and the 2 wireless bands and everything. [probably the xiaomi miwifi app does the config itself]
, now after flashing the new Openwrt firmware, obviously i knew there would be ip conflict, i couldn't change the Lan IP from luci [gui] ,
because it times out every-time trying to apply change and it times out trying to revert, its a known issue, and i tried to ssh to the router
but it refuses connection, apparently ssh package is not included and i don't know how to install it because i don't have
internet on the openwrt router because of conflict ip both routers having 192.168.1.1 ,
so i choose to do the following, i changed the Lan ip address of the main router to 192.168.20.1 and then configured WAN interface
on the openwrt router to 192.168.20.110 static, and the ipv4 gateway to 192.168.20.1, it should of got internet by now ,
since there is no conflict. but still it didn't work , i don't have internet on the openwrt router, or it wireless bands 2.4 and 5ghz
i am going to include pictures of all the setups from the main router and the openwrt router like firewalls and dns lan wan and all of these things.
diagram https://imgur.com/a/v7YE5yv
main router https://imgur.com/a/6mHB5sG
openwrt Lan interface https://imgur.com/a/istUfXJ
openwrt Wan interface https://imgur.com/a/1I502nw
openwrt router DHCP and DNS https://imgur.com/a/RF7A0eW
diagnostics,firewall, DynamicDNS,switch https://imgur.com/a/NXppMOv
wireless and interfaces in general https://imgur.com/a/o8w6KVU

Set openwrt Wan interface protocol to DHCP Client

1 Like

Hello @db260179
I want to flash your build from Minor update v1.5.2-stable,
my Mi4AG Chinese now using build from @Zorro https://anonfile.com/D7Y5V21fo9/mir3g-v2_owrt_19.07.3_zip
When want to flash your build/firmware =

Device xiaomi,mir3g-v2 not supported by this image Supported devices: xiaomi,mir4ag Image check failed.
The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform.
Blockquote

Please Advice, it is okay to force update, because I have gone to several times thru invasion process when I brick it :pensive: (I try to compile using the git files from openwrt), and for this time, i need to seek advice first.
I am novice in this openwrt.
Thanks in advance for the reply

force upgrade is safe tried and tested,you can upgrade to Official to snapshot vice versa

1 Like

As @zandatsu07 had said, you can do a force flash - the reason its saying its not supported, is because before we added support for this router, the 3gV2 version was found to work (basically the same hardware).

And the image ids are different so openwrt, by default state, is to say, only force to update.

I will be doing another release, which will include my new uboot as part of the release. So people can have a fully open router.

2 Likes

Thanks @db260179 & @zandatsu07 ,
Force upgrade work and now running 19.07.7 firmware, will report if any bug occur.

Hi.

I am having problems to do the exploit.

Initial login:

My firmware force to select a country and define a password. After "agree" with that:

After that, running the exploit, always get this message.


Looks like that router accept the exploit, but fail to log in.

Any tip?
Regards,
Juliano

yes had some issue.. you need to obtain stock from same machine on which you run exploit (other wise it says success but really does nothing).. I ended up creating a vm with ubuntu and obtained stock from browser with ubuntu vm.. If i get stok from browser outside vm it does not work

what happen if i press the reset button for 30 second , will the router restart to openwrt , or will the router go to the debrick state and wait for original firmware ?

Hi @mcaptur

Are you saying that i need to install another VM (using another software) to get the write "stok key"?

Thanks for the help, i will wait for your answer before do that.

Juliano

@eng.canjohnson

My router is not bricked.
I just want to help (as i sad above, i have no experience with Xiaomi firmwares)

A "freesh router" , with "original" firmware.
Help people linke us.

Juliano

you need to have browser (from where you get stok) and exploit runing on same vm.. If you have exploit in vm and browser on host machine it will not work

2 Likes

Hi @mcaptur

I will install a VM on my computer to try.
Thanks for the tip.

Juliano

Hi all.

While the VM installation is in progress, i am thinking.
Could it possible Xiaomi did a change in the latest firmware that blocked something?
If they did, it´s very oddy, and nosense, since their stock firmare is based on Openwrt
and many users who bought this router expect, or at least be had a chance, to use a opensource firmware.

Juliano