OpenWrt Forum Archive

Topic: Installing OpenWrt in Xiaomi Wifi Mini

The content of this topic has been archived between 8 Feb 2018 and 5 May 2018. Unfortunately there are posts – most likely complete pages – missing.

admitr2 wrote:
StrangeOrange wrote:
admitr2 wrote:

May be you know, why completely power off and power on - configuration loaded to default?

For some reason the JFFS2 filesystem was not initialized properly:

[   44.470000] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes

Reflashing the firmware again should solve this problem (it always did for me). If not, other options include erasing the partition before flashing the new firmware or building a custom image with an increased padding size.

Unfortunately re-flashing not help to me. Can you detailed write about  "other options include erasing the partition before flashing the new firmware"?

  • Are you flashing it according to the instructions in my post or using some other way?

  • What are the exact steps that you do?

  • What was the previous firmware that you had on the router?

  • Did you run jffs2reset -y beforehand?

Option #1: Run mtd erase firmware and then flash.

Option #2: Pad the firmware image with 0xff to size 0xf80000 (16252928) bytes, and then flash the modified image. This can also be done by changing the BuildFirmwareImage.sh script in the patch source.

Either should be enough on its own but I've never had the chance to try them. Option #1 is the fastest but if you cannot flash the new firmware after you already erased the previous one, for example because you are disconnected or the power goes off, the router will not start again and you'll need to recover from this situation through some other way, for example using the Breed bootloader.

If you're not comfortable with the above, there's also yet another, roundabout way that should work:

Option #3: Flash an older, smaller version, say r1216 U2. Make sure the /overlay filesystem is set up correctly there, and then flash the newest image again.

(Last edited by StrangeOrange on 4 Feb 2016, 05:37)

admitr2 wrote:

May be you know, why completely power off and power on - configuration loaded to default? For some reason the JFFS2 filesystem was not initialized properly:
[   44.470000] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
Reflashing the firmware again
..

If you're not comfortable with the above, there's also yet another, roundabout way that should work:

Option #3: Flash an older, smaller version, say r1216 U2. Make sure the /overlay filesystem is set up correctly there, and then flash the newest image again.

Hello!

I try option 3 - no success.
after that I try option 1. But first I download to router firmware (r1216U2 minimal). and after command
mtd erase firmware
i not loose connection and reflash to firmware (r1216U2 minimal).

And get normal router without issue! After upgrade to r1656 Optimal and now all is ok. only theme material noy correct show, but I install another theme.

Thank you very match!

(Last edited by admitr2 on 4 Feb 2016, 11:40)

Has anyone got IPv6 to work on PandorasBox? I've set up another interface on eth0.2 with DHCPv6, but there's still no connectivity, and I feel like I'm missing something really obvious.

Edit: it worked out of the box on Chaos Calmer. Weird. But then the wireless speeds are terrible.
Edit2: got it to work, will post some more info when I'm done double checking everything. Could probably be implemented into the base firmware, too.

Edit3: here's the changes required for a DHCPv4+DHCPv6 setup:

1. Generate your ULA prefix using this tool (or any other way, really) and set it in /etc/config/network

config globals 'globals'
    option ula_prefix 'fd1c:f678:470c::/48'

2. Add a DHCPv6 WAN interface:

config interface 'wan6'
    option ifname 'eth0.2'
    option proto 'dhcpv6'
    option macaddr '53:3f:ac:e2:fa:ce'

3. Now, set up the firewall.

Set disable_ipv6 to 0 (or just remove the setting entirely).

config defaults
    option disable_ipv6 '0'

Add our new wan6 interface to the wan zone:

config zone
    option name 'wan'
    list network 'wan'
    list network 'wan6'

Then uncomment the 'Allow-DHCPv6', 'Allow-MLD', 'Allow-ICMPv6-Input' and 'Allow-ICMPv6-Forward' rules.

I also changed 'Allow-DHCPv6' to bring it in line with trunk, which has a slightly simpler version, but that shouldn't be necessary:

config rule
    option name 'Allow-DHCPv6'
    option src 'wan'
    option proto 'udp'
    option src_ip 'fc00::/6'
    option dest_ip 'fc00::/6'
    option dest_port '546'
    option family 'ipv6'
    option target 'ACCEPT'

4. Finally, apply all the settings and start the DHCPv6 server on the router network:

# /etc/init.d/network reload
# /etc/init.d/firewall reload
# /etc/init.d/odhcpd start
# /etc/init.d/odhcpd enable

5. Renegotiate a DHCP lease on the connected devices (or just reboot the whole thing).

Edit4: just tested this exact process on a clean install, and it works just fine. @StrangeOrange: maybe this should be the default setup? It makes sense to me, at least. All we really need to do to make this work out of the box is to roll in the firewall/interface changes and keep /etc/uci-defaults/12_network-generate-ula so that it replaces the ULA prefix with something sane on first boot.

(Last edited by K900 on 7 Feb 2016, 12:25)

My few cents:
Breed Bootloader to be installed from within Minirouter after Pandorabox:

cd /tmp
wget http://breed.hackpascal.net/breed-mt762 … i-mini.bin
mtd write breed-mt7620-xiaomi-mini.bin u-boot

Note, that bootloader is in Chinese. You might want to install Chromes auto translation feature from Chinese to German/English
before accessing the bootloader during boot (press resetbutton and apply power to minirouter).
Access 192.168.1.1 in Chrome.
Minirouter does dhcp.

I was close to write that really the latest version is indeed the most stable one and it is not unfortunately ;-(
After a week in production, I started to download aprox. 7MB/s on 4 threads via one 2.4GHz client (another AP) - 6 hours uptime and the problems started - this AP get no ping (was connected but nothing went trough) it wasn't possible to get connected to the Xiaomi router externally, no error in Syslog or Kernel log....just reboot fixed that. Btw, other 2.4 + 5 GHz clients were working fine during the same time. Yes, it didn't get fixed even when I stop the download.
@StrangeOrange, any idea how I can investigate such problem when it happens again ? Some debug or something, WiFi statistics  ?

Still the latest version I like so far the most (two issues only, at the beginning as I reported and now...).
Note : From external packages, I'm using only Watchcat, which is harmless and Commands.

augustus_meyer wrote:

My few cents:
Breed Bootloader to be installed from within Minirouter after Pandorabox:

cd /tmp
wget http://breed.hackpascal.net/breed-mt762 … i-mini.bin
mtd write breed-mt7620-xiaomi-mini.bin u-boot

Note, that bootloader is in Chinese. You might want to install Chromes auto translation feature from Chinese to German/English
before accessing the bootloader during boot (press resetbutton and apply power to minirouter).
Access 192.168.1.1 in Chrome.
Minirouter does dhcp.

Interesting, when I tried to install Breed, the u-boot section was locked.
Which Pandorabox version did you use?

I just would like to tell a story how I tried Pandora r1597, later rolling back to r1024 smile

r1024 is stable and it has been working w/o any problems, but somebody in this topic mentioned r1597 has improved 2,4 GHz performance, so I decided to try it.
First of all, I haven't noticed any performance growth, as I have up to 10MB/sec on both r1024 and r1597 @ 2,4 Ghz.
But r1597 brought me the problems: if I download some torrent (by uTorrent), let's say some 4GB file @ 2,4GHz on good speed, like 7-8MB/sec or more - after about 0,5-1GB amount downloaded the WiFi connection with the router just drops. Sometimes it restores back automatically after some minutes, sometimes not. And there is nothing helpful in the router System Log about the issue causes (just WPA2/AES keys re-initialization or like that). And I could reproduce this issue very easily.

So, I'm back on r1024 - never such problems with that. Probably there are real reasons why r1597 is still in the testing directory.

(Last edited by darkpsy on 9 Feb 2016, 23:22)

@Darkpsy, exactly this behavior I observe as well on r1597, just mentioned above.

In the wiki I see that it says U-Boot disables writing to the console after first boot, afterwards it will be disabled by the firmware. Would  it be possible to replace U-Boot to another one after installing/running OpenWRT/PandoraBox? I assume it will be accepted but I want to make sure as I don't want to get in the same situation I was in before where I had to short two resistors to change the processor mode to accept new bootloader, if that is even possible at all. It might be that I have mistaken the whole process and installing another OS will by default replace the bootloader but since the Xiaomi one can boot OpenWRT it might not be necessary to change it for the router to work.

I also read that the radio calibration procedure is different from what OpenWRT, does Pandorabox do anything about this or are there other reasons for selecting this over regular OpenWRT? And is there any U-Boot available that is not Chinese but English? smile

sharkys wrote:

@Darkpsy, exactly this behavior I observe as well on r1597, just mentioned above.

I thought you wrote this about newer r1696-based StrangeOrange mod, not about r1597.

I meant original r1597 (not StrangeOrange mod) and with no any additional packages installed.

(Last edited by darkpsy on 8 Feb 2016, 17:22)

I was playing with the router and pandorabox/openwrt

with pandora everything was fine except for the fact that it was loosing 10 MB LAN connection (wired IP phone). No matter what i do in ~ 6 hours the port was going down.

with openwrt wifi signal is unstable


so i gave up for a while and rolled back to stock f/w which works very well.

darkpsy wrote:
sharkys wrote:

@Darkpsy, exactly this behavior I observe as well on r1597, just mentioned above.

I thought you wrote this about newer r1696-based StrangeOrange mod, not about r1597.

I meant original r1597 (not StrangeOrange mod) and with no any additional packages installed.

You are right, sorry, I'm on r1696 - StrangeOrange mod.

sharkys wrote:

You are right, sorry, I'm on r1696 - StrangeOrange mod.

Ohh, that's sad then sad That means this multi-thread download issue has succeeded from r1597 to r1696 even...

gently wrote:

so i gave up for a while and rolled back to stock f/w which works very well.

Of course, it was what the device came with and should be fully supported/tested by Xiaomi. The only issue I have is the potential security risk of running stock firmware. Not only security related, who knows what Xiaomi put in there which might call back to China? Or am I being too paranoid here...

courfazor wrote:

who knows what Xiaomi put in there which might call back to China? Or am I being too paranoid here...

Do not think so.
I remember, to have seen some strange comms when running original Xiaomi Mini via upstream router, and doing a tcpdump there.

Well the same could be with Pandorabox big_smile
Anyway I use OpenWRT because of Virtual here USB sharing for my multifunction printer...

Benik3 wrote:

Well the same could be with Pandorabox big_smile

Easy to verify.

I ordered a Xiaomi Mini on AliExpress from a seller who claimed to sell the original English version and also be an authorized reseller. Of course, me as blind as a sheep ordered it. This firmware may or may not be official and something they have modified to be in English, sometimes even the power adapter arrives unoriginal with some weird socket that doesn't seem to fit any wall outlets (It's like the EU one just not long enough pins and too wide). This is of course not a problem, I have 12V2A adapter ready. I just wonder before I get it if anyone here knows how safe this firmware is (I've seen phones with malware, Xiaomi apps with malware etc) so that I might now want to run it on that fake firmware and can install the firmware from their site to revert to original stock? If anything I wonder what they have done to it. Since the US adapter has Mi marks and appear to be original from Xiaomi it could be possible they officially translated an older version of the firmware to English language for US market at some point? Will post back here once I get it and can investigate.
Just a heads up since the seller already pushed 10 000 units...

(Last edited by courfazor on 12 Feb 2016, 13:40)

courfazor, whole this topic is about Pandora/OpenWRT and on the first page there are the links to how to install Pandora. So install it and the problem will be solved maybe ? smile

darkpsy wrote:

courfazor, whole this topic is about Pandora/OpenWRT and on the first page there are the links to how to install Pandora. So install it and the problem will be solved maybe ? smile

Haha, I'm just being silly. I'll go install the latest stable PandoraBox and not that which appears to be the test version when I get it. Don't worry, after I did check this so-called English firmware first ofc wink

Hi StrangeOrange, thanks for your contribution to the community!

Unfortunately, I only have the R1CL (Nano/Lite/Youth) version. Have you also developed a PandoraBox patch for it (or are you willing to?)

I see you've disclosed the process for patching the binaries ourselves. What would the differences be? Or is it the same process?

Thanks!

@StrangeOrange, I want to talk with you, I have some work to do and maybe you can help ($$). How I can comunicate with you?
My email is: azambuja AT protonmail DOT ch

Thanks. and sorry for offtopic, but I cant find some priveate mode to send a message sad

I've manage to use 5Ghz in client mode. Previously it can't connect to my AP because it's using channel 60. I changed the AP to channel 149 and it has successfully connected. I can say that the 2Ghz signal strength is at 100% compared to vanilla openwrt trunk which is around 80%. The 5ghz are 100% on both setups.  However I find that the package drop is quite severe. I have virtually no package drop on vanilla openwrt but StrangeOrange's pandora are quite obvious, almost 10% package drop in a few minutes. I've tested both on V3 and V4 I'm hoping for a v5 that will address this issue. Many thanks StrangeOrange for your effort!

I simply think to make the picture then glimmer it into xiaomi wifi.

StrangeOrange wrote:

@sharkys: I've been using the last version ever since I posted it and I'm not getting any delays or timeouts, so I think the problem is either due to your configuration or some packages you installed. First of all, are you sure HW NAT is really off because these are the symptoms I was getting when it was still on in the previous version?

The kernel log message for PeerDelBATxAdaptTimeOut() is just due to debug mode being enabled at build time. You can check the details yourself in the source code:

It seems harmless. At the very least, I also keep getting it without any problems.

The only other problem I found is with /etc/config/ngrokc, much like the hyphen thing in /etc/config/sqm but here it turns out that spaces cannot be used in section names as well, so if you change 'Example Tunnel' and 'Example Server' to anything without a space in it (or a hyphen), it should work fine.

General comment for people who want to use extra packages: new PandoraBox versions keep popping up, and the changes are quite significant, but their package repository has not been updated recently, so I'd be surprised if this eventually did not cause some problems, similar to what happens on OpenWrt trunk if your base is out of sync with the repository. I think in many cases things can still be made to work on a per-package basis but it might take some gymnastics. If you're not comfortable with it, your options include using one of the older versions, although it'll be a trade-off, so I'd say the newest version is the best to go with unless you have a reason not to. The previous versions are kept in the downloads folder too just in case anyone wants to use them instead.

@gazambuja: I too would like to know what can be done to improve stock OpenWrt on this device. If anyone has any feasible ideas, please let us know. On a related note, it appears that the initial OpenWrt support for Xiaomi WiFi Mini is in fact due to the work of PandoraBox guys: http://thread.gmane.org/gmane.comp.embe … ocus=29840


@StrangeOrange, I flashed the "BARRIER BREAKER (PandoraBox 14.09, r1696)"  yesterday and tried to install the "nano".  After I ran "opkg update", I got this:

root@OpenWrt:~# opkg update
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/base/Packages.gz.
Updated list of available packages in /var/opkg-lists/14.09_base.
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/telephony/Packages.gz.
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/14.09_packages.
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/routing/Packages.gz.
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/management/Packages.gz.
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/oldpackages/Packages.gz.
Collected errors:
 * opkg_download: Failed to download http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/telephony/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/routing/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/management/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/oldpackages/Packages.gz, wget returned 8.

Then I install nano"

root@OpenWrt:~# opkg install nano
Installing nano (2.3.6-1) to root...
Downloading http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/packages/nano_2.3.6-1_ralink.ipk.
Configuring nano.
root@OpenWrt:~#

But, when I fired up the "nano", I got:

root@OpenWrt:~# nano
nano: can't load library 'libc.so.1'
root@OpenWrt:~#

Any clue how to fix it? Thanks.