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

As for building, here's the official documents on how to do so:

I think you also need rsync installed.

Basically gets down to:

  • Get a debian-based linux environment (can be your linux setup, can be a VM, can be an LXC container. I use an debian buster LXC container as my host is arch)
  • Install required packages
  • Switch to a non-root account
  • Clone repo with git
  • Run ./scripts/feeds update -a and ./scripts/feeds install -a.
  • Configure it with make menuconfig, this is how 4AGbE looks, pick the packages you want, I recommend setting them to *, not M. M generates them as ipks that you separately need to install (this is what I did to build kmod-ipt-ipset for frosp above). When you're done, hit Save, save as .config.
  • Start compilation with make.
  • After a couple hours, the bin file will be in /bin/targets/ramips/mt7621/.
2 Likes

Great news. So it is safe to upgrade from older snapshot?

1 Like

As far as I can see yes, but please keep in mind what I said about having to reset (aka uncheck "keep settings" on luci flash screen) and reconfigure here:

2 Likes

thanks @ave i flashed your image but i don't have access to internet with your build here is serial cosole log:

[   96.701610] mt7530 mdio-bus:1f wan: Link is Down
[   99.793555] mt7530 mdio-bus:1f wan: Link is Up - 100Mbps/Full - flow control off
[  100.797586] mt7530 mdio-bus:1f wan: Link is Down
[  104.913556] mt7530 mdio-bus:1f wan: Link is Up - 100Mbps/Full - flow control off
[  105.917584] mt7530 mdio-bus:1f wan: Link is Down
[  112.081561] mt7530 mdio-bus:1f wan: Link is Up - 100Mbps/Full - flow control off
[  113.085577] mt7530 mdio-bus:1f wan: Link is Down
[  117.201581] mt7530 mdio-bus:1f wan: Link is Up - 100Mbps/Full - flow control off
[  118.205649] mt7530 mdio-bus:1f wan: Link is Down

=====================================
edit: also have same problem with latest snapshot (Wed Apr 15 16:57:41 2020)

In the network section the switch tab is missing and when you trying to change 192.168.1.1 to 172.28.10.* you cant login to luci.

1 Like

In the network section the switch tab is missing

Well, can repro. swconfig list is empty too. I'm not sure if this is a thing on my end or on upstream tho, but I can't see any packages that'd help to include which'd solve this issue. This is an open bug on OpenWRT when running Kernel 5.4 on R3/R3v2/R4A.

Only culprit I can think of is this DTS change which was supposed to introduce a switch, https://github.com/openwrt/openwrt/commit/30644bc579e771e4b6dcc165ca966124e0259e1e#diff-a0859b8f2d604a5ea50a3e976bfb51de

Also, @Zorro, did you upgrade from a version before this commit while keeping your settings? If so, you're likely having the same issue I mentioned here, I personally fixed that by resetting and reconfiguring my device (both from inside luci), but there might be a less nuclear path you might be able to take.

172.28.10.* you cant login to luci.

I can't repro this, I personally use 10.69.0.0/24 without issues.

1 Like

Hi all,

Not sure somebody sent pictures of r0202.
Here's mine.

May I follow this procedure ?

2 Likes

I can´t DM you here, but I´d need that rom, nothing works on R3Gv2, and I can confirm that it´s not working because of the rom since I saw the error through serial:

1 Like

this is what you are looking for found it on neighbor forum:

https://dl4.shatelland.com/files/fbf995ac-7ddd-4221-8e01-62f918135653/210c3956-6f9f-4b6a-b0ed-974a992b3e24

this .bin file is for mir3g v2 firmware version (2.28.8)

but i'm not sure if it is possible to flash it.

also maybe you need this usefull tool (R3GV2+PATCHES for windows x64)
https://dl4.shatelland.com/files/9b34a7c2-28ee-44de-90cb-3f96b6de4a06/59ec11ac-ad89-4a45-b3c5-43ec9d875432

I think you need above tool for flashing it.

====================================

also here is firmware ver 2.28.132 with english UI for mi router 4a gigabit :

https://dl4.shatelland.com/files/54e880f5-8a5e-4877-95ef-b050a1a7cf8b/acdfc23a-292d-4590-b7e5-61d52ba3c961

above image is tested by me on 4a gigabit edition and it worked !!

instruction

  1. before running any configuration scripts==>you need to access the router,to do this,run 0.start_main.bat and enter the password of your router wait for the script to execute. the answer should be like this :
start uploading config file ...
run telnet+ ftpd...
Done
press any key to continue...

the result of the script will be running telnet and ftp servers on the router until it reboots.
2)0.start_read_uboot.bat and 0.start_open_uboot.bat:
shows you the status of the bootdelay and uart_en variables.
0.start_open_uboot.bat==>it changes bootdelay=5 and uart_en=1
this allow you to use the bootloader and using the console in the stock firmware.
and help you to restore the router without a programmer if the OS did not boot

  1. 1.start_create_backup.bat - just creates a full backup of the current firmware. As a result of the work, the backup.bin file should appear in the data directory..

4)2.start_write_uboot_R4AGE.bat - THE MOST DANGEROUS SCRIPT to run it is necessary only for the owners of R3Gv2 . Owners of R4GE do not need to do this, you have it exactly the same, and the Chinese have firmware for recovery only for R4AGE. Unlike other flashing scripts, this one does not restart the router automatically.
Replacing the bootloader allows you to restore the router even if there was a jamb in the main firmware, as happened when switching to the 5.4 kernel from openwrt.
The process takes about 7 minutes. the router does not automatically restart, a sign of the end will be change of the yellow LED to blue.

  1. 4.start_add_english.bat - the script turns the Chinese UI into English.(Tested on mi4a gigabit on firmware 2.28.62 and it worked)

  2. 5.start_write_OS1.bat - a script for changing the main firmware (the bootloader and special zones are not overwritten). The script takes the sysupgrade.bin file in the data directory and flashes it into the router. After the flash, the router will reboot.

Caution : use at your own risk .

1 Like

I uploaded today's snapshot to the repo https://github.com/acecilia/OpenWRTInvasion, which is suppose to work and contains the patch described here. I also updated the readme.

Apparently, today's snapshot boots, but has internet problems, as described here. I will add a comment on the readme about it.

As soon as there is a fully working snapshot I will upload it to the repo again.

4 Likes

is this (2.28.132) official?
can't we just upload the file via admin panel?

@Zorro posted that files and info from 4pda that I found. You can try to use links he provided.

Also, those .bin files does not contain header so if you trying to use builtin recovery they will not work (but that is only my opinion).
I have added the header form r4ag to that dump and modded model to r3gv2. The 28.8 file dump look almost the same as r4ag official miwifi_r4a_firmware_72d65_2.28.62.bin (just short on header and some differences at the end of file). Try to upload this by recovery: http://radek.piastlan.net/openwrt/r3gv2_firmware_72d65_2.28.62.bin

1 Like

Hi @Jeffpeng

You did anything special to flash the R4AC with firmware 2.18.58. I flashed the Gigabit Edition R4A without issues but the R4AC never seem to come trough. Tried already different openwrt firmwares but none of them seems to work fine. Can't ssh into it, can't get an ip. Had to unbrick it several times already.

Happy to hear your experiences.

Thx

Gr

I tried with that one and with @Zorro's mir3g v2 firmware version (2.28.8) as well but none of them works...
Thanks for the help anyway, I'll try to contact Xiaomi for an official rom.

1 Like

Any info using serial when trying do use recovery?

Got the same log as with every other ROM: "Image verify failed!".

Btw just talked with Xiaomi support and they don't seem to have it either :man_facepalming:
image

1 Like

So header and trx were fine? It failed on verify?
Can you try that one:
http://radek.piastlan.net/openwrt/CN.2.28.8_TEST.bin

No you can't upload it via admin panel

to make such firmware you need to have a signature file, and only xiaomi has it. Of course, you can write a script that replaces the public key inside the router, or remove the key check from the flash.

you need to use the scripts i posted before...

1 Like

So, there is no options to add say "R3Gv2.purple.status with 2 gpios?"

As long as anybody implements this "feature", no.

1 Like