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

maybe you can check fron this link https://github.com/acecilia/OpenWRTInvasion

Hi guys, I'm completely new to OpenWRT and am very interested in the firmware. I'd like to ask if the latest stable OpenWRT firmware will offer better wifi signal (by manually raising the transmit power) and therefore, better wifi speed?

no stable version yet sir, low power db gives you smaller coverage but gives you better speed wifi transmit, high power db gives you wider coverage but maybe lack off speed and transmit

hello there, I just read about the recommended fix for memory leaks on mt76 wifi drivers you have there. unfortunately im running a 100M version of the router, if you dont mind, can you compile a package that works for the 100M version as well, im running a 19.07.7 and it still having the same memory leaks and its much worse for 100M since it only had 64megs of RAM and it crashes like within a 2-3 day (7-9days if lucky).

Hi,

The router (4A Gigabit) is crashing for me regularly, using build v1.5.2 by db260179

It reboots automatically.

I'm trying to find out more

I am testing OpenWrt 21.02-SNAPSHOT r15877-7e1ab3b746 in my 4AGE
And it seems that the autodetection of the link speed does not work yet, on a four-core 100Mb cable 1000Mb is connected.

mt7530 mdio-bus:1f wan (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY]
mt7530 mdio-bus:1f wan: configuring for phy/gmii link mode
mt7530 mdio-bus:1f wan: Link is Up - 1Gbps/Full - flow control off

And the link doesn't work.
This is probably due to the work on DSA, and forced gigabit speed in code.
On the stock firmware, everything works fine and it is possible to specify 100/1000

I have a Gigabit Edition.

From what I understand so far, there is no dedicated stable firmware version for it yet, only the snapshots, is it?

This hardware accepts the R3GV2 firmware, which is stable (downloads.openwrt.org/releases/). Does it need any twitch/patch for the bootloader, or it works "right off the bat"?

Is anyone here tried compiling v2ray in our router?

No official stable release, but unofficial release - https://gitlab.com/db260179/xiaomi-m4a
Based on the current V19.07.7 version. Its been fixed now to allow to use the official repo software and kernel modules.

Unfortunately for this model there is the Chinese version = U-boot boot loader which my version supports fully (as i own one of these devices), and then there is the Global version which has the Breed Bootloader. In theory the breed bootloader version should work just fine with my stable release version. Only owners of these versions can confirm.

The Breed bootloader is easier to recover as its has a built in web server recovery process.
The U-Boot version is a bit trickier and requires the hoddys recover video to watch (as above in this thread)

As we are not installing a new bootloader, the bricked status is only soft brick, so can be recovered, via software procedure or using a serial TTL usb cable.

1 Like

@ db260179, thaks for the reply.
So, your version neither changes the stock kernel nor the bootloader?

I have this:

root@XiaoQiang:~# cat /proc/version
Linux version 3.10.14 (jenkins@327eefce2db8) (gcc version 4.8.5 (crosstool-NG crosstool-ng-1.22.0) )
 #1 MiWiFi-R4A-3.0.24 SMP Tue Aug 18 11:17:57 UTC 2020
root@XiaoQiang:~# cat /proc/cpuinfo
system type             : MT7621
machine                 : Unknown
processor               : 0
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 577.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VPE                     : 0
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 1
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 577.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VPE                     : 1
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 2
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 577.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 1
VPE                     : 0
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 3
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 577.53
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 1
VPE                     : 1
VCED exceptions         : not available
VCEI exceptions         : not available

So I guess mine has the Breed bootloader, right?

That doesnt show what bootloader you have.

Do this in a shell

cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00030000 00010000 "bootloader"
mtd1: 00010000 00010000 "config"
mtd2: 00010000 00010000 "factory"
mtd3: 00fb0000 00010000 "firmware"
mtd4: 001cab46 00010000 "kernel"
mtd5: 00de54ba 00010000 "rootfs"
mtd6: 006f0000 00010000 "rootfs_data"

This is an Breed bootloader

The u-boot will have - u-boot as a partition name

@ db260179

cat /proc/mtd:

dev:    size   erasesize  name
mtd0: 01000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Bdata"
mtd4: 00010000 00010000 "Factory"
mtd5: 00010000 00010000 "crash"
mtd6: 00010000 00010000 "cfg_bak"
mtd7: 00100000 00010000 "overlay"
mtd8: 00e80000 00010000 "OS1"
mtd9: 00ce0000 00010000 "rootfs"

So, yes you will find thats a breed bootloader. You can test that very easily.

Turn off the router. Press and hold the reset button on the back. Then plug back in, wait a minute or so, then, on your pc/laptop make sure to set a static ip address to: 192.168.1.2, then connect to the router and ping 192.168.1.1, if responds then the web ui for the breed bootloader is there and you can open a web browser to http://192.168.1.1. then backup the firmware etc.

If not then, xiaomi have restricted that usage?

Search the web for breedbootloader.

If my image doesnt work, then you can do a simple restore - but make sure you can access the breed boot loader, otherwise you will need a serial usb ttl lead to recover.

Thanks,

How do I read the boot log?

You will need a serial ttl usb lead and connect to the internal board of the router - The first few pages on this thread shows how.

If you have U-Boot, why don't you flash breed-mt7621-xiaomi-r3g.bin?

Potentially hard brick the router as this is designed for the r3g model and not guaranteed to work.

Openwrt on most models never touch the bootloader, as thats what can brick badly a router.

So not advised!

1 Like

Try to flash it with this build! https://gitlab.com/db260179/xiaomi-m4a/-/releases
I am using it 3 weeks now and its stable like a rock! Also updates work like a charm!

1 Like

Hi. What is maximum tx power (dbm/mw) with this router on 2.4/5 ghz?
Thanks!

@carlanga
Any chance you can dump the bootloader and upload it somewhere?

Is easily done in Luci(on the upgrade page)

I've got 3 international versions of this router,but all these have the u-boot loader.

Ch341 flasher is ready,so i want to try the breed bootloader on my routers