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

Not sure if you aware, but we are now at 1.5.2 - https://workupload.com/file/33MNc5gaPKZ

This now allows to use the official repo software and kernel modules.

Just so everyone knows, turning on "Hardware flow offloading" on firewall section of firmware v1.5.2, got my GPON fiber PPPoE with 1gbps simmetric, from 390mbps to the full ~996mbps of my ISP via cable, ~300mbps via WiFi.
Thanks for pointing this out!.

4 Likes

for feeds.conf.default
specifically the src-git package https://git.openwrt.org/feed/packages.git^feb1a188e51191a8088596d503599d5f5f268d8b

there are some application packages that do not work optimally, for example mwan3 crashes frequently

is it possible if I replace it with the last stable update package, namely
package src-git https://git.openwrt.org/feed/packages.git^90af10d01579425369bd474051b6d3ddaf32a7e3

My sources only keep inline with the official released versions now.

Openwrt software repos will update any packages that need updating, otherwise do a feedback in their repo.

1 Like

Hi @db260179

How are the tests with your bootloader?
Are you planning to share later this month?

Thank you very much for your work.
Juliano

I have had a few responses back:

Feedback so far:

  • Openwrt V19.07 images boot fine
  • Snapshot versions stop working - currently lowering the SPI frequency to 50mhz fixes that issue
  • OEM firmware will need to be repacked as boot loader is no longer unencrypting their images - easy fix, just repack their image.
  • Web recovery works as expected

In terms of the snapshot image booting issue, this is a weird one, as my boards never got to work and yet some people have?. The uboot hands control over to the linux kernel when booting, but so far all know is that reducing the 80mhz to 50mhz fixes this issue.

OEM image booting will still work if already installed, just cant install the original image with this new uboot.

1 Like

Snapshot builds seem to boot fine for me with SPI Freq @ 80MHz.

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