OpenWrt for Xiaomi Mi Router 4C

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