Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:xiaomi:xiaomi_mi_router_4c [2020/11/27 23:03] – [Bootlogs] mactavishaotoh:xiaomi:xiaomi_mi_router_4c [2023/02/03 13:21] – [Tags] fix tags danitool
Line 4: Line 4:
 /* DO NOT CREATE NEW DEVICEPAGES VIA COPY & PASTE! */ /* DO NOT CREATE NEW DEVICEPAGES VIA COPY & PASTE! */
 /* USE https://openwrt.org/meta/create_new_device_page */ /* USE https://openwrt.org/meta/create_new_device_page */
 +
 +
 +<WRAP important 100%>**Warning 03/2022** OpenWrt will not work on units fitted with Eon EN25QX128 16MB flash chip at this time.  [[https://forum.openwrt.org/t/new-xiaomi-4c-cannot-install-openwrt-flash-chip-changed-to-en25qx128a/123634|Link for owrt forum]]  Same issue affecting some R4A Gigabit models.</WRAP>  
 +
  
 /*****/ /*****/
Line 10: Line 14:
  
 {{ :media:xiaomi:mi-router-4c.png?400 |}} {{ :media:xiaomi:mi-router-4c.png?400 |}}
 +
 ===== Supported Versions ===== ===== Supported Versions =====
  
Line 19: Line 24:
 ---- ----
  
-===== Experimental Versions ===== 
  
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
-   The official Table of Hardware only lists current, stable versions of OpenWrt.  * 
-   Use this space to describe any on-going efforts to create a newer version       * 
-   of the firmware for this device. Provide links to firmware images,              * 
-   active threads on the forum, or other sources of information.                   * 
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
- 
-//None at this time.// 
  
 ===== Hardware Highlights ===== ===== Hardware Highlights =====
Line 35: Line 31:
 header  : Model, Version,SoC,CPU MHz,Flash MB,RAM MB,WLAN Hardware,WLAN2.4,WLAN5.0,100M ports,Gbit ports,Modem,USB header  : Model, Version,SoC,CPU MHz,Flash MB,RAM MB,WLAN Hardware,WLAN2.4,WLAN5.0,100M ports,Gbit ports,Modem,USB
 align   : c,c,c,c,c,c,c,c,c,c,c,c,c align   : c,c,c,c,c,c,c,c,c,c,c,c,c
-filter  : Brand=Xiaomi 
 filter  : Model=Mi Router 4C filter  : Model=Mi Router 4C
-filter  : Versions~ 
 ---- ----
  
  
 ===== Installation ===== ===== Installation =====
-/* stable release */ 
-/* uncomment once stable release is available 
 ---- datatable ---- ---- datatable ----
 cols    : Model, Versions, Supported Current Rel, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Firmware OEM Stock URL_url cols    : Model, Versions, Supported Current Rel, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Firmware OEM Stock URL_url
Line 50: Line 42:
 filter  : Model=Mi Router 4C filter  : Model=Mi Router 4C
 ---- ----
-*/ 
- 
- 
-/* snapshot */ 
-/* delete once stable release is available */ 
----- datatable ---- 
-cols    : Model, Versions, Supported Current Rel, Firmware OpenWrt snapshot Install URL_url, Firmware OpenWrt snapshot Upgrade URL_url, Firmware OEM Stock URL_url 
-headers : Model, Version, Current Release, Firmware OpenWrt snapshot Install, Firmware OpenWrt snapshot Upgrade, Firmware OEM Stock 
-align   : c,c,c 
-filter  : Model=Mi Router 4C 
----- 
- 
  
 -> [[docs:guide-user:installation:generic.flashing|Install OpenWrt (generic explanation)]] -> [[docs:guide-user:installation:generic.flashing|Install OpenWrt (generic explanation)]]
  
 <WRAP center round important> <WRAP center round important>
-The snapshot version is NOT tested and it does not ship with a GUI. Your initial network configuration needs to be done via uci. Afterwards you can install LuCI for GUI. 
 As of the time of this edit (2019-06-19), some users have reported Wi-Fi to be unstable. Do not attempt to perform firmware updates via Wi-Fi in order to avoid damage to your device. As of the time of this edit (2019-06-19), some users have reported Wi-Fi to be unstable. Do not attempt to perform firmware updates via Wi-Fi in order to avoid damage to your device.
 </WRAP> </WRAP>
Line 73: Line 52:
   - Install python3 and and to PATH if not installed.   - Install python3 and and to PATH if not installed.
   - Install requirements: <code>pip3 install -r requirements.txt</code>   - Install requirements: <code>pip3 install -r requirements.txt</code>
-  - Login to Web panel of your router and copy stok code from URL.+  - Login to Web panel of your router and copy the stok URL parameter out of the address field of your browser.
   - Execute the exploit: <code>python3 remote_command_execution_vulnerability.py</code>   - Execute the exploit: <code>python3 remote_command_execution_vulnerability.py</code>
   - Enter stok and router's IP to command line when it asks to.   - Enter stok and router's IP to command line when it asks to.
Line 86: Line 65:
 ===== Hardware ===== ===== Hardware =====
 ==== Info ==== ==== Info ====
- 
 ---- datatemplatelist dttpllist ---- ---- datatemplatelist dttpllist ----
 template: meta:template_datatemplatelist template: meta:template_datatemplatelist
Line 93: Line 71:
 ---- ----
  
 +==== Photos ====
 +/* =====>>>>> Standard size for photos: add ?400 to the medialink                                */
 +/* When uploading photos, **name them** intelligently. Nobody knows what 20100930_000602.jpg is! */
 +/* e.g. {{:media:yourbrand:yourbrand_yourmodel_front.jpg?400|}}                                  */
 +/* Thanks, your wiki administration - Oct. 2015 */
 +
 +**PCB**
 +
 +{{media:xiaomi:xiaomi-4c-pcb.jpg?400}}
 +
 +**PCB (Close Up)**
 +
 +{{media:xiaomi:xiaomi-4c-pcb-closeup.jpg?400}}
 +
 +{{:media:xiaomi:da00d93cd0c3aaa07be5d65f08e37c8152ec95a9_1_.jpeg?400|}}
 +
 +===== Flash layout =====
 +
 +==== Stock /proc/mtd ====
 +<code>
 +dev:    size   erasesize  name
 +mtd0: 01000000 00010000 "ALL"
 +mtd1: 00020000 00010000 "Bootloader"
 +mtd2: 00010000 00010000 "Config"
 +mtd3: 00010000 00010000 "Factory"
 +mtd4: 00010000 00010000 "crash"
 +mtd5: 00010000 00010000 "cfg_bak"
 +mtd6: 00100000 00010000 "overlay"
 +mtd7: 00c60000 00010000 "OS1"
 +mtd8: 00af0000 00010000 "rootfs"
 +mtd9: 00200000 00010000 "disk"
 +</code>
 +
 +==== OpenWrt snapshot /proc/mtd ====
 +<code>
 +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: 002052ab 00010000 "kernel"
 +mtd8: 00c9ad55 00010000 "rootfs"
 +mtd9: 00a10000 00010000 "rootfs_data"
 +</code>
 +
 +
 +===== OpenWrt back to STOCK ====
 +
 +0. Consider OpenWrt factory reset first
 +<code>firstboot && reboot</code>
 +1. Download STOCK firmware
 +  * [[https://www21.zippyshare.com/v/8fLuz2na/file.html|miwifi_r4cm_firmware_2.14.80_Chinese.bin]]
 +  * [[https://www21.zippyshare.com/v/v91hZbQb/file.html|miwifi_r4cm_firmware 3.0.16_ENG.bin]]
 +  * [[https://www21.zippyshare.com/v/NOJXNubW/file.html|miwifi_r4cm_firmware_3.0.23_INT.bin]]
 +2. Copy to router
 +<code>scp miwifi_r4cm_firmware 3.0.16_ENG.bin root@192.168.1.1:/tmp/</code>
 +3. Write to "firmware" block
 +<code>mtd -r write /tmp/miwifi_r4cm_firmware 3.0.16_ENG.bin firmware</code>
 +4. Router will reboot and after few minutes will boot into stock firmware with IP address 192.168.31.1
  
 +===== Debricking ====
 +Using Mi Wifi Repair tool:
 +[[http://www1.miwifi.com/miwifi_download.html|Mi Wifi download]]
 +[[https://www.dropbox.com/s/bwkc11ntp2t8ryc/How%20to%20use%20MIWIFIRepairToolx86.pdf?dl=0|PDF guide]] (written for R4A gigabit edition) \\
 +[[https://www.virustotal.com/gui/file/436e57a5e2daf1c5b4ece8851a7b7517c1fbc9e69acba8fac3806aa160f251b5/detection|Numerous antivirus tools report Mi Wifi Repair Tool (files date stamped January 2019) identify it as a 'Potentially Unwanted App' Unclear whether there is a genuine threat or it is a 'false positive'.]]
 +\\ 
  
 +===== Hardware Mod - USB Port ====
  
 +See the photos for break down of where to solder etc.
 +On picture are shown all soldier points for desired pins with markings.
 +Also you must connect 15kOhm resistors to ground from D+ and D- lines.
  
 +**Software mod**
  
 +Simple hardware mod does not enable USB, you must enable OHCI and AHCI in board description file and compile appropriate firmware.
 +Board description file is on location <code>/{your openwrt source location}/openwrt/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts</code>
  
 +In this file change:
 +<code>
 +&ehci {
 + status = "disabled";
 +};
 +&ohci {
 + status = "disabled";
 +};
 +</code>
 +to
  
-==== OEM bootlog ==== +<code> 
-<WRAP bootlog> +&ehci { 
-<nowiki>COPY HERE THE BOOTLOG WITH THE ORIGINAL FIRMWARE</nowiki> +status "okay"; 
-</WRAP>\\+}; 
 +&ohci { 
 +status "okay"; 
 +}; 
 +</code>
  
 +Enable usb kernel module support in "make menuconfig", compile firmware file and flash it.
  
-===== Notes ===== +<wrap warning> You can use 5V power supply from router for powering on USBbut take care because its only 1A of current charge if you connect some power hungry USB peripheral it will make router unstable.</wrap>
-//Space for additional noteslinks to forum threads or other resources.//+
  
-  * ... 
  
 ===== Tags ===== ===== Tags =====
  
 [[meta:tags|How to add tags]] [[meta:tags|How to add tags]]
-{{tag>ramips MT7628 16flash 64ram 3port}}+{{tag>ramips MT7628 16flash 64ram 3port fastethernet USBmod wlan 802.11bgn MIPS}}
  • Last modified: 2024/02/12 11:13
  • by 127.0.0.1