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

you give it wrong download link to the firmware file ...you should give it direct link to firmware file ...

for example :

wget http://download948.mediafire.com/15zm7k2uf4kg/0qetz7rm8n9hr04/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin

1 Like

That rom doesn't seem to work for my R3Gv2, I have managed to send the test.bin file that it's requesting but it doesn't seem to be flashing it and I think it's because I'm not sending the right rom, I also tried with the OpenWrt snapshot and the R3Gv1 stock rom but none of them seem to work.
Do you know where can I find the original stock rom for the R3Gv2?

this is chinese rom for mi4a gigabit and tested by me and others it's 100% working ..if you are looking for english firmware you can't find it anywhere .

maybe you did something wrong try again and also turn off your windows firewall.

2 Likes

you're asking for a diffrent device a forum for mi 4a
i think this is the firmware you want
http://bigota.miwifi.com/xiaoqiang/rom/r3g/miwifi_r3g_firmware_9be74_2.28.44.bin

i Just want to clarify this is the stock from for r3g and not for mi ra gigabit

if that's not the right one check this site and see if you can find your router: http://www1.miwifi.com/miwifi_download.html

WARNING ==> when you want to flash below custom image don't forget to check the download link and sha256 or you will brick your router

http://www.mediafire.com/file/0qetz7rm8n9hr04/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin/file
mirror link for above image :
https://dl4.shatelland.com/files/2d1cf727-2edf-4cde-a6ec-112bfeb84f70/d47c239b-a70a-4b97-9e79-784fbc51d5b9

sha256: 60d9200fd23df3d88c76d828f04b53cdeaa39d4aec85eb7ef94346011787efc3

MD5: bf4411c5e04b4922169e869ccba863b2

Hello Guys,
I'm still with Snapshot v19, because the v20 is not booting (problem with partition as i can undestand).

I downloaded the build posted from Zorro, but still no luck (even with official build i'm experiencing similar issues).

Booting System 1
Erasing SPI Flash...
raspi_erase: offs:30000 len:10000
.
Writing to SPI Flash...
.
done
## Booting image at bc180000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.167
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    2017101 Bytes =  1.9 MB
   Load Address: 80001000
   Entry Point:  80001000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Erasing SPI Flash...
raspi_erase: offs:30000 len:10000
.
Writing to SPI Flash...
.
done
commandline uart_en=0 factory_mode=0 mem=128m root=/dev/mtdblock9
No initrd
## Transferring control to Linux (at address 80001000) ...
## Giving linux memsize in MB, 128

Starting kernel ...

[    0.000000] Linux version 4.14.167 (toor@toorbuild) (gcc version 8.3.0 (OpenWrt GCC 8.3.0 r12138-1e3bfbafd3)) #0 SMP Sun Jan 26 22:00:26 2020
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    0.000000] MIPS: machine is Xiaomi Mi Router 3G v2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] VPE topology {2,2} total 4
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x9c/0x4d8 with crng_init=0
[    0.000000] percpu: Embedded 14 pages/cpu s26064 r8192 d23088 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=0000284c
[    0.000000] Readback ErrCtl register=0000284c
[    0.000000] Memory: 121872K/131072K available (4803K kernel code, 248K rwdata, 1044K rodata, 1252K init, 253K bss, 9200K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 880MHz
[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[    0.000009] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[    0.007801] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[    0.073976] pid_max: default: 32768 minimum: 301
[    0.078782] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.085291] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.094393] Hierarchical SRCU implementation.
[    0.099576] smp: Bringing up secondary CPUs ...
[    0.105743] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.105752] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.105763] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.105899] CPU1 revision is: 0001992f (MIPS 1004Kc)
[    0.164320] Synchronize counters for CPU 1: done.
[    0.205808] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.205817] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.205825] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.205897] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.255515] Synchronize counters for CPU 2: done.
[    0.286915] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.286922] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.286929] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.287006] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.340696] Synchronize counters for CPU 3: done.
[    0.370560] smp: Brought up 1 node, 4 CPUs
[    0.378794] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.388589] futex hash table entries: 1024 (order: 3, 32768 bytes)
[    0.394989] pinctrl core: initialized pinctrl subsystem
[    0.401544] NET: Registered protocol family 16
[    0.416113] pull PCIe RST: RALINK_RSTCTRL = 4000000
[    0.721366] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.726399] ***** Xtal 40MHz *****
[    0.729770] release PCIe RST: RALINK_RSTCTRL = 7000000
[    0.734878] Port 0 N_FTS = 1b105000
[    0.738321] Port 1 N_FTS = 1b105000
[    0.741781] Port 2 N_FTS = 1b102800
[    1.897081] PCIE2 no card, disable it(RST&CLK)
[    1.901429]  -> 21007f2
[    1.903848] PCIE0 enabled
[    1.906455] PCIE1 enabled
[    1.909040] PCI host bridge /pcie@1e140000 ranges:
[    1.913802]  MEM 0x0000000060000000..0x000000006fffffff
[    1.918994]   IO 0x000000001e160000..0x000000001e16ffff
[    1.924159] PCI coherence region base: 0xbfbf8000, mask/settings: 0x60000000
[    1.940400] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.946235] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.951949] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    1.959209] PCI host bridge to bus 0000:00
[    1.963243] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    1.970099] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    1.975929] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.982685] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.992765] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    1.999276] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.006225] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[    2.012757] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[    2.019691] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    2.026415] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
[    2.033600] pci 0000:00:01.0: BAR 8: assigned [mem 0x60200000-0x602fffff]
[    2.040317] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
[    2.047083] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
[    2.053812] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
[    2.061094] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
[    2.068227] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.073170] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    2.079888] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    2.087090] pci 0000:02:00.0: BAR 0: assigned [mem 0x60200000-0x602fffff]
[    2.093806] pci 0000:00:01.0: PCI bridge to [bus 02]
[    2.098750] pci 0000:00:01.0:   bridge window [mem 0x60200000-0x602fffff]
[    2.106863] clocksource: Switched to clocksource GIC
[    2.113548] NET: Registered protocol family 2
[    2.118518] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    2.125389] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    2.131754] TCP: Hash tables configured (established 1024 bind 1024)
[    2.138160] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.143920] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.150407] NET: Registered protocol family 1
[    2.386773] 4 CPUs re-calibrate udelay(lpj = 2924544)
[    2.393061] Crashlog allocated RAM at address 0x3f00000
[    2.398660] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    2.407830] random: fast init done
[    2.415090] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.420928] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.434248] io scheduler noop registered
[    2.438136] io scheduler deadline registered (default)
[    2.443998] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    2.451555] console [ttyS0] disabled
[    2.455098] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
[    2.464142] console [ttyS0] enabled
[    2.464142] console [ttyS0] enabled
[    2.471053] bootconsole [early0] disabled
[    2.471053] bootconsole [early0] disabled
[    2.481049] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[    2.488412] spi-mt7621 1e000b00.spi: sys_freq: 220000000
[    2.496128] m25p80 spi0.0: gd25q128 (16384 Kbytes)
[    2.501036] 8 fixed-partitions partitions found on MTD device spi0.0
[    2.507433] Creating 8 MTD partitions on "spi0.0":
[    2.512213] 0x000000000000-0x000000030000 : "u-boot"
[    2.518186] 0x000000030000-0x000000040000 : "u-boot-env"
[    2.524395] 0x000000040000-0x000000050000 : "Bdata"
[    2.530232] 0x000000050000-0x000000060000 : "factory"
[    2.536118] 0x000000060000-0x000000070000 : "crash"
[    2.542020] 0x000000070000-0x000000080000 : "cfg_bak"
[    2.548009] 0x000000080000-0x000000180000 : "overlay"
[    2.553952] 0x000000180000-0x000001000000 : "firmware"
[    2.563227] libphy: Fixed MDIO Bus: probed
[    2.638842] libphy: mdio: probed
[    4.043852] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    4.050527] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21
[    4.061644] NET: Registered protocol family 10
[    4.067747] Segment Routing with IPv6
[    4.071488] NET: Registered protocol family 17
[    4.075982] 8021q: 802.1Q VLAN Support v1.8
[    4.082711] hctosys: unable to open rtc device (rtc0)
[    4.088585] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    4.096035] Please append a correct "root=" boot option; here are the available partitions:
[    4.104375] 1f00             192 mtdblock0
[    4.104381]  (driver?)
[    4.110899] 1f01              64 mtdblock1
[    4.110904]  (driver?)
[    4.117417] 1f02              64 mtdblock2
[    4.117422]  (driver?)
[    4.123923] 1f03              64 mtdblock3
[    4.123927]  (driver?)
[    4.130442] 1f04              64 mtdblock4
[    4.130446]  (driver?)
[    4.136961] 1f05              64 mtdblock5
[    4.136966]  (driver?)
[    4.143466] 1f06            1024 mtdblock6
[    4.143470]  (driver?)
[    4.149990] 1f07           14848 mtdblock7
[    4.149994]  (driver?)
[    4.156493] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    4.166546] Rebooting in 1 seconds..

Did anyone managed to solve this recurrent issue?

Thanks for support! :wink:

After a short research it's not looking good :frowning: It looks that there is no factory image available for R3Gv2. I found some info on Russian 4pda forum that they changing bootloader to one from R4A giga to use it's firmware in case of recovery. They posted a bin of 2.28.8 Chinese fw for it but I don't know that it will flash in recovery. PM me if you want that file - I just registered there.

1 Like

sorry i didn't know that . but here you can download dump FILE for R3GV2 :
https://drive.google.com/drive/folders/1FwiBe9vZy02jAwgGKt8qKI5Of38DDDXK?usp=sharing

Working! Thank you very much.

1 Like

All the dumps are from 4a Giga Version.
Be aware that the mac-address of the router will change :wink:

2 Likes

Did anyone try out the snapshot from April 12? Does it work?

Hello ave,
I tried yesterday but is giving me more problems than the build from April 11.

Still figuring out about strange problems with my device

I'm guessing its not controled by the software, im saying this because when i bricked my software the WAN light still worked so i might be direct from the NIC, a work around could be to not use the WAN port and set one of your LAN ports as WAN in openwrt

Hey,
Yes, I saw them and checked. All of them are for R4AG aka 1 gigabit edition, but I would like to have for R4AC aka 100m edition. Maybe you have some?
Thanks.

By the way, it is not so hard to change MAC address and the maximum possible WiFi power. I investigated binary a bit and found out how to change MAC and increase WiFi power. Please, let me know if you are interested in this info and I will spend some time describing all those stuff.

2 Likes

I'm interested in the latter

i'm interested too please share with us your knowledge about fixing the mac address of xiaomi router.

I´m sorry but I only have the GIGA version here :grimacing:

1 Like

Good Afternoon guys,

i'm trying to debug my issue, it's hard to understand why the router is behaving werid.

I can get my firmware running (on post 37) based on git-19, but not the firmwares based on git-20.

Already Tried to recompile FW 2 times and used some found on this tread, but i'm still having problems regardings mtd, sfquashfs etc, maybe is because the partitions has differents names.

Could someone can kindly send me one of his last working firmware with bootlog attached?

Thank you

Well, this is my first OpenWRT router and I really wanted to mess with VPNs and tunneling in it, but I couldn't do either of those due to the latest snapshots failing to run (and packages not being archived).

After lots of pain and suffering though, I managed to compile the fw myself-- with kmod-wireguard and kmod-sit included. I'll probably just get the rest (non-kernel-specific packages, like 6in4) from the repos.

Again: This is the first time I'm compiling OpenWRT, so please let me know if I got smth wrong. However, I can say that it runs perfectly on my 4A GbE.

Here's the bin file: https://fgl.ave.zone/openwrt/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade-2020-04-13-ave.bin

  • Size: 5.25 MB
  • MD5: 158f4777f848c0b95b39d5e59ba2d967
  • SHA256: cfee20b42297e9de453299feb9d3e6310a6b117c2651cc8b20b1cf441e400895

Edit: I can't get wireguard or 6in4 to work, though I'll admit that I'm not too familiar with configuration, though it may be something wrong with this build, be aware.

I've included Luci (alongside material theme and luci packages for wireguard, adblock and https-dns-proxy), adblock, https-dns-proxy, wireguard-tools, kmod-wireguard and kmod-sit. Kernel is 4.14.172.


If anyone's interested in following through my footsteps...

I've built according to this document in an LXC container running Debian Buster, but after the git clone step, I reverted to f2d976f06e (git checkout f2d976f06e). This was, as one would expect, a task that took several hours, so be prepared.

3 Likes