Support for Xiaomi Mi Wifi 4

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 https://openwrt.org/toh/xiaomi/mir3g

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 https://d13ht01.tk/engineering/20190601/hacking-mi-router-4/

@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

mir3g)
		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"
                                },

and

"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.

2 Likes

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 brauliobo@gmail.com)
with the full dump it is possible to TFTP it

but uart is not working. you think tftp works?

Support added. https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/

Just installed, everything works but for some reason all Wi-Fi points went from three to almost zero bars and constantly disconnecting. Anyone has same issue? Or it's all about snapshot and release version will be better.

You can try 19.07.6 mir3g image if you want.

Seems like .4 is the last version where 5G wifi worked like it supposed to. Maybe .5 added new settings which should be enabled.

Can you add the instructions to install the official firmware on Mi Router 4 here maybe, or a new thread. I can't find any instructions to flash OpenWRT firmware on this device, except the one's that required OpenWRTInvasion, or is that the only way?

I prefer OpenWRTInvasion. Instructions can be found here:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c2a7bb520a0fb107984ad3757174d391796cd222

Hi, it's possible to use the firmware of r3g with the xiaomi mi router r4? I need to install a stable version of openwrt on my mi router r4