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

By the way, it is not so hard to change MAC address and the maximum possible WiFi power. I investigated binary a bit and found out how to change MAC and increase WiFi power. Please, let me know if you are interested in this info and I will spend some time describing all those stuff.


I'm interested in the latter

i'm interested too please share with us your knowledge about fixing the mac address of xiaomi router.

I´m sorry but I only have the GIGA version here :grimacing:

1 Like

Good Afternoon guys,

i'm trying to debug my issue, it's hard to understand why the router is behaving werid.

I can get my firmware running (on post 37) based on git-19, but not the firmwares based on git-20.

Already Tried to recompile FW 2 times and used some found on this tread, but i'm still having problems regardings mtd, sfquashfs etc, maybe is because the partitions has differents names.

Could someone can kindly send me one of his last working firmware with bootlog attached?

Thank you

Well, this is my first OpenWRT router and I really wanted to mess with VPNs and tunneling in it, but I couldn't do either of those due to the latest snapshots failing to run (and packages not being archived).

After lots of pain and suffering though, I managed to compile the fw myself-- with kmod-wireguard and kmod-sit included. I'll probably just get the rest (non-kernel-specific packages, like 6in4) from the repos.

Again: This is the first time I'm compiling OpenWRT, so please let me know if I got smth wrong. However, I can say that it runs perfectly on my 4A GbE.

Here's the bin file: https://fgl.ave.zone/openwrt/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade-2020-04-13-ave.bin

  • Size: 5.25 MB
  • MD5: 158f4777f848c0b95b39d5e59ba2d967
  • SHA256: cfee20b42297e9de453299feb9d3e6310a6b117c2651cc8b20b1cf441e400895

Edit: I can't get wireguard or 6in4 to work, though I'll admit that I'm not too familiar with configuration, though it may be something wrong with this build, be aware.

I've included Luci (alongside material theme and luci packages for wireguard, adblock and https-dns-proxy), adblock, https-dns-proxy, wireguard-tools, kmod-wireguard and kmod-sit. Kernel is 4.14.172.

If anyone's interested in following through my footsteps...

I've built according to this document in an LXC container running Debian Buster, but after the git clone step, I reverted to f2d976f06e (git checkout f2d976f06e). This was, as one would expect, a task that took several hours, so be prepared.


Hello @ave i tried your firmware... is not working on my R4Gb. It seems that after authenticating to GUi there is no access to any of the features or displays anything. as well there are no other services besides the ones in the basic snapshot. Should i do something else besides just loading the image file?
the checksum is correct as well and i tried 2 ways of installing the image. one from a working GUI and another with @acecilia method.

Compiling is a pain in the ass, yeah...
I wonder if there is a way of running the imagebuilder on an arbitrary commit, instead of the released snapshot one

1 Like

Imagebuilder, from what I've seen, just builds the image from released packages, doesn't actually build them, and as old packages aren't archived, I don't think that it'd be possible.

Hello, in an attempt to restore the official firmware after a succesfully flash of OpenWRT, I think I bricked my router.

Tried to following the procedure of unbricking, but in the BOOTP it looks like it lost its MAC address or something. Did I hardbrick it?


Hello guys. latest snapshot as of (Mon Apr 13 20:32:38 2020) still not working stay away from it .

here is serial console log :

i was able to successfully restore my router and run chinese stock firmware(2.28.62) :

serial console log :

no you didn't . just follow the unbrick method it should be fine .

[ 0.000000] OF: fdt: No valid device tree found, continuing without

Seems this is the main problem on OpenWrt master...

Has anybody repoted this issue?


@Zorro did: https://bugs.openwrt.org/index.php?do=details&task_id=3007

Please everybody that can, login to the issue tracker and start watching the bug report, so it shows under the "Most wanted tasks" section:



@981213 @adrianschmutzler Since you started making changes on the mt6721 target around the 4th of April (https://github.com/openwrt/openwrt/commits/master?before=a5a90a94cee96667b217fbaeb563c1fc4f4b7dba+175), the openWrt snapshot does not work for the router Xiaomi 4a Gigabit.

The issue is reported here (also contains some logs): https://bugs.openwrt.org/index.php?do=details&task_id=3007

Could you give us some insight on what is the current status?

Thanks :slight_smile:



Found on 4pda. It has openvpn and wireguard installed (but no wireguard luci app).

The ancient mediatek u-boot 1.1.3 is known to corrupt extracted kernel image when it becomes too big. I proposed a fix in this patch:
and it needs more testing. Could someone help testing this patch on top of current OpenWrt master and see if the problem is fixed?


Thats normal, double click it and set an IP for it. A few seconds later when it next requests you should see another "ping" in the history but this time the IP address should show the one you inputed.


Hello hoddy,

So the version based on git-20 is having troubles on our device? (even buids from february?)

I'm having problems with squashfs, now i'm triyng to crosscompile a "new build" based on git-19 with some adjusts (add softether and wireguard as openvpn is not working as expected).


I'm currently running git-20.064.26720-acef567 posted by zorro which seems stable on my device. Im not using wireguard but it is showing in luci though the page is blank, probably needs configuring. I've been able to install some of the additional packages for wireguard via opkg and will have a play a bit late about seing if I can get it setup but i can't see any immediate issues. Can you explain more what issues youre having with git-20?