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

And here's a modified 5G power table (Gigabit version):

EDIT: After performing some testing, I saw decreased effective range and throughput after modifying the partition. It may be better to test some favourable reg domains instead.

2 Likes

Hi, could you please check the sha256 again?
I always get
55d55b7f4d291edee08d9c64638194b679a83100095a82be1cec6cabb737cde5
wherever i download/check the file. Your other builds match the checksum, just not this last one.

thanks

1 Like

Yes, you're right about offset for 1G, I made typo. Correct offset 0x50000.
About power table you may be right. Those values just removes software limitation, so you can set higher radiation rate in the settings, and even it can really radiate more power. But maybe HW has some power limit after which it will produce much more noise. I don't have any RF tools to check all those stuff.

1 Like

Hello. the problem is with where i upload it. i upload that file somewhere else and now sha256 should be OK .please go to below link and download it again. thank you very much

http://www.mediafire.com/file/7vkqypwlzoq1quk/openwrt-ramips-mt7621-xiaomi_mir3g-v2-squashfs-sysupgrade.bin/file

sha256: ded558fd9531d3acb67e6d240c2be6e2da964d2af27c172fdca41f203b23ce15

Perfect, now it matches the checksum. Thank you.

1 Like

add ('windows-1252') on decode in line 4, works for me.

line4 = subprocess.check_output(["cmd","/c","chcp","437","&","tracert","-d","
-h","1","1.1.1.1"]).decode('windows-1252').split("\r\n")[4].strip().split(" ")
1 Like

The wifi speed goes from 10MB to 5-8MB in few seconds while speedtesting. I built one myself and got the same result. Don't know the reason.
BTW, how did you configure the switch? I built one but the switch configuration wasn't correct. Thanks.

Try this setting in interface
Fragmentation Threshold > 2346 (default 256-2346)
RTS/CTS Threshold > 2347 (default 0-2347)

1 Like

switch doesnt work

Hi All!
Thanks to all for their great work. Got my two XIAOMI Mi R4A Gigabit today.
Decided to open one, ´cause I have seen photos from different Revision R0202 somewhere.
Do I have to use a revision-specific firmware to be compiled and flashed ?
Mine seem to be R0101
grafik

Can I contribute to this forum in one or the other way ? (only Software - no
hardware flashes).

Makku

Finally got my Mi Router 4A Gigabit Edition flashed with zorro's latest build.
Many thanks for sharing the build.
I tried to delete the wan interfaces and recreate them.
However it is still not working. Are there any special settings to consider when recreating the interfaces?
or just setting the name of one to wan, the other one to wan6 and then selecting the wan interface for both?

The kernel version basically doubled with openwrt the stock firmware is still on 2.6 something O.o

Hello.
What is the performance like on OpenWRT vs stock? I'm planning to order a 4A and flash it.

You have to also assign a firewall zone when creating. In this case select the WAN zone.

1 Like

Hello, everyone! First of all, I want to thank you for your work.

I have a problem with my Mi router and OpenWRT latest snapshot (29 april, haven't yet tried ss from 30 april). My provider provides Internet access via l2tp protocol. I've successfully installed necessary packages (xl2tp, kmods, pppol2tp, etc.) and managed to configure connection using luci (just created new interface with settings recommended by my provider and added it to WAN firewall group). Everything seems to work, but very very slowly. My old ASUS wl-520gc shows 20/20 Mbps on both speedtest.net and fast.com services, but Mi router shows only 2Mbps for download and 0.03-0.05 for upload. Honestly, I am very surprised (in a bad way). There seems to be something wrong with my settings. Maybe I'm doing something completely wrong? I have noticed, that OpenWRT l2tp configuration (/etc/config/network) does not have some ppp options, which are recommended by my provider. So, I hacked init script at /lib/netifd/proto/l2tp.sh and added missing options manually (re-checked /tmp/l2tp/options.my_conn_name, these settings were present). Unfortunately, these actions did not affect the speed in any way. The same with rx bps and tx bps options.

p.s. At the moment, I turned the router into a brick when I tried to restore the stock firmware (downloaded from OpenWRTInvasion repo w/o checksum validation) using the command:
sysupgrade -F -n -v /tmp/miwifi_r4a_firmware_72d65_2.28.62.bin
How should I switch back to stock firmware from OpenWRT without dancing with a tambourine :clown_face: next time?
If I will be able to restore using bootp and tftp, then maybe I will write instructions for Linux.

UPD. After restoring stock firmware, I've (learned Chinese :grin: ) measured speed, both tests show 25/25 Mbps (actually it is the limit of my tariff plan for now). If anyone faces the same horrible drop in speed on OpenWRT, please let me know. Perhaps together we can deal with the problem. I suppose that this may be somehow related to the firewall settings, but it’s hard for me to figure it out, because I am very new to OpenWRT and in general with the configuration of networks without gui.

Regards.

1 Like

The bootptab config really helped, thanks. :partying_face: I was using something more complex from official debian man pages, but it did not work.

Finally, I have unbricked my device, here are short instructions for Debian / Ubuntu Linux:

  1. configure Ethernet to use static address (I used 192.168.2.1 with netmask 255.255.255.0 in this example):
  2. run following commands:
sudo apt install tftpd-hpa bootp tcpdump
echo "client:bf=xiaomi_stock.bin:ip=192.168.2.50:ha=0000aabbccdd:" | sudo tee -a /etc/bootptab
curl http://replace-with.actual.url --output /srv/tftp/xiaomi_stock.bin
sudo bootp -s -d 5
  1. connect lan port to your computer and put your router into bootp-mode (hold reset for 5 secs on powerup until orange LED will blink frequently), then wait until blue LED will blink
  2. (optinal) run sudo tcpdump -i configured_eth if nothing happens (for example if you have different Mi router MAC addr)
5 Likes

Exploit executed on 2.28.38 on 4A Gigabit Edition. Had to reboot after I set the password before the exploit works.

1 Like

Successfully installed safe OpenWRT image according to
HowTo from @acecilia on
Xiaomi Mi Router 4Giga Version 2.28.132
PCB:R0101 from an UBUNTU 20.4 .

Install worked like a charm! Thanks again.
I am writing these lines through the new router connection :grinning:

2 Likes

Regarding the exploit (4A Gigabit Global Edition), I also had the same behavior of needing a reboot after setting the password, for it to work.

Another thing.
I know that weaker wifi on this unit on openwrt in terms of range is probably caused by the change from proprietary drivers to the opensource ones.
Searching a bit I found an interesting thread regarding a newifi3 d2 and signal range


...an excerpt

The problem with Ralink/Mediatek devices is the poorly calibrated EEPROM on many devices.
On my Newifi D2 I tried changing the factory partition which contains the EEPROM, wireless performance immediately went up without even needing to change the wireless signal strength.
https://github.com/gwlim/art-radio/tree/master/RAMIPS-Newifi-D3-Factory (same chipset and radios as 4a gigabit)

I wonder if we used calibration data from a different mt7621a device that has the same radios, maybe something could be optimized ? (under the assumption that we also have suboptimal calibration data from the beginning)
Does anyone have some research on this topic ?

4 Likes

as a lot from reading. it seem like low performance come from mt76xx driver. it have speed problem same as other model use mt7621.

1 Like

Had a fun day and did some performance testing with iperf3 on the Router.
Only have a Windows LapTop capable of 5GHz Wifi.

  • ~900 MBit/s with LAN-Port with a USB3toEthernet (Realtek USB GbE)
  • ~300 MBit/s with Wifi on 5GHz with Intel Wi-Fi 6 AX201 160MHz.

Snapshot running: r12985-508462a399 from OpenWRTInvasion GIT-Site.

Found some repeatable but maybe already solved behaviour:

  • When connected 5GHz Wifi without transferring something,
    Win10 shows a link rate of 866,7 MBit/s.
    When IPerf-ing connection speed drops down to 526MBit/s but 'recovers' after transfer.
    Is there a way to read out current drain / power consumption of the Router from Chipset?
    It may operate at upper limit (or it is simply the Intel Wifi on Laptop).

  • For the 5GHz Wifi I've set the option 'htmode' to 'VHT80' in /etc/config/wireless to achieve ~300MBit/s. With 'VHT40' it is ~210MBit/s. 'VHT160' not supported.

  • 'opkg install luci' gives kernel dependency error as there are newer snapshots on the server
    with higher kernel numbers. As people seem to have problems with LAN/WAN-connection in newer snapshot releases I will not update. But this is a warning to those who would like to use this snapshot and do need luci.

1 Like