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.

Thank you, I just reporting it, as previous version was working without any issues.

sharkys wrote:

Also I can't install now watchcat :

Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-watchcat:
 *     watchcat * 
 * opkg_install_cmd: Cannot install package luci-app-watchcat.

Add this line to /etc/opkg/distfeeds.conf:

src/gz 14.09_oldpackages http://downloads.pandorabox.org.cn/pandorabox/packages/mt7620/packages/oldpackages

And run opkg update.

In the previous version, all the feed URLs in this file were totally wrong by default, it only worked because my patch fixed them. With this release I saw they were corrected, so I did not patch this file anymore, but did not notice they forgot to add the oldpackages feed, and the watchcat package you want to use is there.

(Last edited by StrangeOrange on 27 Jan 2016, 07:51)

sharkys wrote:

Does qos-scm works for you in Luci ? Maybe I would need to redo config manually ?

This happens because in /etc/config/sqm the default queue name has a hyphen (-) in it. It will work as soon as the hyphen goes:

config queue 'anythingshouldbefineaslongasthereisnohypheninitotherwiseitwillbreak'

I changed the default interface in the config file from the nonexistent eth1 to something else, and the "something else" I chose was pppoe-wan. The problem appeared because in line with this change I also renamed the queue to pppoe-wan, and it has the unfortunate little hyphen in it.

Nice find.

(Last edited by StrangeOrange on 27 Jan 2016, 08:03)

Please Can anybody give link where we can download all versions of pandora box? (Stable, testing etc.) Thanks smile
(r1696?)

@sharkys - Thanks, ofcourse, but i mean "original" pandorabox with all stuff smile.

(Last edited by kaper on 27 Jan 2016, 14:58)

@StrangeOrange, currently on latest version XMWiFiMini-OpenWrt-PandoraBox-14.09r1696-StrangeOrange-Optimal-U4 and it's not very good ;-( as it seems I'm getting delays (timeouts, long replies) on the router and on wifi even without HW NAT enabled already after 13 hours uptime.

Also I see in the Kernel LOG :

[47563.550000] PeerDelBATxAdaptTimeOut()
[47566.700000] PeerDelBATxAdaptTimeOut()
[47682.030000] PeerDelBATxAdaptTimeOut()

No idea if it's related.

Its great have this altenative (Pandorabox), but... any advanced in better performance over Openwrt?
Pandorabox is obscure, no all packages are available and is close...
Will be great if in this "forum.openwrt.org" we can talk about how make openwrt run better in this great and good looking router.

gazambuja wrote:

Its great have this altenative (Pandorabox), but... any advanced in better performance over Openwrt?
Pandorabox is obscure, no all packages are available and is close...
Will be great if in this "forum.openwrt.org" we can talk about how make openwrt run better in this great and good looking router.

Yes, there is issue currently opened with OpenWRT trunk - https://dev.openwrt.org/ticket/20369 - the PandoraBox is the best option in the meantime.

@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

(Last edited by StrangeOrange on 29 Jan 2016, 13:47)

First of all, thank you for your newer versions, second thank you for your detailed and well explained answerm I owe you a beer. I tried what you said and it worked as you said! Now im able to scan networks with 5ghz interface and also set it up as a repeater. Only problem is the number of signals returned by the 5ghz scanning is just 2 (one of them is the other 2.4ghz in miwifi lol), it seems like this interface, i mean its driver, its somehow not so optimized so the range of the scan is very limited, might be something misconfigured on my side dont really know. I will try latest release, thanks StrangeOrange keep up this good work!!!

Regards

StrangeOrange wrote:
FENIX81 wrote:

I have setup 2.4ghz to act as a repeater, strong signal and flawless. Now I want to do the same with 5ghz, repeat another wifi signal, problem is that i cannot get results while scanning with this interface, i would like to put it in the same mode than the 2.4ghz and get all those results while scanning so i can repeat one of them with 5ghz interface, I don't know how can I achieve it (in case it is possible, maybe not?)

The complete configuration settings for each interface are saved in /tmp/profiles/rt2860v2_<2|5>g.dat (these are generated by the scripts in /lib/netifd/wireless/* and /lib/wifi/*). The good news is, since both 2.4 GHz and 5 GHz seem to be using the same driver (rt2860v2), the settings are in the same format, and as you already managed to set it up on 2.4 GHz, perhaps you could move the relevant settings to the other file to see if that makes it work the same way too.

Those files are overwritten every time the scripts run but it seems they are only being used indirectly because of the symbolic links to them from /etc/Wireless/MT76X2/MT7612.dat and /etc/Wireless/RT2860/RT2860.dat, which are the configuration file paths that are actually hard-coded into the driver:

strings /lib/modules/`uname -r`/mt76x2e.ko | fgrep /etc/

Knowing this, to test your own settings for the 5 GHz interface, you could:

  • Comment out line 29 in /lib/wifi/mt7612.sh by putting a pound (#) sign in front of it. This disables relinking to the automatically-generated config file:

#        ln -s $CFG_FILES_2ND /etc/Wireless/MT76X2/MT7612.dat 2>/dev/null

  • Remove the currently existing link:
    rm -f /etc/Wireless/MT76X2/MT7612.dat

  • Link the configuration file the driver expects to find to your custom file:
    ln -s MT76X2_Experiment.dat /etc/Wireless/MT76X2/MT7612.dat

  • Create your own configuration by merging the relevant settings from /tmp/profiles/*.dat and save it as /etc/Wireless/MT76X2/MT7612_Experiment.dat

Note: I didn't test this, so it might need some polishing, but in principle it should work, and this trick could also be adopted to straighten out other driver configuration-related driver issues (regulatory domain, WPS state, etc.) without extensively modifying the script files, and just bypassing them altogether instead.

As for what the particular settings mean and how to adjust them, maybe the text files included in this source code of a related driver can be helpful: download link, discussion (Chinese). (If anyone has a better source of documentation for the driver settings, please share.)

StrangeOrange wrote:
stamasd wrote:
StrangeOrange wrote:

Re: PandoraBox and hardware-accelerated NAT

If some websites are starting to take forever to load and never complete, HW NAT is the likely culprit. I had this issue today and switching it off cleared the problem for me, so if the same happens to any of you, you might want to try this first.

Not sure if this has anything to do with this, but I found that the MiWiFi running PandoraBox after a while will not accept incoming connections from guests. The most reliable way to deal with this was to set a cron job to reboot the router every day at 3am.

Is this already with "Hardware Accelerate" switched off? Didn't happen to me so far (not sure about the longest uptime but my current one is 3 days and I put the router through some heavy traffic periods over this time). Although there are a lot of what seems to be driver debug messages logged with the "alert" priority, these seem harmless.

Yes, HW accelerate off. What happens is: it will randomly drop connections to already connected guests, and not accept any incoming connection requests. You end up with the guest trying to connect for a long time, remain in a semi-connected state but never get an IP over DHCP, and eventually times out.
Fortunately when that happens - I have a bridged client that never seems to be dropped from the main router; I can connect to that one, then login into the main router and reboot it. smile

(Last edited by stamasd on 30 Jan 2016, 14:42)

Hello!

Can any body help, how to configure DHCP server for 1696 version?

I see that router get address from 10.0.0.x range, but where I can change for another network (i.e. 15.0.0.X) range?

Thank you!

(Last edited by admitr2 on 2 Feb 2016, 09:00)

admitr2 wrote:

Can any body help, how to configure DHCP server for 1696 version?
I see that router get address from 10.0.0.x range, but where I can change for another network (i.e. 15.0.0.X) range?

Edit /etc/config/network or change it through the Web interface (LuCI), the same as you would on any other OpenWrt installation. For details, see OpenWrt Wiki.

Note: You should only use addresses from RFC1918 private spaces for your local network or you won't be able to connect to some parts of the Internet. Well, unless you're HP and this is your public address range:

NetRange:       15.0.0.0 - 15.255.255.255
Organization:   Hewlett-Packard Company (HP)
Address:        3000 Hanover Street
City:           Palo Alto
StateProv:      CA
PostalCode:     94304
Country:        US
StrangeOrange wrote:
admitr2 wrote:

Can any body help, how to configure DHCP server for 1696 version?
I see that router get address from 10.0.0.x range, but where I can change for another network (i.e. 15.0.0.X) range?

Edit /etc/config/network or change it through the Web interface (LuCI), the same as you would on any other OpenWrt installation. For details, see OpenWrt Wiki.

Note: You should only use addresses from RFC1918 private spaces for your local network or you won't be able to connect to some parts of the Internet. Well, unless you're HP and this is your public address range:

NetRange:       15.0.0.0 - 15.255.255.255
Organization:   Hewlett-Packard Company (HP)
Address:        3000 Hanover Street
City:           Palo Alto
StateProv:      CA
PostalCode:     94304
Country:        US

thank you!

(Last edited by admitr2 on 2 Feb 2016, 11:21)

Dear, StrangeOrange!

May be you know, why completely power off and power on - configuration loaded to default? Config saved. I try load from backup config, but result the same - default configuration. I check backup file - all my config present.
This is my kernel log

https://goo.gl/j0dRCp

(Last edited by admitr2 on 2 Feb 2016, 17:29)

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

As a result, the /overlay partition is not mounted correctly, so there is nowhere to save any changes you made.

You can check if this is the case with mount | fgrep overlay, which, if everything went fine, should show:

/dev/mtdblock7 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/overlay)

I guess it does not show both of the above lines on your system.

This happens because there is leftover data from the previous firmware stored in the flash memory in the area that the new JFFS2 (writeable) filesystem is supposed to use. This problem seems to surface occasionally if your previous firmware was much larger in size than the current one is. Perhaps it can also be caused by the change in partition layout when flashing from a non-OpenWrt firmware.

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.

Good work, keep it up! smile

I have only few things:
1.) It looks that u-boot partition is locked to read only by ROM. So you can't update to breed. Is there any workaround? (e.g. can someone compile Owrt with u-boot enabled for writing so we can update u-boot and then flash back to Pandrabox?)

2.) I found that /root partition has only 4MB and free space is 3,5MB. On the other hand temp partition has over 60MB. Why is /root partition so small? (because I want to install Virtual here USB which has 3MB...)

3.) I don't know what is ngrok settings, but if you click on it in Luci, you will get:
Failed to execute cbi dispatcher target for entry '/admin/services/ngrokc'.
The called action terminated with an exception:
Unable to read UCI data: ngrokc
stack traceback:
    [C]: in function 'assert'
    ?: in function 'dispatch'
    ?: in function <?:141>

4.) After changing LAN IP to 192.168.2.1 Luci stopped working. After changing it back to 10.0.0.1 (through /etc/config/network) and reset it started to work again hmm Internet connection worked.

5.) I recommend to set WMM enabled on wifi by default wink

Thank you smile

(Last edited by Benik3 on 3 Feb 2016, 18:20)

Benik3 wrote:

1.) It looks that u-boot partition is locked to read only by ROM. So you can't update to breed. Is there any workaround?

To enable it the kernel would need to be recompiled, and we don't have the sources to do that. As for the workaround, I flashed the Breed bootloader while still on stock firmware, and once you have Breed, you can reflash it anytime with another bootloader from within Breed.

Benik3 wrote:

2.) I found that /root partition has only 4MB and free space is 3,5MB. On the other hand temp partition has over 60MB. Why is /root partition so small? (because I want to install Virtual here USB which has 3MB...)

The /tmp partition is in the volatile memory, of which there is 128 MiB available, but once the power is off everything there will be gone. There is no separate /root partition but an overlay filesystem, which to preserve its contents across reboots needs to be kept in the non-volatile memory ("storage"), and there is only 16 MiB of that available to start with.

Newer PandoraBox releases keep adding more and more packages. If there's some stuff you don't need, you could consider editing the patch sources to remove it and making a custom version of the firmware for yourself, although note that just the Wi-Fi driver module /lib/modules/3.14.56/mt76x2e.ko is nearly 2 MiB by itself in the current version, so there are limits to how much space can be freed. Or you can consider going back to release 1216, which was smaller. There's also the possibility of mounting a filesystem from an external drive for more storage.

Benik3 wrote:

3.) I don't know what is ngrok settings, but if you click on it in Luci, you will get: [...]

It's just a config file problem, similar to the SQM one described in the previous posts. To fix it, edit /etc/config/ngrokc and change both 'Example Server' and 'Example Tunnel' to just 'example', or anything else for that matter: as long as there is neither a space ( ) in it nor a hyphen (-) it should work.

Benik3 wrote:

4.) After changing LAN IP to 192.168.2.1 Luci stopped working. After changing it back to 10.0.0.1 (through /etc/config/network) and reset it started to work again hmm Internet connection worked.

You probably didn't change the address in /etc/config/uhttpd. Also check /etc/hosts.

Benik3 wrote:

5.) I recommend to set WMM enabled on wifi by default wink

I left the default Wi-Fi driver settings because the way they're applied is quite messy, and while meddling with them I wouldn't want to introduce any errors, some of which might not be immediately apparent. Sounds like a good idea though.

(Last edited by StrangeOrange on 3 Feb 2016, 19:44)

Thanks for reply! smile

Ad 1.) well we have original sources for OpenWRT 15.05 or 14.09 here so we could use one build to just update u-boot. Unfortunately I'm not enough skilled to compile own kernel hmm

Ad 2.) Ah, OK. I remember that I had more space. Luckily the Virtual Here didn't took as much space as I expected, so I have still 2,5MB free. That's enough for now smile

Ad 4.) I didn't know about the HTTP settings. After change it works OK, sorry hmm

Ad 5.) I recommended WMM enabled because some wireless cards have problems to connect to wifi without WMM. They connect only on low speed or even not smile

(Last edited by Benik3 on 3 Feb 2016, 20:25)

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

As a result, the /overlay partition is not
...

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.

Hello!

Thank you for help.
Yes, you are right about wrong size of partition.
Unfortunately re-flashing not help to me.
Can you detailed write about  "other options include erasing the partition before flashing the new firmware"?

(Last edited by admitr2 on 3 Feb 2016, 21:04)

I'm using PandoraBox R2 14.09. On my Wifi Mini the lan led on the rear blinks over and over again. Is there any way to keep it on without blinking? Thank you.

@all Sorry for my intrusion
@StrangeOrange, currently on latest version ..Optimal-U4 and my Xiaomi router is working very good!! Thanks a lot for your great work!