Replacing the firmware

This document describes how to install Mudfish Firmware on the genuine “Xiaomi Mi Wi-Fi Nano / Youth (R1CL)” router.

Warning

This document is based on the assumption that you are familiar with using the console / terminal / command prompt.

Prepare

  1. Buy “Xiaomi Mi Wi-Fi Nano / Youth (R1CL)” router at online shopping malls.

  2. Connect the power to the router. Then connect the computer to LAN port (not WAN port)

  3. Download ‘official developer ROM’ of Mi Wi-FI project. The available links are available in here(1) and here(2).

  4. For Windows users, prepare curl and putty.

Install official developer ROM

Now when you are ready, you need to install the official developer ROM on the genuine “Xiaomi Mi Wi-Fi Nano / Youth (R1CL)” router.

  1. Connect the power to Xiaomi router. Connect the computer to work on LAN port (one of two white ports). WAN port (blue port) connects to the router which the Internet is connected.

  2. Verify that the ping is successfully delivered to the 192.168.31.1 IP at the terminal or command prompt.

  3. After confirming the ping works fine, please login at http://192.168.31.1 The first time you log in, there are some user password settings, Wi-Fi SSID settings. Please set it as simple as possible because it is supposed to overwrite again anyway.

  4. Go to the Updating menu on the upper right, select Firmware and specify how to update. If there is a warning message for downgrading, ignore it.

    Under “Check for updates” section, there is a button called “Update manually” which you can click on to upload.

  5. Now wait five to seven minutes. Verify that the ping is successfully delivered to the 192.168.31.1 IP at the terminal or command prompt.

SSH login

If it is replaced properly with the developer ROM, you should log in to SSH and connect to the router.

  1. If you ping the router after replacing the firmware, you will now need to set the root password to log in to SSH.

  2. Please login to http://192.168.31.1/ using your browser and enter the user password you set before to login.

  3. If you look at the URL after logging in, you will see “stok” at URL, please copy this part and replace it with the following command.

    # curl -d "oldPwd=your_admin_pass&newPwd=desired_root_pass" \
      "http://192.168.31.1/cgi-bin/luci/;stok=<stok from browser url>/api/xqsystem/set_name_password"
    

    If it runs properly, you should get {"code":0} response.

  4. Now connect to the router with the ssh command or putty.

    # ssh root@192.168.31.1
    
  • If you can not connect to the router with SSH, you can enable telnet instead of SSH by using the following command.

    # curl http://192.168.31.1/cgi-bin/luci/;stok=<stok from browser url>/api/xqnetwork/set_wifi_ap?ssid=tianbao&encryption=NONE&enctype=NONE&channel=1%3B%2Fusr%2Fsbin%2Ftelnetd
    {"msg":"未能连接到指定WiFi(Connecting)","code":1616}
    

    After connecting to Telnet (port 23) to 192.168.31.1, please try to work on SSH connection by entering the following commands in order.

    # sed -i ":x;N;s/if [.\; then\n.return 0\n.*fi/#tb/;b x" /etc/init.d/dropbear
    # /etc/init.d/dropbear start
    # nvram set ssh_en=1
    # nvram commit
    

Install OpenWRT

You are now ready to install OpenWRT.

  1. Use the following command to download the OpenWRT firmware image to the /tmp directory.

    # cd /tmp
    # wget http://downloads.openwrt.org/releases/18.06.1/targets/ramips/mt76x8/openwrt-18.06.1-ramips-mt76x8-miwifi-nano-squashfs-sysupgrade.bin
    
  2. When the download is complete, flash the image.

    # mtd -r write /tmp/openwrt-18.06.1-ramips-mt76x8-miwifi-nano-squashfs-sysupgrade.bin firmware
    
  3. Wait 5 to 7 minutes for the image to flash and reboot. When the installation is completed, the router will be automatically rebooted.

    Unplug and plug the cable which connected with the computer Of course you have to plug in white LAN port. Not to blue LAN port.

  4. Now verify that the ping is properly delivered to the 192.168.1.1 IP at the terminal or command prompt. 192.168.31.1 IP is no longer used.

  5. Now connect to the router with the ssh command or putty.

    # ssh root@192.168.1.1
    

Install Mudfish

Now is the time to install the Mudfish package. For detailed installation instructions, please refer to Installation (for Router) section.