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

flash chip stated to be used is a GD25Q128C

the data sheet has a read mode with Maximum Read Freq. 60Mhz
without knowing the driver is not using this mode this should be the MAX
I would keep an eye out for devices using other flash chips & check there data sheets
best thing to do is try to find out the speed of the OEM firmware

1 Like

Most of the oem drivers use 50mhz or lower.

The unfortunate issue has been caused because, the original patch for the 3GV2 spi speed was set to 80mhz. This was carried over to the MIR4AG patch.

Most recent mt7621 boards support patches are being set to 50mhz because they where experiencing the same issues as ive found.

If you are lucky, like i have with the Unielec boards, they work stable at 140mhz. It all boils down to board design and testing. Unfortunatley these boards are super cheap, so quality suffers.

1 Like

Any idea how to lower the spi frequency in the snapshot builds?

Compiling is not that hard and if it's an easy fix i want to try it.

Have to open up the router anyway to flash the backup,so why not tinker a bit more :yum:

Hi @fordrwd4ever

In your openwrt build dir, locate this file:
/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-3g-v2.dtsi

You will find "spi-max-frequency".

Juliano

Reflashed router with the dump and ch341 programmer.

Then flashed the new uboot from @db260179.

Router is alive again.

Then changed the dtsi file to 50MHz and compiled the latest sources(nothing fancy,just the bare minimum).

Upgraded it from 19.07 and it works just fine.
So kudos for the new uboot👍

1 Like

Whenever i get the time...... I will be submitting a patch for the mt7621 support to the official uboot sources.

So we can have a newer uboot version and not the current one that is over 17 years old.

For now this will do. Least this router is free from vendor lockdown.

In case anyone wants to try it out, the new uboot

1 Like

Hi @db260179

I have an experience with OpenWRT and TP-Link routers, but for Xiaomi, i´m a newbie.
My router is a Mi4 Gigabit Global version.
My router is still with Original Firmware and i don´t have a SPI programmer, just a TTL adapter.

For the first Openwrt flash, which way do you recommend me?

  1. Check first if my router has a breed bootloader?
  2. Use OpenWRT Exploit and flash using ssh/telnet?

Your uboot is applicable for my case?
It is possible to backup or dump the firmware before?

I appreciate your help.
Juliano

Hi julianocs,

If you could pm message me the following:

ssh shell of router:

cat /proc/mtd

If you are running my latest v19.07 1.5.2 image, send me your boot partition and possibly the full flash download.

Goto your router web page -

https://yourrouterip/cgi-bin/luci/admin/system/flash

Then

Save mtdblock contents
uboot or bootloader
flash for full backup

And send me this via workupload.com, via pm.

I can then test on my test router, and see if its possible.
Thanks

Hi @db260179.

My router is still with original Xiaomi firmware.
I need to flash to your firmware first. Wich method you recommend me?
It is possible backup the original firmware? Or is that not necessary?

Juliano

https://gitlab.com/db260179/xiaomi-m4a/-/releases - 1.5.2

You will need to follow the openwrt invasion operation (beginning of this thread) to be able to install openwrt firmware.

Make a note of the ip addresses you use etc. Original firmware can only be reinstalled on their uboot, not my new one due to their restrictions.

So before you attempt my uboot, just install my openwrt firmware first, then send my your flash dump, as per previous message i sent.

Thanks for the help @db260179.
As soon i do it i send the dump to you.

Juliano

1 Like

Is this compatible with R4AC ?

As I have tried all three builds which brick my router. I have de-bricked using MiUi Repair Tool with this file Mi Router 4A ROM – Xiaomi MIUI Official ROM Download (ezbox.idv.tw).

Is Anyone here tried to install wrtbwmon in Snapshot? I love it because it's minimally designed, i tried nlbwmon it's so confusing to check what's happening to your bandwidth so much going on

No, this thread is for the mt7621 range not the MT7628DA models.

try this " brvphoenix/luci-app-wrtbwmon: Bandwidth monitor for OpenWRT (github.com)" work with snapshot.

1 Like

Can I just upgrade from byte-byte's build ?

thanks I'll try this

I dont know anything about byte-byte build?

If its for Xiaomi R4A gigabit, then its a case of just doing a backup config, then do an upgrade.
You might have to force update if its snapshot version.

@hey07 This is perfection,better than nlbwmon

2 Likes

Hi @db260179,

I tried to configure Wireguard in your 1.5.2, I had it already working in a wrt1900acs, and the same conf does not work no matter what I tried. Is like the interface does not listen for traffic even when the port is open. I tried to connect to the port with "nc" and in the wan interface I see the traffic incoming via tcpdump, however the wg0 interface never receive a single byte. Someone got it working?

Thanks