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

Native uboot?Can i directly flash openwrt?

This is my uboot partiton backup.

anyone here experiencing drops from Wifi? specifically the 2.4 ghz one.

@rogerpueyo Hi, i have a problem, my dump of SPI was corruped (shame on me) and i think i nuked the bootloader, , R4A show only a blank led, how can i fix it? someone could help me?

the blank led usually means in my experience is that the chip is empty. It happened to me when my SPI chip was done erasing my chip then when it proceeded to write on it, it disconnected because of the lack of power my USB Port 3 is giving to it. How did you know that your dump was corrupted??

TL;DR: It won't be possible to install custom firmware w/o hardware manipulations, right?

At this moment in time, yes.

Don't use breed bootloader for this router - breed is not optimizing for this hw - has wrong build partition table - is good for padavan, not for openwrt :).
Breed is only helpes for backup eeprom partiton (art) :slight_smile:
I now working for uboot mod for this model with simple web console.
For now in test i can upload uboot and firmware file with success.
Both files get from backup page from luci ( openwrt 19.7 xiaomi 4a version ).
If any test pass I share this uboot mod :slight_smile:

I had read that somewhere.

How to flash this from the original firmware?? just using upgrade system or how ?

Please refer to very first post in this long thread for instructions. You will need a SPI flash programmer.

1 Like

I have read the full instruction but I am missing information's because they change over the full course of posts... updated and so on... can someone write the latest newest instructions...
1.Buy SPI flash programmer with SPI clamp
2.Connect TXD, RXD and GND pins on USB programer, to (respectively) the RXD, TXD and GND UART pins on the router's board
3... I have come to this more I did not had time to go forward...

I would be weary thankful for one that successfully programed router to write more... Thank you all

you cannot demand that, you need to do a little work yourself. Maybe this explanation will help you, that's the way I flashed the 4A.

The OpenWrt wiki would be the place to put any installation instructions.
-> https://openwrt.org/toh/xiaomi/mir3g

Although MIR3G and 4A have similarities, a separate page for the 4A would make things a bit clearer for the 4A users, IMHO.

true hahaha, someone should create a 4A page.

fwiw

https://openwrt.org/inbox/toh/xiaomi/xiaomi_mi_router_4a_gigabit_edition

1 Like

First of all, thanks to everyone for the work done with this router.

I successfully flashed the SPI NOR chip (after a couple of pitfalls) and I now have OpenWRT running in the router, everything seems to work fine except the 5G WiFi chip.

The tx power seems ridiculously low and I have no option to change it. The working range is about 5 meters, the shown power is 3 dBm

root@OpenMi:~# iw wlan1 info
Interface wlan1
	ifindex 23
	wdev 0x100000002
	addr *****
	ssid OpenWrt
	type AP
	wiphy 1
	channel 108 (5540 MHz), width: 80 MHz, center1: 5530 MHz
	txpower 3.00 dBm

Wiphy phy1
	max # scan SSIDs: 4
	max scan IEs length: 2247 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Available Antennas: TX 0x3 RX 0x3
	Configured Antennas: TX 0x3 RX 0x3
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
	Band 2:
		Capabilities: 0x1ff
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 4 usec (0x05)
		HT TX/RX MCS rate indexes supported: 0-15
		VHT Capabilities (0x318001b0):
			Max MPDU length: 3895
			Supported Channel Width: neither 160 nor 80+80
			RX LDPC
			short GI (80 MHz)
			TX STBC
			RX antenna pattern consistency
			TX antenna pattern consistency
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT RX highest supported: 0 Mbps
		VHT TX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT TX highest supported: 0 Mbps
		Frequencies:
			* 5180 MHz [36] (3.0 dBm)
			* 5200 MHz [40] (3.0 dBm)
			* 5220 MHz [44] (3.0 dBm)
			* 5240 MHz [48] (3.0 dBm)
			* 5260 MHz [52] (3.0 dBm) (radar detection)
			* 5280 MHz [56] (3.0 dBm) (radar detection)
			* 5300 MHz [60] (3.0 dBm) (radar detection)
			* 5320 MHz [64] (3.0 dBm) (radar detection)
			* 5500 MHz [100] (3.0 dBm) (radar detection)
			* 5520 MHz [104] (3.0 dBm) (radar detection)
			* 5540 MHz [108] (3.0 dBm) (radar detection)
			* 5560 MHz [112] (3.0 dBm) (radar detection)
			* 5580 MHz [116] (3.0 dBm) (radar detection)
			* 5600 MHz [120] (3.0 dBm) (radar detection)
			* 5620 MHz [124] (3.0 dBm) (radar detection)
			* 5640 MHz [128] (3.0 dBm) (radar detection)
			* 5660 MHz [132] (3.0 dBm) (radar detection)
			* 5680 MHz [136] (3.0 dBm) (radar detection)
			* 5700 MHz [140] (3.0 dBm) (radar detection)
			* 5745 MHz [149] (3.0 dBm)
			* 5765 MHz [153] (3.0 dBm)
			* 5785 MHz [157] (3.0 dBm)
			* 5805 MHz [161] (3.0 dBm)
			* 5825 MHz [165] (3.0 dBm)
	valid interface combinations:
		 * #{ IBSS } <= 1, #{ managed, AP, mesh point } <= 8,
		   total <= 8, #channels <= 1, STA/AP BI must match, radar detect widths: { 20 MHz (no HT), 20 MHz, 40 MHz, 80 MHz }

	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Supported extended features:
		* [ VHT_IBSS ]: VHT-IBSS
		* [ RRM ]: RRM
		* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
		* [ AIRTIME_FAIRNESS ]: airtime fairness scheduling

Also, I don't now if I broke something else while flashing, I tried several of the sysupgrade binaries in this thread and only this (Xiaomi Mi Router 4A Gigabit Edition (R4AG/R4A Gigabit): fully supported but requires overwriting SPI flash with programmer) worked.

I also found this line in the kernel log:

[   13.190730] mt76x2e 0000:01:00.0: ASIC revision: 76120044
>> [   13.197230] mt76x2e 0000:01:00.0: EEPROM data check failed: ffff
[   13.836361] mt76x2e 0000:01:00.0: Invalid MAC address, using random address 92:fa:ea:2e:a7:4f
[   13.866918] mt76x2e 0000:01:00.0: ROM patch build: 20141115060606a
[   13.876550] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[   13.882028] mt76x2e 0000:01:00.0: Build: 1
[   13.886102] mt76x2e 0000:01:00.0: Build Time: 201507311614____
[   13.906349] mt76x2e 0000:01:00.0: Firmware running!

I'd suggest to install the latest snapshot, it doesn't have LUCI by default, and see if the problem persists.

1 Like

I also tried to flash other images for the R3Gv2, but all ended in a kernel panic. I don't have the bootlogs right now but I could try to replicate this weekend. I thought the hardware was identical... :thinking: