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

Are you using Byte release?

Nope, I'm using official openwrt 21.02.0 RC3 build on my router.

ulpian

1 Like

Hello,I'm planning to buy another Mi router 4A gigabit edition,i'm trying that 802.11r or roaminig...is it stable to try that on our device?

Hello there,
I have not tried 802.11r but I have tried 802.11s (no ethernet wire for 2nd node) for just testing once. And frankly it was working better than I expected. Probably 802.11r is even better than that.

ulpian

1 Like

is sqm working properly? and what is your internet speed?

Yes it works fine.
My internet plan has modest speed. Actually it's only 60/8 Mbps so SQM does its job just fine. It solved all my bufferbloat, latency spikes etc. issues. I am happy with it. However, this may not be an accurate reference for people with higher speeds.

ulpian

2 Likes

Im having a weird issue with 5ghz
After some time, no device connect on 5gz only on 2.4..
If i restart, everything works again.

Im using it as an dumb-ap with DAWN

config wifi-device 'radio1'
	option type 'mac80211'
	option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
	option channel '36'
	option band '5g'
	option noscan '1'
	option disabled '0'
	option htmode 'VHT80'
	option cell_density '0'
	option country 'US'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid '****'
	option ft_psk_generate_local '1'
	option key '****'
	option ieee80211r '1'
	option ieee80211v '1'
	option ieee80211k '1'
	option bss_transition '1'
	option ft_over_ds '1'
	option encryption 'psk2'
	option mobility_domain '****'
	option skip_inactivity_poll '1'
	option disassoc_low_ack '0'
	option wmm '1'
	option dtim_period '3'

Any idea?

Hi there, I have a Mi Router 4 (Chinese version, not 4A) which is flashed a modified version OpenWrt 19.07.4 since I followed a tutorial video on Youtube. However I'm not impressed with this version due to the unstable connection of 5G. Can anyone suggest a stable version for this model? I've found someone mentioned "second link of Zorro firmware shared" (mir3g-v2 19.07.2) is a good one but I'm not sure how to roll back to this version. When I flashed 19.07.4 version, I used OpenWRTInvasion method (flash kernel1.bin & rootfs0.bin with some command lines), but in Zorro firmware it only has sysupgrade.bin & initramfs-kernel.bin. Please let me know how to roll back. Otherwise I'm opened to any stable version. Thanks in advance!

Just flash with mtd

mtd -e firmware -r write <ZORO-FILE.sysupgrade.bin> firmware

Can't help much with that model, but you should be able to downgrade and a prompt with "force check" should appear, but ONLY do that IF the firmware is compatible with your model (or else it will brick, if it happens search YouTube tutorials to debrick).

Thanks for your notification!

Thank you. Yes, turns out connection between ONT and router was 100Mbit. Changing the cable fixed my problem. Thank you all.

So I decided to do some testing with the latest global 4A firmware and Byte-bite's OpenWRT RC3 build that supposedly has some driver improvements baked in, on both 2.4 Ghz/5 GHz and a wired connection, at two different spots around the house. I also threw in an old TP-Link router running an ancient build of OpenWRT from the LEDE days just to have some sort of control. The tests were conducted around 4am on a weekday to minimize network congestion and background traffic as much as possible, and I did 7-8 repeated tests in the exact same spot in each case (just to make sure it wasn't a fluke). I also tried the official build of 21.02-RC3, but the results were basically identical to Byte-bite's custom fork so they aren't included in the image. The house gets a 1000/300 PPPoE connection from a fiber line that ends at an ONT box, which matches the wired speedtest scores of the official firmware. The antennas were configured with a bandwith of 20M (2.4G) and 80M (5G) with the highest signal strength possible and the same wifi channel in both firmwares. Everything else was left on default.

You can see the results in the table below. The first column is the wired result taken on a desktop computer, the pair following it are the wifi speeds from a phone held right next to the router itself, and the last two are from that same phone, but moved to a spot roughly ~15m away at the other end of the house, behind several concrete walls.

A couple of observations:

  • The wifi speeds are comparable to the stock firmware, but they are way more inconsistent. This is especially noticeable with the far away results - on the 5Ghz network for instance, sometimes I got a score even higher than with the stock firmware, most times it was awful, and in some instances my phone dropped the connection entirely and failed the speedtest. Same with the 2.4Ghz band. Packet loss and jitter were noticeably higher as well.
  • Interestingly, the close 2.4Ghz scores were sometimes higher than with the stock firmware, though still inconsistent. I'm assuming it's because of the power/amplutide regulations in the global firmware, i.e. OpenWRT can put out more "juice" (but at the same time, it's not as efficient at spreading it to a longer distance).
  • The wired ethernet speeds are consistently awful - less than a THIRD of what they should be (on both the official 21.02 and Byte-bite's fork), which is a dealbreaker for me and the reason I'll be switching back to stock until this is resolved.
  • Upload speeds (whether close to the router or far from it) seemed to be slightly worse across the board with OpenWRT, even when I could get a comparable download speed.
  • Not included in the test results, but anecdotally I also know that the router itself (whether it's with Xiaomi's firmware or OpenWRT) is unusable at a range longer than about 15 meters. With our old router I could still get a decent signal in a parking lot dozens of meters from the apartment complex itself, whereas the 4A struggles to uphold a bandwidth of 1-2 Mbit/s just a couple rooms away. This is especially noticeable on older and cheaper devices that don't have good built-in wifi receivers.

Disclaimer: It's entirely possible that there is a config option somewhere that I missed or a pending driver rework that hasn't made it to the main source tree yet or something, but frankly I don't have the expertise or the patience to debug it myself. I've reinstalled the stock firmware for now, and I'll give OpenWRT another shot maybe in a year once 21.02 is stable and got some patches.

2 Likes

Hi there,
Thanks for sharing numbers.

The wired ethernet speeds are consistently awful - less than a THIRD of what they should be (on both the official 21.02 and Byte-bite's fork), which is a dealbreaker for me and the reason I'll be switching back to stock until this is resolved.

Have you tried enabling software+hardware offloading on 21.02.0 RC3? Seems like it was disabled during tests. I think it could affect the results VERY positively for openwrt.

ulpian

RC3 has Hardware Offloading?

I have better results on wired (LAN to WAN) on the default OpenWrt 21.02.0-rc3 with iperf

iperf-3.1.3-win64>iperf3.exe -t 100 -c 192.168.
No flow offloading
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-100.00 sec  8.35 GBytes   717 Mbits/sec sender
[  4]   0.00-100.00 sec  8.35 GBytes   717 Mbits/sec receiver

Software flow offloading enabled
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-100.00 sec  9.58 GBytes   823 Mbits/sec sender
[  4]   0.00-100.00 sec  9.58 GBytes   823 Mbits/sec receiver

Hardware flow offloading enabled
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-100.00 sec  10.9 GBytes   939 Mbits/sec  sender
[  4]   0.00-100.00 sec  10.9 GBytes   939 Mbits/sec  receiver
1 Like

I reflashed RC3, enabled both software/hardware offloading and... it looks like you're right! Or at least it seems to have helped somewhat. Quick before and after comparison:

2021.07.10_21.09.16

I consistently get scores in the 500s now, up from the 300s. Obviously this is still not the full 900-950 I would expect, but to be fair it's a weekend evening so it's entirely possible that my ISP is just overloaded. I'll do some proper testing once I'm able to, and study what the offloading options do (and why they're disabled by default) in the meantime.

Oh, since you're here, I figured it's worth a shot to ask - are there any "magic" options I should know about that make, specifically, long-range 2.4G wifi speeds usable, besides the obvious? (free channel, 20MHz width, high transmit power). If this is a hardware limitation of the device itself then I'm willing to accept that, but I find it ridiculous that I get nearly an order of magnitude longer reach with a 10 year old 4/32 router that has 2 fewer antennas.

1 Like

Hello, I'm interested in your experiment recently

Have you tried installing irqbalance & enable it manually on /etc/config/irqbalance?
Have you enabled both software offloading & hardware offloading?

Then let's see what will happen next

1 Like

I'm sorry if I can't help to do some internet speed experiment since my ISP is sucks and expensive lmao (10mbit/s peak)

It's still hovering around 600 Mbit/s down at 6am with hardware & software offloading enabled, so those probably aren't enough. As I said in the post, I'm an amateur and every setting was left on its default. My assumpion going into this was that any "this will quadruple your internet speed and cut your CPU usage in half" packages and options would be enabled by default (which I think is a reasonable expectation).

irqbalance is enabled and running now, but I don't think it's doing anything.

1 Like