OpenWrt is an embedded operating system based on Linux. You will get full power of Linux in your home router. OpenWrt has a lot of powerful features that default firmware doesn’t offer. I tried other custom firmware for my Xiaomi Router 3 but I found that Pandorabox (OpenWrt based firmware) is an absolute killer! I’ve been using Pandorabox for almost a year and found no issue.
Let’s see what OpenWrt offers besides the default Xiaomi’s Chinese firmware:
- Supports ALL kinds of popular VPN protocols. (OpenVPN, L2TP, PPTP…)
- Torrent client. You don’t need to always power up your PC for downloading/seeding the big torrent files anymore. Your router will work as a low powered Seedbox.
- Run various servers. You can run a web server, a proxy server, IRC server and more!
- Using QoS (quality of service) which handles the packets travelling through your router. You can prioritize certain types of traffic with QoS. This is my favorite use case as I can reduce the lag while gaming by properly configuring the QoS.
- Capture the network traffic. You can capture the network traffic by using various network tools and analyze that traffic later. Useful to the network admin
- Real time accurate bandwidth monitoring and throttling.
- Monitor internet connectivity
- Ad blocking
and much much more. OpenWrt’s software repositories contain other packages that extends more functionality.
NOTE: There is no mobile app to control OpenWrt firmware as Xiaomi firmware does. Also, it is not easy to configure OpenWrt firmware. You need to have absolute patience and troubleshooting capability in order to configure it like the way you want. Also, if you are not a techie person, I will not recommend you to proceed.
I will not take any responsibility if you brick your router by incorrectly following this tutorial. Though I’ve tested every steps several times and successfully install OpenWrt on my Xiaomi Router. I’ve bricked my router many times in order to find the right steps :p
Some basic knowledge of Linux commands and SSH are necessary.
Note: if you brick your router, please follow Recovering from softbrick
If still not solved, please post your issue to the support forum. I will suggest you to take your time and read this support forum from the beginning. It holds lots of useful information regarding flashing and recovering.
Let’s begin (bricking or succeeding? :p )
What you need:
1. Xiaomi Mi WiFi Router 3 (2 100Mbps non gigabit LAN ports)
2. LAN Cable
3. USB Drive
4. Enough time
5. Brain/common sense
Step 1: Downgrading the official Xiaomi firmware to dev build
1.1. First, assuming that you are using official Xiaomi firmware. Backup your settings if you needed. Now, we need to downgrade to the dev build in order to enable SSH service. So download dev firmware from here:
1.2. Put downloaded “miwifi_r3_all_55ac7_2.11.20.bin” file on FAT/FAT32 formatted USB drive and rename it to “miwifi.bin” (without quote)
1.3. Power off the router and plug the USB into the router. Now hold the reset button and power it up until the yellow led starts flashing. A solid blue will appear after a few moments. We just flashed the dev firmware. Remove the USB.
Step 2: Download firmware & preparing the flash file
Step 3: Turning on SSH on Router
3.1. Connect your router through wifi with a default password.
3.2. Go to http://miwifi.com or http://192.168.31.1 and setup your router as usual.
3.3. Login to admin panel. Look at the url bar.
3.4. In url bar, after “stok=”, copy the code.
3.6. If your wifi disconnect, then connect again. Follow 3.3 and 3.4 step again
3.7. Replace the <STOCK> code in below url and visit that url
3.8. You will probably disconnect again. Reconnect and follow 3.3 and 3.4 steps.
3.9. Replace the <STOCK> code in below url and visit that url
3.10. Again (one last time) you will be disconnected. Connect again and follow 3.3 and 3.4 steps.
3.11. Replace the <STOCK> code in below url and visit that url. BUT replace OLD_PASSWORD with your admin panel password (that you provided in step 3.2) and NEW_PASSWORD with your desire password
Step 4: Entering into SSH and flash Pandorabox
4.0. Connect USB drive to router
4.1. Download and open PUTTY client
4.2. In SSH field, put your router IP address (192.168.31.1) and connect
4.3. Username is ‘root’ and password is NEW_PASSWORD
4.4. Now issue below commands one by one:
cd /extdisks/sda1 cp pb-boot-xiaomi3-20180726-0d8505f.img /tmp cd /tmp mtd write pb-boot-xiaomi3-20180726-0d8505f.img Bootloader reboot
4.5. Wait until the led turns into blue
4.6. Power off the router (disconnect the power cable) and then hold the reset button then power up the router, release the reset button after 2/3 seconds after powering up. You will see breath style yellow led will glow
4.7. Connect your router through LAN cable. Cable will go from router’s LAN port (not internet/wan port) to your PC.
4.8. Now go to http://192.168.1.1 (while connected with LAN), you will see a PandoraBox firmware upgrade page. select your Pandorabox firmware (downloaded from step 2.1) and upload it. Router will be restarted when done.
4.9. Access the PandoraBox OpenWrt admin page by going http://192.168.1.1, default password is “admin”. Language is by default Chinese. Don’t panic if you don’t understand anything. Just go to the following link to change language.
4.10. Select language “Chinese” to “auto”
4.11. Save and apply (middle button at the very bottom)
If you come this far, congratulation! You have successfully installed OpenWrt to your Xiaomi R3 router. Now configure internet connectivity.