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

Try the method mentioned at the end of my video, if you're not using the 4A make sure you change the test.bin file for your firmware:
@jinglei207 this also apply for you follow this debrick method at the end of the video:

2 Likes

Should i use the clone of yours just like that or can i update the files using the commands below;

./scripts/feeds update -a
./scripts/feeds install -a

Will it cause any problem if i update them?

Because i get these errors when i type "make menuconfig"

WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libidn2', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/network/utils/nftables/Makefile' has a dependency on 'jansson', which does not exist

One question from my side (I must warn that I don't know OpenWRT development lifecycle) - when I can expected an official stable version? I faith that Zorro build works well but I would prefer to install official build.

Hello. if you are not able to download official firmware for your router from xiaomi it's because they changed the links and some remain old and broken .You have to manually edit the links then you can download it.
for example :
http://cdn.cnbj1.fds.api.mi-img.com

http://bigota.miwifi.com/xiaoqiang/rom/r4a/miwifi_r4a_firmware_72d65_2.28.62.bin

new link should be like this :
http://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/r4a/miwifi_r4a_firmware_72d65_2.28.62.bin

3 Likes

I'm talking about official OpenWrt build, not a Xiaomi one :wink:

1 Like

You need to run to run those scripts. It will sync with stable branch so no worries.

@rRs5UPifa There's a snapshot official build if you want it Official. If you want stable 19.03.7 you can check the repo where I backported our device to stable. You can check the commits to check which files I changed. As to an official stable build for our router, we'd need to wait for them to fork Version 20 from the master build. It's gonna take 6 months-ish for that.

unplugging power adaptor make my device brick ( device loses its electrcity ),must perform hard reboot N times until got to work(blueled) . ( sometimes stay orange led too long.),
and when it does, luci cannot login and cannot ssh(port 22 ) refuse to connect via ether, wirelesss sta mode work in background, but i dont have wlan ip( cus public ap)

which older version if i reboot ssh manually from terminal , it will perform well ??
i'll try.
thanks.

What about the WiFi performance? Is it the same as in the original, Xiaomi rom, or worse?

as i test wi-fi performance drop from 500Mbps to 300Mbps (stock to openwrt). just speed test not iperf.

I've tried several debrick method... I'm thankful to those who shared their knowledge. But your's (Hoddy) is the easiest. And revived my 4A Megabit.

1 Like

Oh, I see.

on Lan speed at 500/400
on Official ROM 500/300 (Dual-Band Mode)
on OpenWrt 220/300 (5G,2G same SSID)

So my understanding is somebody has to port proprietary wifi driver from the stock rom, but it is not that easy (different kernel version, undocumented code, and so on). Does the worse WiFi performance is noticeable on 5G only, or on 2G too? I'm asking because from your post I'm assuming that 2G works the same in both cases.

In my case, 5ghz is very very stable. With my Ipad Air and Intel STAs I can easily achieve 300 RX/TX minimum with bursts to 400 with a local Iperf test to a device connected to LAN. Can't say the same to 2.4ghz though. It's unstable on my Ipad and Qualcomm android STAs but stable on my Intel STAs. Well you can compile the propriety drivers but you'd need to revert to the commit before kernel subversion .180 as last I've checked the Kernel supported by the propriety driver hasn't been compiled for that yet.

1 Like

So basically the same case is with a Mi WiFi R3G (due to the same hardware)?

I'm getting errors while compiling. I'm not an expert of this so is there a purpose for using your repo?

What if i use the command below except than yours;

git clone https://git.openwrt.org/openwrt/openwrt.git

Can i make a stable 19.07.3 (4.14.180) image for our router with it aswell?

Thank's but I've just cherry-picked the good bits from the forum and made it a bit easier to see it all work in video form. You got @Zorro to thank for that really quick and easy debrick method! Glad to hear to you recovered it though.

1 Like

What compilation error are you getting? Did you setup your build environment properly according to https://openwrt.org/docs/guide-developer/quickstart-build-images ?

Make sure that you installed build essentials using

sudo apt-get update
sudo apt-get install subversion g++ zlib1g-dev build-essential git python python3 python3-distutils libncurses5-dev gawk gettext unzip file libssl-dev wget libelf-dev ecj fastjar java-propose-classpath

Follow the directions vis-a-vis just change:

git clone https://git.openwrt.org/openwrt/openwrt.git

to

git clone https://github.com/Byte-bite/OpenWRT-19.07.3-Stable-MI4A-Gigabit.git

Update the feeds using

./scripts/feeds update -a
./scripts/feeds install -a

Then you can issue

make menuconfig

Then set a target for our router.

What distribution did you use? For mine I use Ubuntu 20.04.

If you use that command, then you'll pull from the master branch which will create an image similar to the latest snapshot. To build from scratch with Stable as a base you can use my repo where I backported our router to stable or fork the stable branch and apply the cherry picks to your local repo.

Thank you for your detailed reply.

Yes, i did all of the stages described in the according guide while using your repo. The config GUI opens when i execute "make menuconfig" but i get the following errors before that;

WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libidn2', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/network/utils/nftables/Makefile' has a dependency on 'jansson', which does not exist

I'm using Ubuntu 18.04

@arutharen - I don't understand what is your problem :wink: You have everything is in logs - you have to install lacking dependencies in your system (for example libcap, libpam etc).

When i try to install these dependencies it gives an error like this for example;

E: Unable to locate package libpam

They're not installable right now.

I think the module name should be libpam-modules

As such install it with

sudo apt install libpam-modules

I've been reading in the forums that people are having issues compiling with older versions of Ubuntu. I recommend creating a build environment from scratch using 20.04, updating it to the latest release and then setting up the build environment.