Tuesday, March 22, 2016

Linux - Xiomi Miwifi - Step by step

A while ago I had this router, and after endless troubles I finally got it working with openwrt. I didn't want to fiddle with it and find out what actually worked, so I got a new one, which will act as an ac bridge for an old laptop. These are super-cheap, order them from Aliexpress, and request them without the box. For Canada, one at a time, and something without a box is worthless, right?

The key trouble is that the latest firmware is all in Chinese, but you get one in English. You must write down all the steps to change the ip address, so you can put in on your main network, and use Google translate.

Use an old Linux laptop. If you are really super-cheap enough to use this router, you have one.

Plug in the mi, and hook up an ethernet cable to the laptop. Power on or use 'pump' to get an ip address. It will be something like 192.168.31.52. Now you know the router is 192.168.31.1. Go to that with Chrome.

Yeah, it's all in English! Not for long.

Under the Miwifi picture, you are hitting a box - ok

Next page, hit upper box, set up wifi. In the middle box with the eyeball, enter a password over 8 characters. Hit the bottom box. Next page, enter the same password (easier to remember for now), in the box with the eyeball. Hit return.

Wait for a while until the bottom bar is complete. Hit the only box. Remember that all this will soon be in Chinese.

On the main admin page, go to the third option on the top (Settings). Go to the third circle at the top, with lan sign (Lan settings). The top slider switch (dhcp), turn it off. The bottom box with the ip address, change it to something compatible with your network and unique (it doesn't yet allow to pick up and ip address)
Hit the bottom box 'save' It will come up with a pop-up. Hit left button (ok). Wait until blue light comes on.
Power off. reconnect ethernet to your main network, have a coffee, and wait for the blue light.

Now it reboots. Put away your laptop and connect the mi to your main network.

Since I'm following along right now, I find it doesn't connect to the ip number. Repower and it still doesn't connect. Must have been a typo. Press reset button, connect to your laptop and do it all over again. Have a nice reset pin handy, hold until the light flashes.

Do it all over again. Wait for blue light. Do it again (drat).

Do it all over again. Remember that you used that ip address for the new Kodi box...

Have a glass of wine, and wait for the stupid blue light.

Success! Enter the admin password. Go to settings and status and try an update. Site is busy. blah

Now for the Chinese. If the stupid site is always busy, follow this. This takes to the dev site, remember that it is a mini, and hit the right blue box under 'mini' for a download. Manually update the mi.

Wait for the stupid blue, and go back to that ip (yeah, it didn't wipe it). Now you have a Chinese menu. login and get the stok number as explained in the openwrt page. Construct the urls by going to the end of the stok number..

Things to note. Telnet to that ip number and get into their commands. Use this to get the miwife sysupgrade.bin. Don't download (I did that!) but copy link address. In the router, cd /tmp, and wget the .bin. mv it to firmware.bin and follow their mtd command. Have dinner. Connect your laptop, reset the stupid thing. Reboot your laptop. Wait a long long time for a solid red light.

My main problem comes from not drinking enough wine. I don't wait long enough and can't tell the difference between orange and red. I'm waiting for some smartass saying 'I did it all the way through, once, with no wine."

Anyway the Chinese interface doesn't resemble the English, so right now I am fumbling. My only hope is that I did this months ago. Oh yeah, after you set the passwords, repower. Now you are back in action.

WAIT FOR THE STUPID BLUE LIGHT! IT TAKES FOREVER.

Connect again on the main system. Don't know that you are still in Caps lock, and reset. :(

Oh the horror! On the miwifi, wget was not working. It was only grabbing a tiny bit. I put the whole openwrt driver on a usb, then I looked as dmesg on the router. I could then mount it and copy it to /tmp where I could activate the mtb.

ps. Just follow the instructions, and you shouldn't get into all the trouble I did. That's just me. :)

pss. Good thing we know how to do it all over again. If you botch your configuration in openwrt, you just can't reset, because of the weird bootloader. You have to boot with xiomi dev firmware, and start all over again. Doing that now.

ppppps. Doing it all over again. I've done the access point, now I'm trying to make it into a bridge for a laptop. One mistake and you're toast. For instance, I bridged the lan before wifi joining, and suddenly I can't access it any more. poohey.

final note: The mifi cannot act as a simple transparent repeater bridge. That requires the broadcom chip or aetheros chip. It is only good as an ap.