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

also try:
opkg install luci --force-depends

It's not the ideal solution but it will work.

i'm sure connect internet.. because i'm also browsing & watch tutorial by @hoddy..
i forgot what error message..
because of that then i install araujorm build that include LuCi..

okay i'll try later..

@Brett @hoddy
problem solved.. just "opkg install luci"

error because unstable internet..

now i'm waiting compile own fw finished..
just based latest Snapshot + LuCi + Adblock..
almost 4hours still not finish.. huhh..


Hi, i have a 4a gigabit global version with software 3.0.24.

Its possible install openwrt with exploit?

I read the post but i have duids


very2 possible.. most of there succes flash openwrt using cecilia exploit or video tutorial by hoddy

1 Like

anyone know what working Freq 5Ghz Channel in this router??

coz in my country Indonesia working freq 5Ghz is limited..

from Wikipedia:
"Indonesia only allows frequency 5.725 – 5.825 GHz (Channel 149 - 161), with maximum bandwidth 20 MHz."

You can get more channel by switching to CN or other region, but I don't think that's legal, beware of balai monitoring if you intend to use other channel without a license.

I have bought several of these routers.
I flashed one to OpenWrt,but it went wrong.

I do have programmers ,so i opened another one and dumped the full flash.

Changing the mac adresses was not to hard(only why is Bless on Linux the only tool that properly can decode the dump?)

It's in the Factory partition in the mtd

I do now have a "working" backup for this device

The only issue that i cannot solve is the serial number and the default ssid.

It's located in the Bdata partition in the mtd.
If i change even one byte and flash it back , the serial number is blank.
The default ssid gets truncated to Xiaomi_ and Xiaomi__5G.

Anyone got a clue what i'm missing?

It's just a bit of text,padded with FF

OpenWrt doesn't care, just as long as the mac adresses are valid (and i can edit them in the backup easily)

I'm using @araujorm builds and can select channels from 149 to 161 :slight_smile:

@rusek666 i'll check again when i'm at home

help me,i flashed your latest firmware i can't "opkg install nft-qos" and i tried using --force-depends it worked but my router bricked and i debrick it...
Any idea how to install any packages without getting errors?

Only way is to build them along when you compile the firmware, I'm afraid :frowning:

I have a new build yet to publish, I can provide a compatible package when I get some time, but I can't publish and build every package... GitHub would probably ban my free account... best way is to compile your own firmware and include what you need, if it depends on the kernel. Unless anyone knows how to force a specific kernel vermagic in a safe way?

Let me see if I can take care of that package...

1 Like

Pleased to report back that the OpenWrt SNAPSHOT r14522-8cfb839907 is working nicely.
Thanks @Double-G for feedback.
The only downside I can see with snapshot builds is currently is it is perhaps best to ensure all required additional packages are installed on the same day as the snapshot to keep dependencies aligned.


I'm sorry i'm only a beginner in OpenWRT I like your build it's stable using OpenVPN and Wireguard,i'll wait for you next firmware i hope theres a nft-qos there too ..

@zandatsu07 Well, I never used nft-qos so you're warned... :slight_smile:

Made an updated build, more "generic" without so many built-in stuff, but with lots of extra more packages built along with it (nft-qos is one of them, but I went nuts this time selecting many others as "M" when preparing the config; fortunately on a decent gaming PC it only took about 20 to 30 minutes to compile with make -j16 on Fedora 32).

I release it all as a single ZIP file (fortunately it doesn't take much more space):

Base sysimage file has Luci (luci-mod-admin-full collection), openvpn, wireguard, wol and ddns, besides the defaults, so compared to other builds, it is a bit smaller. Another difference is that I tried to match as much as possible with the defconfig, to try to improve compatibility. But no promises it will be more or less compatible with all official OpenWRT packages.

I didn't test this build, so anyone before trying it please really ensure you can debrick your device in case anything goes wrong.

Hope this is useful :wink:


@araujorm High fives your significant effort here...
I'm going to apply to main device now and feedback any observations over time...

1 Like

Device has not bricked so positive so far...

thanks very much

Trying to keep up on all the messages I saw that you were trying to download the system squashfs image from GitHub with curl GitHub... --output firmware.bin But just as a quick note when downloading things with curl always append a -L so that curl follows redirects. Without that your download will most likely fail. Also make sure that the time and day's right! If not the certificate of GitHub.com might not be valid (yet). :wink: