Support for Xiaomi Mi 3C

Alright. Thanks for information.

Ok finally finish. Only need final review for @minax007 because my english is very bad ahahhaha

For problem if router use all antennas or not, I inpect and confirm that is working with 2T2R

root@OpenWrt:~# iw phy0 info
Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 4
	max scan IEs length: 2257 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports AP-side u-APSD.
	Device supports T-DLS.
	Available Antennas: TX 0x3 RX 0x3
	Configured Antennas: TX 0x3 RX 0x3
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
		 * P2P-client
		 * P2P-GO
	Band 1:
		Capabilities: 0x1fe
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: No restriction (0x00)
		HT TX/RX MCS rate indexes supported: 0-15
		Frequencies:
			* 2412 MHz [1] (22.0 dBm)
			* 2417 MHz [2] (22.0 dBm)
			* 2422 MHz [3] (22.0 dBm)
			* 2427 MHz [4] (22.0 dBm)
			* 2432 MHz [5] (22.0 dBm)
			* 2437 MHz [6] (22.0 dBm)
			* 2442 MHz [7] (22.0 dBm)
			* 2447 MHz [8] (22.0 dBm)
			* 2452 MHz [9] (22.0 dBm)
			* 2457 MHz [10] (22.0 dBm)
			* 2462 MHz [11] (22.0 dBm)
			* 2467 MHz [12] (disabled)
			* 2472 MHz [13] (disabled)
			* 2484 MHz [14] (disabled)
	valid interface combinations:
		 * #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 4,
		   total <= 4, #channels <= 1, STA/AP BI must match
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Supported extended features:
		* [ RRM ]: RRM
		* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
		* [ AIRTIME_FAIRNESS ]: airtime fairness scheduling
		* [ AQL ]: Airtime Queue Limits (AQL)
		* [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
		* [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
		* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
		* [ DEL_IBSS_STA ]: deletion of IBSS station support
		* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
		* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
4 Likes

Dear @eduardo010174

Thats excellent. Thank you very much!

I have read through the new description and would propose following changes:


OEM firmware uses VLAN's to create the network interface for WAN and LAN.

Bootloader info:
The stock bootloader uses a "Dual ROM Partition System". OS1 is a deep copy of OS2.
To start the default bootloader you need to start OS2.
To force start OS1 it is needed to set "flag_try_sys2_failed=1".

How to install:
1- Use OpenWRTInvasion to gain telnet, ssh and ftp access:

(IP: 192.168.31.1 - Username: root - Password: root)
2- Connect to router using telnet or ssh.
3- Backup all partitions. Use command "dd if=/dev/mtd0 of=/tmp/mtd0". Copy /tmp/mtd0 to computer using ftp.
4- Copy openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin to /tmp in router using ftp.
5- Enable UART access and change start image for OS1.

nvram set uart_en=1
nvram set flag_last_success=1
nvram set boot_wait=on
nvram set flag_try_sys2_failed=1
nvram commit

6- Install OpenWrt on OS1 and erase OS2.

mtd erase OS1
mtd erase OS2
mtd -r write /tmp/openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin OS1

Limitations: For the first install the image size needs to be less than 7,733,248 bits.

Thanks for all community and especially for this device:
minax007, earth08, S.Farid

2 Likes

Ok, I change low description on bootloader.
I update pull request and re-request review.

2 Likes

Thank you eduardo and minax for hard work on this device. Next step mi-3c wiki page should be updated. Goodluck.

Sad that mt76 driver makes this firmware quite useless, if you want to rely on wireless networks.

Wait if it's accept or not ...

2 Likes

Lets hope that it would be accepted.

Adrian reply on weekend only. It's need wait ...

1 Like

Alright. And one question İ have. Do mi-3c openwrt firmware as good as stock one?

It depends on what you understand by "good".

Advantages of OpenWrt:
It offers much more flexibility and extendibilty.
It is open source.

Potential disadvantage of OpenWrt:
As it uses open source drivers it could be that the WiFi performance is weaker.

1 Like

İ am not about that. About stability of wifi. Because nano openwrt would disconnect clients often. And then you should turn off device and wait about 30mins, for able to connect to wifi.

Openwrt advantages was:

  1. Stock like speed (21.02 version)
  2. Flexibility (like minax said)
  3. Updates (final stock update was in 2019)

Openwrt disadvantages was:

  1. Not officially released for mi-3c (İ hope that eduardo's build will be approved by adrian)
  2. Random disconnects (clients gets disconnect and cant connect back)
  3. Wifi instability sometimes (İ think its because of nano firmware cant use all 4 antennas)

@S.Farid @minax007 @earth08

Now it's on hands of Adrian ...
Good work team.

3 Likes

Dear @eduardo010174

Wow!!!

Congratulations!

This success is primarily the result of your expertise and your hard work.

We were just supporting ... but you were the one who did the programming.

Looking back on all the discussions we have had during the last months it was a great pleasure working with a kind person and expert like you.

May God protect and guide you along your life.

1 Like

Congratulations eduardo. And thanks for your hard work on mi-3c. Goodluck.

1 Like

Dear @eduardo010174 ,
Congrats,
Great work and devotion for mi3c device.
you are hero for mi3c
now this this device and ppl will get powerful device, with the great development done by you.
hats off for you.
thanks.

1 Like

eduardo do we need to wait for adrian's merge?

it's merged. Adrian write changes on merge. I need test and change wiki.
Team more work.
I need prepare for revert to stock.

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=3c97fb4346d11ab3e7cc453ffd7b66b4b9140aec

1 Like

Goodluck on that one too. İs there any help we can do?

Dear @eduardo010174

the easiest way to revert to stock, in case you do not want to open the case and do not want to use the SPI flasher, is to install BREED and then to flash a full stock firmware including the stock bootloader in BREED.

Do you need a dump of the full stock firmware?