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

i flashed pandora bootloader. now the router is not responding. uart does not work. any solution to flash the nand? i have full dump of nand flash.

@niknintendo if I understand correctly, you overwrote the boot loader so @hoddy's method to unbrick won't work, correct?

Since you have a full dump of nand flash, solution is to buy a flasher and reflash like described in fist posts of the thread. On chinese e-stores (like aliexpress and so on) they are very cheap and work fine. Mine was about €3 or something like that, and worked to unlock the router a year ago when there was no exploit available at the time.

It's not hard to use, I would try doing that, take a look at the first posts.

it is not a chip that can be flashed with c341a (i have it). https://drive.google.com/file/d/1rD0_In_ikb1GZWZ_0SIc1PWXOlSWrhEK/view?usp=sharing
there is a method to convert it with spi flash ( and convert it to Xiaomi Mi WiFi Mini) and then flash dhe nand, but i did not find this hardware mod for my router 4a. nand is a toshiba tc58bvg0s3hta00

exist 2 Jumpers left for place spi eeprom -> Xiaomi R4

1 Like

Hi all. Has anyone tried this firmware on mir4a before?

firmware download: https://downloads.x-wrt.com/rom/
source code: https://github.com/x-wrt/x-wrt

Anyone wanna make a 4C firmware with working wan?

Someone made a 4C firmware with working wan port but the wifi is unstable.

Well people, I've submitted my official patch to the openwrt master branch

Be advised that since the new DSA switch changes, luci doesnt have a gui way of configuring the switch vlans and ports.

3 Likes

Follow-up to earlier posts. For me the R4AC (10/100 global) works great with OpenWrt. I've tested it for several weeks in different modes - as a slave router, as a master router, solo device - and I've found it on the latest stable release to be well,.. mostly stable!

I've only discovered one issue - which may or may/not be a huge problem for some - and that is with the Ethernet ports and SQM enabled. Over WiFi the router works very reliably but with Ethernet my speeds are getting capped to sub-megabit levels for one reason or another. Attached one can see a transcript of my iperf3 speedtests (router>device) over Ethernet vs Wireless

I suppose I may experiment with making Rpi4 my new host and see how Rpi handles SQM and maybe slaving the r4ac for wifi. Regardless, great work on achieving a solid implementation for this device

Sorry, I just stumbled upon this thread and I'm confused. I hope someone can clear things up.

At the top of the thread it says that the Mi R4A is fully supported with the link to the Mi R3G article which is a completely different device, with USB and more ROM/RAM. Actually, within the linked article there's another link to Mi R4A article, which explicitly states it is a different device. There's now even a PR to support R4A which directly contradicts the statement in the OP that M4A is fully supported.

Please confirm/correct the following:

  1. Currently supported (in 19.07.4) device is Mi Router 3G (128 NAND ROM, 256 RAM, USB 2.0), which used to cost about $40 but now is largely no longer available for purchase. This is the only properly supported device.
  2. There was a Mi Router 3G v2 with with 16 ROM, 128 RAM and no USB, hardware-wise it's the same as M4A, but different bootloader.
  3. The Mi Router 4A is the currently available version with 16 ROM, 128 RAM and no USB. Some instructions say flash MIR3G snapshot, some instructions say flash MIR3G 19.07.4 release, but in reality it is not yet properly supported by either.
  4. Some ali sellers have units in the new packaging/branding calling it Mi Router 4A Giga Version rather than the old Mi Router 4A Gigabit Edition (image here: https://ae01.alicdn.com/kf/H88f61675a86b4885aa06a28257e35deb2.jpg), can anyone confirm if it is identical (hardware and bootloader-wise) to the old model?

Thanks!

1 Like

So to answer your questions in one go:

3GV2 and Mir4A are the same, but possibly a different bootloader - u-boot or breeze

Dont worry so much about the bootloader as its not touched by the openwrt firmware images.

As far im aware, all Mir4A gigabit models being sold will work, with my v19.07.4 build.

I submitted a PR recently to add a new device profile as it is confusing trying to munge 3GV2 and Mir4A together, and the reason you are confused as well.

It turns out the Mir4A model SPI chip doesnt work reliably at 80mhz, so needs this adjustment - and as it stands the snapshot build of openwrt is broken for this device.

If you do get the Mir4A gigabit model, then just report any change and im sure we can get it added.

2 Likes

Is it possible to create an older firmware for the xiaomi r4a?
maybe 18.06.7

First of all, thanks for submitting PR for the proper R4A support.

So official MIR3G images won't reliably work on R4A, neither snapshot nor 19.07.4 release due to SPI clocking?

PS. I hope your changes get in before the 20.x forking.

thank you. do i have to connect only the jumpers on the left? do you know someone else who has done the modification for the same type of board?

So official MIR3G images won't reliably work on R4A, neither snapshot nor 19.07.4 release due to SPI clocking?

So its the MIR3GV2 and MIR4A that are basically the same, execept the spi frequency issue. MIR3G is a different board with a USB port.
As it stands, the current snapshot version of openwrt for the 3GV2 board will boot loop on the MIR4A due to dts profile of the 3GV2 set to 80mhz - which the flash chip is capable, but on the MIR4A board it seems to be too high and causes squashfs data errors (reading data too fast,gets confused and guessing misaligns itself).

Both the 3GV2 and MIR4A are only supported in the snapshot release, V19.07.4 doesnt have this device support.

I hope as well for the 20.x fork release

1 Like

There is no benefit in doing this, as this release is on security patching only and openwrt project doesnt backport new devices to old releases.

r4a firmware only started in 19.07?

For MIR4A only added support since openwrt snapshot version, So 19.07.x has no support for this board or 3GV2

I have the Mi Router 4A Gigabit Edition packaged device

I get this when I want to install Openwrt. Can you help me?

root@XiaoQiang:/tmp# curl https://github.com/araujorm/openwrt/releases/download/
v19.07.4-xiaomi-miwifi-3gv2-mt76updated-2020-10-24/openwrt-ramips-mt7621-xiaomi_
mir3g-v2-squashfs-sysupgrade.bin --output firmware.bin
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (51) Error
root@XiaoQiang:/tmp#

@maxgltc Do you have internet connectivity setup on the router, e.g. can you ping github.com ? (to exit ping do CTRL+C)

If so, try with:

curl -L -v https://github.com/araujorm/openwrt/releases/download/v19.07.4-xiaomi-miwifi-3gv2-mt76updated-2020-10-24/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin --output firmware.bin

-L is to tell curl to follow github's redirect headers (for example in my location it redirects to github's amazon AWS mirror)
-v is to see what is going on, if it doesn't work then please show the output to see if we can understand what the problem is

If even with that the curl version of Xiaomi's firmware doesn't work, then try with wget instead of curl, like this:

wget https://github.com/araujorm/openwrt/releases/download/v19.07.4-xiaomi-miwifi-3gv2-mt76updated-2020-10-24/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin -O firmware.bin

Don't forget to see if the download isn't corrupted, compare with this:

#  md5sum firmware.bin
a7b3a3d99f551b2ef9acfe20530a6891  firmware.bin

# ls -l firmware.bin
-rw-r--r--    1 root     root       5440264 Nov  8 13:52 firmware.bin