OpenWrt for Xiaomi Mi Router 4C

/usr/bin/nc -l 4444
does nothing.. I guess the version 0.0.1 does not work on this device with firmware 3.16 but apparently I need to use that one.

I'll try downgrading to a supported firmware version first. If at all possible. Any pointers anyone?

Hi
I know it's been a month since you asked but I managed to fix my router yesterday. Based on the post below I tried and succeeded to increase the txpower up to the legal limit on my risk of bricking the device.

First of all I ssh root on my mi-4C and did an "cat /proc/mtd"

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r15421-498fb1b8aa
 -----------------------------------------------------
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00010000 "bootloader"
mtd1: 00010000 00010000 "config"
mtd2: 00010000 00010000 "factory"
mtd3: 00010000 00010000 "crash"
mtd4: 00010000 00010000 "cfg_bak"
mtd5: 00100000 00010000 "overlay"
mtd6: 00ea0000 00010000 "firmware"
mtd7: 002052ec 00010000 "kernel"
mtd8: 00c9ad14 00010000 "rootfs"
mtd9: 00a10000 00010000 "rootfs_data"
root@OpenWrt:~#

So far so good. Then downloaded mtd2.bin(factory). I used Luci, System>Backup/Flash Firmware> Save mtdblock contents>factory
Opened file in Hex editor and changed 14 values to 0xFF as in screenshot.


Then save as mtd2.bin and upload to router /tmp using scp

cd path-to-mtd2.bin
scp mtd2.bin root@192.168.1.1:/tmp

Unfortunately trying to write /tmp/mtd2.bin to factory partition didn't work
BUT... risking again I used kmod-mtd-rw

opkg update
opkg install kmod-mtd-rw

...and then the magic words I found on the net:
insmod mtd-rw.ko i_want_a_brick=1
Then using mtd I wrote to flash:
mtd write /tmp/mtd2.bin factory
I had to do that a few times before success.
Did a reboot and now I am able to set txpower from 0 to 20dbi.
I did simple tests with wavemon and it works!

Sorry but I can only post one screenshot.
I didn't test if flash partitions remain unlocked for writing after reboot!
Also I have to do something so my command lines show properly :slight_smile:
I hope someone finds my post usefull.

4 Likes


successfully installed and am using mi4c thanks so much for the firmware.
sometimes in this firmware, the wifi stops abruptly, the router works fine, but then i need to reboot the router inorder for the wifi to start working again, any suggestion or solutions for this pls?

Using openwrt 01-09-2020 MacTavishAO mi 4C sysupgrade.bin with AirVPN.
Looks like tunnel is working but can not get access to web sites through vpn tunnel.
Have dns redirected to vpn dns server and firewall set same as my fully functioning VPN router. Still no go.
Bigger problem logged out and now router refuses connection through its IP but PC can still see and has made connection to pass worded wifi.
Any help to get back in touch with this Xiomi4C router

After gaining telnet access use any ftp client to upload openwrt to /tmp/

Im having problem in this step.Do you have any tutorial in this?

Hi, Iit's the first time that I try to install Openwrt on a router. I install this one on my mi router 4c, but after reboot I don't have interface neither internet. This version it's suppose to be stable right?
After I install Luci interface but I don't have internet yet. What should I do? Install other version of openwrt? Can somebody help me? :slight_smile:

Official snapshot builds does not have luci pre-installed. Follow these instructions: https://openwrt.org/docs/guide-user/luci/luci.essentials and configure your network.

Had great success using FileZilla under Ubuntu 20.4 address, log in , Passwd, port
192.168.31.1. root root 21
Set up tmp directory in right panel (router) as receiving then in left panel PC directory locate your firmware ( renamed to firmware.bin) right click for menu and upload file.
firmware.bin file is now in router ready for next stage.

Thanks, I already install it and have it work :slight_smile:
But now I have a new problem, I configure protonvpn in openvpn and use the router to connect to wireless network and after that I access it through wireless. The problems is that it everything works but after a few minutes the router loses internet connectivity. Do you know what can be wrong? Or the place to look for the problem? Sorry but I'm a bit Nook in Networks

I already put it working, although the internet connection keeps dropping, I already find the problems, it loses the connection, either by wireless or wired. Do you have the same problems it your routers?

Yes, I am having same issue, i did disconnect and reconnect to get internet access on wifi

can you look into this: won't work on 3.0.23 / 2.14.87; HTTP body attached · Issue #69 · acecilia/OpenWRTInvasion (github.com)
I'm having the same issue.

Try running exploit again or install this image via tftp.

I tried that, and I'm getting no TFTP requests back from the router:
image

Edit: issue resolved, it was Windows black magic. Check out the github link if you're facing the same issue. won't work on 3.0.23 / 2.14.87; HTTP body attached · Issue #69 · acecilia/OpenWRTInvasion (github.com)

it does, I just tested it - check out this link for full guide: won't work on 3.0.23 / 2.14.87; HTTP body attached · Issue #69 · acecilia/OpenWRTInvasion (github.com)

i wanna understand something , in the router page , it says the wifi is not stable with these device ! does the wifi work or not ?! does it become only lan ? if the wifi work is it bad (weak signal ) , how does it compare to the xiaomi mi 4a gigabit edition as of range and stable wifi connection ? can anyone speak from experience , i wanna buy it and it will be only used throug wifi only, help ...

Wifi works just fine most of the time but rarely it dies. I suggest you to go for mi router 4a gigabit edition because it has 5ghz support.

1 Like

thanks you for your help, i will be buying the mi 4a GE then.

Very Appreciate.

If you could Add IKEv2 VPN Support to Next Firmware It would be best Firmware ever.
Also Add Support 2048 bit Key for Openvpn UDP because It's not working.

Thank you very much.

There is nothing I can do. Builds are official now and I'm no longer involved in compilation process.