OpenWrt on Xiaomi Nano Router

Goodbye, 小米路由器(青春版)!
Hello, OpenWrt!

Flash Image

# ssh root@192.168.31.1

$ cat /proc/mtd
dev:    size   erasesize  name  
mtd0: 01000000 00010000 "ALL"  
mtd1: 00030000 00010000 "Bootloader"  
mtd2: 00010000 00010000 "Config"  
mtd3: 00010000 00010000 "Factory"  
mtd4: 00ba0000 00010000 "OS1"  
mtd5: 00a30000 00010000 "rootfs"  
mtd6: 00240000 00010000 "OS2"  
mtd7: 000c0000 00010000 "data"  
mtd8: 00100000 00010000 "overlay"  
mtd9: 00010000 00010000 "crash"  
mtd10: 00ba0000 00010000 "firmware"

$ cd /tmp

$ wget http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/openwrt-15.05.1-ramips-mt7628-mt7628-squashfs-sysupgrade.bin

$ curl -s http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/md5sums | grep mt7628-mt7628 |
 md5sum -c

$ mtd -r write openwrt-15.05.1-ramips-mt7628-mt7628-squashfs-sysupgrade.bin firmware

Config Network

# telnet 192.168.1.1
$ uci set network.lan.proto=dhcp
$ uci commit
$ reload_config

Issues

  • 指示灯一直是黄色, 不会变蓝了.
  • 只识别出28M内存, 真是太坑爹了.
  • WiFi无法工作, 把天线折叠起来吧.

Try Again

# ssh root@192.168.1.121 # via DHCP

$ cat /proc/mtd
dev:    size   erasesize  name  
mtd0: 00030000 00010000 "u-boot"  
mtd1: 00010000 00010000 "u-boot-env"  
mtd2: 00010000 00010000 "factory"  
mtd3: 007b0000 00010000 "firmware"  
mtd4: 0011fac2 00010000 "kernel"  
mtd5: 0069053e 00010000 "rootfs"  
mtd6: 004c0000 00010000 "rootfs_data"

$ cd /tmp

$ wget http://downloads.openwrt.org/snapshots/trunk/ramips/mt7628/openwrt-ramips-mt7628-miwifi-nano-squashfs-sysupgrade.bin

$ wget -qO- http://downloads.openwrt.org/snapshots/trunk/ramips/mt7628/md5sums | grep miwifi-nano | md5sum -c

$ mtd -r write openwrt-ramips-mt7628-miwifi-nano-squashfs-sysupgrade.bin firmware

Config Network

# ssh root@192.168.1.1
$ uci set network.lan.ipaddr=192.168.31.1
$ uci set wireless.radio0.disabled=0
$ uci set wireless.@wifi-iface[-1].ssid=MiWiFi
$ uci changes
$ uci commit
$ reload_config

Issues

  • 指示灯一直是红色, 不会变黄了.
  • 识别出60M内存, 可以运行VPN了.
  • WiFi正常工作了, 把天线竖起来吧.
  • 没有Luci界面, 在命令行中安装吧.

Install Luci

WAN口连接网线, 确保可以上网.

# ssh root@192.168.31.1
$ opkg update
$ opkg install luci
$ find /www -type f -exec chmod 644 {} \;
$ chmod 755 /www/cgi-bin /www/cgi-bin/luci /www/luci-static
# firefox http://192.168.31.1/

References