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 22:56] 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 83: Line 62:
   - Install OpenWrt to OS1: <code>mtd -r write /tmp/openwrt.bin OS1</code>   - Install OpenWrt to OS1: <code>mtd -r write /tmp/openwrt.bin OS1</code>
   - It will take couple of minutes and will be restarted to OpenWrt.   - It will take couple of minutes and will be restarted to OpenWrt.
-===== Upgrading OpenWrt ===== 
-->  [[docs:guide-user:installation:generic.sysupgrade]] 
- 
-<WRAP BOX> 
- 
-FIXME These are generic instructions. Update with your router's specifics. 
- 
-==== LuCI Web Upgrade Process ==== 
- 
-  * Browse to ''<nowiki>http://192.168.1.1/cgi-bin/luci/mini/system/upgrade/</nowiki>'' LuCI Upgrade URL 
-  * Upload image file for sysupgrade to LuCI 
-  * Wait for reboot 
- 
-==== Terminal Upgrade Process ==== 
- 
-If you don't have a GUI (LuCI) available, you can alternatively upgrade via the command line. 
-There are two command line methods for upgrading: 
- 
-  * ''sysupgrade'' 
-  * ''mtd'' 
- 
-Note: It is important that you put the firmware image into the ramdisk (/tmp) before you start flashing. 
- 
-=== sysupgrade === 
- 
-  * Login as root via SSH on 192.168.1.1, then enter the following commands: 
- 
-<code> 
-cd /tmp 
-wget http://downloads.openwrt.org/snapshots/trunk/XXX/xxx.abc 
-sysupgrade /tmp/xxx.abc 
-</code> 
- 
-=== mtd === 
- 
-If ''sysupgrade'' does not support this router, use ''mtd''. 
- 
-  * Login as root via SSH on 192.168.1.1, then enter the following commands: 
- 
-<code> 
-cd /tmp 
-wget http://downloads.openwrt.org/snapshots/trunk/XXX/xxx.abc 
-mtd write /tmp/xxx.abc linux && reboot 
-</code> 
- 
-</WRAP> 
- 
-===== Debricking ===== 
--> [[docs:guide-user:troubleshooting:generic.debrick]] 
- 
-===== Failsafe mode ===== 
--> [[docs:guide-user:troubleshooting:failsafe_and_factory_reset]] 
- 
-===== Basic configuration ===== 
--> [[docs:guide-user:base-system:start|Basic configuration]] After flashing, proceed with this.\\ 
-Set up your Internet connection, configure wireless, configure USB port, etc. 
- 
-===== Specific Configuration ===== 
- 
-<WRAP BOX> 
-FIXME Please fill in real values for this device, then remove the EXAMPLEs 
- 
-==== Network interfaces ==== 
-The default network configuration is: 
-^ Interface Name   ^ Description                  ^ Default configuration    ^ 
-| br-lan           | EXAMPLE LAN & WiFi           | EXAMPLE 192.168.1.1/24   | 
-| vlan0 (eth0.0)   | EXAMPLE LAN ports (1 to 4)   | EXAMPLE None             | 
-| vlan1 (eth0.1)   | EXAMPLE WAN port             | EXAMPLE DHCP             | 
-| wl0              | EXAMPLE WiFi                 | EXAMPLE Disabled         | 
- 
-</WRAP> 
- 
-==== Switch Ports (for VLANs) ==== 
-<WRAP BOX> 
-FIXME Please fill in real values for this device, then remove the EXAMPLEs 
- 
-Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit, 5 is the internal connection to the router itself. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on. 
-^ Port             ^ Switch port   ^ 
-| Internet (WAN)   | EXAMPLE 4     | 
-| LAN 1            | EXAMPLE 3     | 
-| LAN 2            | EXAMPLE 2     | 
-| LAN 3            | EXAMPLE 1     | 
-| LAN 4            | EXAMPLE 0     | 
- 
-</WRAP> 
- 
-==== Buttons ==== 
--> [[docs:guide-user:hardware:hardware.button]] on howto use and configure the hardware button(s). 
-Here, we merely name the buttons, so we can use them in the above Howto. 
- 
-<WRAP BOX> 
-FIXME Please fill in real values for this device, then remove the EXAMPLEs 
- 
-The Xiaomi Mi Router 4C has the following buttons: 
- 
-^ BUTTON                       ^ Event   ^ 
-| EXAMPLE Reset                |  reset  | 
-| EXAMPLE Secure Easy Setup    |   ses   | 
-| EXAMPLE No buttons at all.      -    | 
- 
-</WRAP> 
  
 ===== Hardware ===== ===== Hardware =====
 ==== Info ==== ==== Info ====
-<WRAP BOX> 
-FIXME 
-  - This table is automatically generated, **once the correct filters for Brand and Model are set.** 
-  - If you see "Nothing." instead of a table, please **edit this section and adjust the filters with the proper Brand and Model.** Just try, it's easy. 
-  - If you still don't see a table here, or a table filled with '¿': [[toh:start|Is there already a Techdata page available]] for Xiaomi Mi Router 4C ? If not: [[meta:create_new_dataentry_page|Create one]]. 
-  - If you see a table with the desired device data, everything is OK and you can delete this text and the ''<nowiki><WRAP></nowiki>'' that encloses it. 
-  - If it still doesn't work: Don't panic, calm down, take a deep breath and [[:contact|contact a wiki admin]] (tmomas) for help. 
-</WRAP> 
- 
 ---- datatemplatelist dttpllist ---- ---- datatemplatelist dttpllist ----
 template: meta:template_datatemplatelist template: meta:template_datatemplatelist
 cols    : Brand, Model, Versions, Device Type, Availability, Supported Since Commit_git, Supported since Rel, Supported current Rel, Unsupported, Bootloader, CPU, Target, CPU MHz, Flash MBs, RAM MB, Switch, Ethernet 100M ports_, Ethernet Gbit ports_, Comments network ports_, Modem, VLAN, WLAN 2.4GHz, WLAN 5.0GHz, WLAN Hardwares, WLAN Comments_, Detachable Antennas_, USB ports_, SATA ports_, Comments USB SATA ports_, Serial, JTAG, LED count, Button count, Power supply, Device Techdata_pageid, Forum topic URL_url, wikidevi URL_url, OEM Device Homepage URL_url, Firmware OEM Stock URL_url, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Comments_ cols    : Brand, Model, Versions, Device Type, Availability, Supported Since Commit_git, Supported since Rel, Supported current Rel, Unsupported, Bootloader, CPU, Target, CPU MHz, Flash MBs, RAM MB, Switch, Ethernet 100M ports_, Ethernet Gbit ports_, Comments network ports_, Modem, VLAN, WLAN 2.4GHz, WLAN 5.0GHz, WLAN Hardwares, WLAN Comments_, Detachable Antennas_, USB ports_, SATA ports_, Comments USB SATA ports_, Serial, JTAG, LED count, Button count, Power supply, Device Techdata_pageid, Forum topic URL_url, wikidevi URL_url, OEM Device Homepage URL_url, Firmware OEM Stock URL_url, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Comments_
-filter  : Brand=Xiaomi 
 filter  : Model=Mi Router 4C filter  : Model=Mi Router 4C
-filter  : Versions= 
 ---- ----
  
Line 210: Line 77:
 /* Thanks, your wiki administration - Oct. 2015 */ /* Thanks, your wiki administration - Oct. 2015 */
  
-//Front://\\ +**PCB**
-**Insert photo of front of the casing**+
  
-//Back://\\ +{{media:xiaomi:xiaomi-4c-pcb.jpg?400}}
-**Insert photo of back of the casing**+
  
-//Backside label://\\ +**PCB (Close Up)**
-**Insert photo of backside label**+
  
-==== Opening the case ====+{{media:xiaomi:xiaomi-4c-pcb-closeup.jpg?400}}
  
-**Note:** This will void your warranty!+{{:media:xiaomi:da00d93cd0c3aaa07be5d65f08e37c8152ec95a9_1_.jpeg?400|}}
  
-<WRAP BOX> +===== Flash layout =====
-FIXME //Describe what needs to be done to open the device, e.g. remove rubber feet, adhesive labels, screws, ...// +
-  * To remove the cover and open the device, do a/b/c +
-</WRAP>+
  
-//Main PCB://\\ +==== Stock /proc/mtd ==== 
-**Insert photo of PCB**+<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>
  
-==== Serial ==== +==== OpenWrt snapshot /proc/mtd ==== 
--[[docs:techref:hardware:port.serial]] general information about the serial port, serial port cable, etc.+<code> 
 +dev   size   erasesize  name 
 +mtd000020000 00010000 "bootloader" 
 +mtd100010000 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>
  
-How to connect to the Serial Port of this specific device:\\ 
-**Insert photo of PCB with markings for serial port** 
  
-<WRAP BOX> +===== OpenWrt back to STOCK ====
-FIXME //Replace EXAMPLE by real values.// +
-</WRAP>+
  
-^ Serial connection parameters\\ for Xiaomi Mi Router 4C @@Version@@ EXAMPLE 115200, 8N1 |+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
  
-==== JTAG ==== +===== Debricking ===
--> [[docs:techref:hardware:port.jtag]] general information about the JTAG port, JTAG cable, etc.+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'.]] 
 +\\ 
  
-How to connect to the JTAG Port of this specific device:\\ +===== Hardware Mod - USB Port ====
-**Insert photo of PCB with markings for JTAG port**+
  
-===== Bootloader mods ===== +See the photos for break down of where to solder etc. 
--> [[docs:techref:bootloader]]+On picture are shown all soldier points for desired pins with markings. 
 +Also you must connect 15kOhm resistors to ground from D+ and Dlines.
  
-===== Hardware mods =====+**Software mod**
  
-None so far.+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
  
-===== Bootlogs ===== +<code> 
-==== OEM bootlog ==== +&ehci { 
-<WRAP bootlog> +status "okay"; 
-<nowiki>COPY HERE THE BOOTLOG WITH THE ORIGINAL FIRMWARE</nowiki> +}; 
-</WRAP>\\+&ohci { 
 +status "okay"; 
 +}; 
 +</code>
  
-==== OpenWrt bootlog ==== +Enable usb kernel module support in "make menuconfig", compile firmware file and flash it.
-<WRAP bootlog> +
-<nowiki>COPY HERE THE BOOTLOG ONCE OPENWRT IS INSTALLED AND RUNNING</nowiki> +
-</WRAP>\\+
  
-===== 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