Support for Xiaomi Mi Wifi 4

is there already a firmware on this

as I understand it-the router does not interest anyone?

Yes, There are people, but still no developer. So my device is sitting around useless. I need to disable NAT which is not possible with the original Chinese firmware.

Same for me.
Box is useless as well and waiting for new firmware.

Need send some money to some developer, and process will much quicker (i cant make this task)

Okay. How much and send to who ?

I know 2 ways

  1. Or in this thread will someone
  2. Or need make project on upwork => will cost, devide cost to all

Yes-I would donate money to the developer.

And way3 exist - i see hw is SAME as on 3g - can anybody try
0) (optional - to restore stock fw if any) - make dump of all partitions (cat /proc/mtd; dd if=/dev/mtd5 of=/tmp/mtd5) => copy files to some ext location

  1. make steps from manual

It will just quicker, then if i will order device for test (1-1.5month), 35$ is cost - so may be somebody can try, if he need quicker

It has no USB port. For Mi Wifi 4 I don't have a developer firmware to upload via update page. How can SSH access be gained?

Agree, if no developer-firmware available (i dont think from 3g it will work there) only serial way theoretically possible

initram-fs from 3g starts fine, but router has different mtd layout, able to boot it from serial port

try it

@tienthanh2509 link is broken

someone did some work, but requires a backdoor to facilitate flashing to the new firmware Xiaomi Mi Router 4A Gigabit Edition (R4AG/R4A Gigabit): fully supported but not upgradable

Let me refresh this thread...

I have this router currently running OpenWrt 18.06.5 image from Xiaomi Mi Router 3G.
Installation was completed according to the same instructions as shared by @tienthanh2509
This image was used for initial load from breed web ui. Another suitable image is here.
Then the regular image openwrt-18.06.5-ramips-mt7621-mir3g-squashfs-sysupgrade.tar was flashed from the OpenWrt web ui. Note: mir3g-v2 image will not work!
Finally, port mismatch was corrected by editing /etc/config/network as follows:

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 6t'

or simply

uci set network.@switch_vlan[0].ports='1 2 6t'
uci set network.@switch_vlan[1].ports='4 6t'
uci commit network

All looks to be good with one exception - switch configuration in Luci is still incorrect.

In reality I had LAN1 and WAN plugged.
That could be fixed by editing 02_network prior to build

		ucidef_add_switch "switch0" \
			"1:lan:1" "2:lan:2" "4:wan" "6t@eth0"

this is the desired result in /etc/board.json:

"switch0": {
                        "enable": true,
                        "reset": true,
                        "ports": [
                                        "num": 1,
                                        "role": "lan",
                                        "index": 1
                                        "num": 2,
                                        "role": "lan",
                                        "index": 2
                                        "num": 4,
                                        "role": "wan"


"roles": [
                                        "role": "lan",
                                        "ports": "1 2 6t",
                                        "device": "eth0.1"
                                        "role": "wan",
                                        "ports": "4 6t",
                                        "device": "eth0.2"

It is possible to just edit /etc/board.json, so there is no strong need in building the new image.


does wifi work?

Yes, last time I checked Wi-Fi was working.

1 Like

i flashed pandora bootloader and now i bricked the router, is there any way to program the nand? i did a full dump with breed before the flash.

please send the full dump! it isn't possible to download it on the internet. (if possible send to my email
with the full dump it is possible to TFTP it

but uart is not working. you think tftp works?