Xiaomi mi wifi 3 support

Any hint looking at the PCB?

Well, guys, I see I somehow sparked some renewed interest thus I'll do my outing. :slight_smile:
I bought one of these as a replacement for a Raspi 2 running (well) LEDE.

I know Linux quite well but have little knowledge of MTDs and these typical embedded stuff.

I am willing to lend my Xiaomi to the interest of LEDE progress, thus, if there are tests I can do, I am willing to give them a try.

I would prefer to avoid bricking it but I can live with the risk, given the little investment.

Lemme know

I took a look at MT7620 datasheet and pin descriptions.
There are no recovery/interupt pins.
Only JTAG and UART.
JTAG shares some pins with switch and requires bootstrap configuration to enable it

If I understood, whether the pins are in JTAG or EPHY depends on the a register that is set via bootstrapping.

From: 2.6 Bootstrapping Pins Description
Pin Name Boot Strapping Signal Name Description
ANT_TRN DBG_JTAG_MODE 0: EPHY_LED 1: JTAG MODE

At page 8 of the datasheet you have the physical location of the pin.

From: 2.3 Pin Descriptions (TFBGA)
Pin Name Type Driv. Description
D5 ANT_TRN O, IPD 8 mA Positive signal for antenna T/R switch

Does that mean that driving that pin you force the MT in JTAG?

It looks like it should force it into JTAG mode and reuse EPHY pins for JTAG.
Hm,even if I could do that I dont have any JTAG programmer.

Here is a nice 520 pages of Programming guide for MT7620
http://download.villagetelco.org/hardware/MT7620/MT7620_ProgrammingGuide.pdf

Basically in order to use JTAG folllowing needs to happen:
SYSCFG0: System Configuration Register 0 which is at 0x0010 needs its BIT 7 which is DBG_JTAG_MODE set to 1 to enable JTAG.
And then in order to use JTAG we could use Raspberry PI + OpenOCD but we would need to either write NAND driver to write to NAND or figure out how to setup RAM so we could load U-boot into RAM and then write everything from U-boot.

Second option would not be so hard if Xiaomi had U-boot sources released like they should since it is under GPL licence

I was indeed looking at those two documents and at using Raspi as JTAG.
Random thoughts:

  • how about writing to SPI ? Does this router use it?
  • the MTD driver doesn't help, I suppose, since it would have to handle NAND via JTAG, right?

You cant write to SPI since this router does not have any SPI flash.
MTD is not driver,you need NAND driver.

Like I said going the RAM route should be easier.
If only Xiaomi would release GPL source like they are actually required to

I upload the firmware img for xiaomi mi router 3
https://drive.google.com/drive/folders/1FeJ4mJLILlVzhy316aI7K6U6nSLvbs3X?usp=sharing
could someone here test on it? I didn't have the device for now.
To boot LEDE while on stock fw you have to:
mtd write lede-ramips-mt7620-miwifi-r3-squashfs-kernel1.bin
mtd write lede-ramips-mt7620-miwifi-r3-squashfs-rootfs0.bin
nvram set flag_last_success=1
nvram commit
reboot

my firmware is custom named to ptpt52
webui admin http://192.168.15.1/
webui root/admin
default wifi name is PTPT52_XXXX and password 88888888

file list:
ptpt52-3.0.0-build201711080710-ramips-mt7620-miwifi-r3-squashfs-kernel1.bin
ptpt52-3.0.0-build201711080710-ramips-mt7620-miwifi-r3-squashfs-rootfs0.bin
ptpt52-3.0.0-build201711080710-ramips-mt7620-miwifi-r3-squashfs-sysupgrade.tar

Could you tell me how to write it on a factory config router?

use ttl
or get ssh root access via https://wiki.openwrt.org/toh/xiaomi/mir3

1 Like

Hey guys! I just made an account because I discovered this router and the specs are damn good for the price, and I want to help bring OpenWRT to this product.

I plan on helping out since I ordered 10 of these at a nice price($8 a unit) since the first one I bought seemed to be genuine and checked out.

I also ordered them to be used in a massive building(more like a warehouse) I've purchased since it was auctioned off.
They are all linked back to a pfSense server anyways so I can block out the phone home calls to the Chinese servers with some super simple firewall rules.

Hope to eventually flash all these to the infamous OpenWRT firmware one day so I invested in this product with the future in mind.

I plan on using 2-3 for playing around with to get OpenWRT working or for testing builds for the community.
I'll do another read through of this forum to get up to speed but I am available to test.

@mydarkthawts Is the place where ypu bought them secret?
I for one would really use couple of them for start

1 Like

@robimarko Well, not so much as secret as I got lucky.
The brief: A friend buys lots of routers and flashes them for installation in businesses for a premium charge in cities like miami, virginia beach and chicago... the list goes on.
Well, he must have been really stoned or drunk when he thought this router was fully supported so he bought a lot of them in bulk. He actually went on a shopping spree with this router.
Week in a half later, he found out they were not supported.. I offered to take them off his hands.
I'll definitely attempt to buy some more off him if he doesn't get anymore clients since he is incompetent in the field of everything but following instructions lol

@robimarko Actually, I'll talk to him later this week and buy the rest off of him so he can make some sort of money back and I'll list them on ebay for the same price. I'll give you the link after I do so.

Awesome, but the only issue is that you are in the US and I live in Croatia.

Nonprofit that I partly volunteer and partly work for would really benefit from getting a price like that someday.
We are mostly self-funded and spend all funds on setting up more free public WiFi hotspots and maintaining all the accompanying infrastructure.

I have absolutely no issues shipping out of country to a fellow tester/coder/open source supporter.
I will use my commercial shipping account to make it as stupid cheap as possible lol.
When I get a hold of him**, I'll message you personally, I've your username on my whiteboard here for reference.

I've never actually shipped to croatia specifically before so we will cross that bridge when it comes to it. Maybe declare a low value or gift if they have import tax.

btw, the reason I mention eBay is because it is the mediator of the exchange for your reassurance. I can personally ship them to you and we can use paypal or something along those lines.
It's your call, I prefer the protection of paypal over ebay since paypal charges a smaller transaction fee on a goods/product transaction than ebay to add buyer protection to the mix.
Anyways, I don't want to hijack this thread anymore than I have. I gotta read a bit more through this forum and the openwrt forum to get up to speed.
I've spent most of my time out of the US borders doing charity work setting up long range ham radio internet for the REALLY remote and isolated people. At least they can connect to the internet lol
They got water and stuff so the priorities are already there.

Sure,PayPal and ebay would work for us.
But we would need to know the final price before commiting since we have to pay VAT of 25% when importing stuff from outside of EU.

We also provided internet to refugees during the whole refugee crisis of 2015/2016.
We still provide internet to asylum seekers in Croatia.

1 Like

Wow man you guys are doing great things. Thank you for being human =D
and damn that VAT.. That's ridiculous but I suppose if America did that, all the jobs would have stayed in our borders and things wouldn't be too terribly bad as they are now... Granted the current mess of the world is pretty much American Govts fault to begin with... for the most part. Meddling kids.