OpenWrt for Xiaomi Mi Router 4C

I'm not sure.

1 Like

OK, I will wait to stay locally to update.

Regards.

Already tried using this image however after a few hours of testing and using my router, my wireless AP gets disconnected randomly. Upon further checking, I saw some of these logs:

[ 3132.376872] rt3050-esw 10110000.esw: link changed 0x14
[ 3363.864118] rt3050-esw 10110000.esw: link changed 0x16
[25488.142417] rt3050-esw 10110000.esw: link changed 0x14
[25923.085644] rt3050-esw 10110000.esw: link changed 0x16
[25997.107528] rt3050-esw 10110000.esw: link changed 0x06
[26012.364489] rt3050-esw 10110000.esw: link changed 0x16
[26023.572812] rt3050-esw 10110000.esw: link changed 0x06
[26026.159816] rt3050-esw 10110000.esw: link changed 0x16
[26093.035030] rt3050-esw 10110000.esw: link changed 0x14
[26122.306629] rt3050-esw 10110000.esw: link changed 0x16
[26232.068766] rt3050-esw 10110000.esw: link changed 0x14
[26245.262659] rt3050-esw 10110000.esw: link changed 0x16
[26289.308509] rt3050-esw 10110000.esw: link changed 0x14
[26336.207169] rt3050-esw 10110000.esw: link changed 0x16
[41273.628753] rt3050-esw 10110000.esw: link changed 0x12
[41275.251216] rt3050-esw 10110000.esw: link changed 0x16
[41281.279571] rt3050-esw 10110000.esw: link changed 0x12
[66986.802467] rt3050-esw 10110000.esw: link changed 0x16
[66990.265095] rt3050-esw 10110000.esw: link changed 0x12
[66993.063303] rt3050-esw 10110000.esw: link changed 0x16
[66996.811015] rt3050-esw 10110000.esw: link changed 0x12
[66999.551367] rt3050-esw 10110000.esw: link changed 0x16
[67006.281990] rt3050-esw 10110000.esw: link changed 0x12
[67009.100168] rt3050-esw 10110000.esw: link changed 0x16
[89233.465712] rt3050-esw 10110000.esw: link changed 0x00
[89233.503159] device wlan0 left promiscuous mode
[89233.503286] br-lan: port 2(wlan0) entered disabled state
[89233.940585] br-***********: port 2(wlan0-1) entered disabled state

Installed packages are SQM-QOS, NFT-QOS, MWAN3, SNMPD and OPENVPN.

What should I do with this error?

And noticed I am having this error:

[73425.599643] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[73425.605933] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[73425.605951] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02c88000, max=1024, ctx=292, dtx=292, fdx=110, next=292
[73425.605966] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=02db8000, max=1024, calc=554, drx=555
[73433.077299] do_page_fault(): sending SIGSEGV to snmpd for invalid read access from 00000014
[73433.077312] epc = 77de414f in libnetsnmpmibs.so.35.0.0[77dcb000+4d000]
[73433.077339] ra = 77de4139 in libnetsnmpmibs.so.35.0.0[77dcb000+4d000]
[73435.599377] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[73435.605668] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[73435.605686] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02c88000, max=1024, ctx=125, dtx=125, fdx=38, next=125
[73435.605701] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=0248c000, max=1024, calc=249, drx=250
[82185.343896] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[82185.350201] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[82185.350220] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02c88000, max=1024, ctx=978, dtx=978, fdx=918, next=978
[82185.350235] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=02db8000, max=1024, calc=719, drx=720
[82195.343543] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[82195.349834] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[82195.349852] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02db8000, max=1024, ctx=459, dtx=459, fdx=449, next=459
[82195.349866] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=034b8000, max=1024, calc=304, drx=305
[82205.343226] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[82205.349517] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[82205.349535] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02db8000, max=1024, ctx=317, dtx=317, fdx=153, next=317
[82205.349549] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=0346c000, max=1024, calc=326, drx=327
[82215.342924] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[82215.349217] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[82215.349234] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02db8000, max=1024, ctx=252, dtx=252, fdx=16, next=252
[82215.349250] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=0248c000, max=1024, calc=171, drx=172
[85030.232139] mtk_soc_eth 10100000.ethernet eth0: transmit timed out
[85030.238435] mtk_soc_eth 10100000.ethernet eth0: dma_cfg:00000055
[85030.238452] mtk_soc_eth 10100000.ethernet eth0: tx_ring=0, base=02db8000, max=1024, ctx=724, dtx=724, fdx=682, next=724
[85030.238467] mtk_soc_eth 10100000.ethernet eth0: rx_ring=0, base=02c88000, max=1024, calc=120, drx=121

this is know bug for 19.07.4 stable. both my mt7628 and mt7620 have this problem.

1 Like

Now it's officially supported: http://downloads.openwrt.org/snapshots/targets/ramips/mt76x8/openwrt-ramips-mt76x8-xiaomi_mi-router-4c-squashfs-sysupgrade.bin

3 Likes

Hello MacTavish,

"19.07.4 STABLE release" : just out of the box (eg cleared config), the wifi still sucks. 800Kbit/s. Distance 1 meter between antennas....

Is "/snapshots/targets/ramips/mt76x8/openwrt-ramips-mt76x8-xiaomi_mi-router-4c-squashfs-sysupgrade.bin" equal to your 19.07.4 ?

Note:
with the previous build, setting force Wifi N/legacy did not change anything

Not N/Legacy. Only N and tick "Force 40MHz mode" in Advanced Settings.

Sad :frowning:

I tried this one but it seems luci is not installed. uhttpd is not working either.

I will try. Thank you.

just FYI
Now (i think) it is official image, the opkg update software returns some upgradable packages. Some of them seem ready long before this image. Strange or I missinterpret the names

  • uci 2019-09-01-415f9e48-3 » 2019-09-01-415f9e48-4
  • firewall 2019-11-22-8174814a-2 » 2019-11-22-8174814a-3
  • libuci20130104 2019-09-01-415f9e48-3 » 2019-09-01-415f9e48-4

Hi mr.Mac i used your openwrt ver. for xi 4c router but some of them the wifi power is 14 dbm and the other is 20 dbm how can i convert 14 into 20 is it possible

i installed your openwrt in 120 devices and will be more
thank u

1 Like

Some variants of 4C has 20 dBm option while others has 14. I'm guessing it's limited on eeprom. I don't know why it's limited like that but I'm guessing it involves where it's produced.

1 Like

The country code (wifi adv settings) you select imposes the local restrictions on the wifi, power, channels and probably other 'max' settings.

I unchecked "allow legacy 802.11 rates"
I unchecked "Force 40MMhz mode" in adv settings

This immediately effect the TX/RX with my test machine
If I remember well, the slowdown occurs after 'some time' of usage.

but it is slow anyway (distance 1 meter)
Download 4.2Mbps (from internet) should be 40 to 54Mbps
Upload 10.0Mbps

I have just gotten a Mi Router 4C model: R4CM
It does not specify a firmware version but this is what is says on http://router.miwifi.com/cgi-bin/luci/diagnosis;
Version: MiWiFi Rom 3.0.16 Stable
I can't find my way to a URL with the stock value in the URL.

http://192.168.31.1/ redirect to http://192.168.31.1/cgi-bin/luci/web but no where a stock value to be found in the URL

Does anyone have a suggestion I could try?

PS. I can no longer login. it rejects my earlier set password. go figure. it's forcing me to isntall an app I don't trust :wink:

EDIT: Can login now with password = admin and have gotten a stock value now.
Shall I just plow through or is this version a no go?

/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