Xiaomi mini router flash openwrt

The first electronic product I bought in 2018 was the Xiaomi mini router with 16MB of ROM. Before buying it, I thought about it, I want to flash Linux (openwrt), and after flashing openwrt, there is still room to write some scripts, or save a program that starts running.

The flashing process of the Xiaomi router is quite troublesome. You have to flash from the stable version to the development version, and then flash SSH to open the package from the development version, and then you can connect and flash.

  1. Stable -> Development

    The stable version of the Xiaomi router cannot enable the SSH login function, and the development version needs to be flashed.

    • Go to MiWiFi to download the ROM for Mini development version, version 2.17.100;
    • Find a U disk, delete all data and partitions on the disk, recreate the partition, and format it as FAT32;
    • Put the downloaded ROM package in the root directory of the U disk and name it "miwifi.bin";
    • Insert the U disk into the USB port of the router -> power off -> press and hold the Reset key -> power on the router and start flashing;
    • When the indicator light of the router turns yellow and flashes, release the reset; after about 3-5 minutes, when the indicator light turns solid yellow, unplug the USB flash drive. At this time, the flashing machine has completed and is restarting. Wait for a while for the indicator light of the router. It can be used normally when it turns blue.

    Now the Xiaomi router has been flashed from the stable version when it was purchased to the development version.

  2. Development version -> open the development version of SSH

    Since the Xiaomi router does not have a direct way to display information, it can only use the SSH tool to connect to the router, so the SSH function needs to be enabled.

    • Go to MiWiFi to download and open the SSH tool;
    • Log in to the website and think it can be downloaded, but the result is not, but also bind the router (Xiaomi company does not recommend users to enable SSH permissions, for fear that the user will find it for repair after flashing damage, bind the router to know the machine code such as the ID of each machine ), agree to the agreement, and voluntarily give up Xiaomi's warranty service, well, we agree; at this time, the root password of the Xiaomi router will be given on the page, which is used when connecting to the router via SSH;
    • Download and open the SSH tool - miwifi_ssh.bin;
    • Delete all files on the U disk, copy miwifi_ssh.bin to the U disk;
    • Insert the U disk into the USB port of the router -> power off -> press and hold the Reset key -> power on the router and start flashing;
    • When the indicator light of the router turns yellow and flashes, release the reset; after about 3-5 minutes, when the indicator light turns solid yellow, unplug the USB flash drive. At this time, the flashing machine has completed and is restarting. Wait for a while for the indicator light of the router. It can be used normally when it turns blue.

    Now, the Xiaomi router has been successfully flashed into the development version, and the SSH function has been turned on, and the next step of flashing can be performed.

  3. Open the development version of SSH -> openwrt

    • Go to the download center of the openwrt official website to find the flashing package of the Xiaomi mini router (R1C) and download it;
    • Connect the Linux host to the Xiaomi router (192.168.31.1) via SSH, enter the username/password, and enter the system;
    • The Linux host copies the openwrt flash package into the Xiaomi router and writes the firmware
         Linux  $ scp openwrt.bin  [email protected]:/tmp
        xiaomi  # cd  /tmp
        xiaomi  # mtd -r write openwrt.bin  firmware 
      
      As a result, the flashing was unsuccessful. Later, due to Baidu, I learned that when the Xiaomi mini router produced later was flashed, the parameters were not firmware, but changed to OS1.
        # mtd -r write openwrt.bin OS1
      
      No errors were reported, the flashing was successful.
  4. Connect the router and set it up

    After successfully flashing the machine, I am very happy. Next, I am faced with a problem: after flashing the openwrt system, what is the IP address of the router? What is the username/password? There was a feeling of black eyes at the time! ! !

    I thought about it, I didn't have direct Baidu, I checked the IP address of the interface (network port) connected to the router, and it was 192.168.1.228. I guessed that the router IP was on this network segment, but how much? I tried to ping 192.168.1.1 and it worked. Haha, the original address was 192.168.1.1.

    What about username/password? I think the user name should be root. I don't know the password yet. After trying different passwords such as linux, LINUX, Linux, openwrt, OPENWRT, 123456, 12345678, etc., I tried admin by chance, and I was so happy. My Xiaomi router finally went in, what a familiar feeling, haha.


The flashing process is finally completed. The process of flashing the Xiaomi router is quite troublesome, mainly due to network problems: I don’t have a wired network, and the only device that can connect to the Internet is my mobile phone. It is really big to open the network connection to the MiWiFi website. However, the binding of the router is finally completed when switching between different networks.

After SSH connection into the router, I checked the list of installed software, and found that there are several software that I do not need myself, which take up storage space and waste CPU and memory. You know, these three are very nervous on Xiaomi routers and must be reduced. Unnecessary software, plan to compile the source code of OPENWRT by yourself to get the system you expect.

        opkg  list-installed

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325992082&siteId=291194637