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.

StrangeOrange wrote:

iwpriv ra0 set NoForwarding=0
iwpriv rai0 set NoForwarding=0

Works well, I have added it into startup phase, thank you so much, really, as I was start to giving up already.

StrangeOrange wrote:


Very often the modem that connects you to the Internet also has a private IP interface with a HTTP server listening, most often at 192.168.1.1 or 192.168.100.1. These settings allow you to reach it by going to http://modem/. This can be useful to (depending on the modem hardware) view the event log, reboot the modem remotely, when the Internet link is down investigate the reason, sometimes there are even some tweaks that can be applied this way.

Well, sorry for asking again, but I have no 'modem', I'm connected via WAN (optics behind), getting IP via DHCP, so it is useless then, or ?
My point is then when I started to change manually the static IP of 'modem', I got disconnected completely from internet connection. The point is that I have already behind VPN something on 192.168.1.2 ...and also I have "connection refused" when trying http://modem/ even having VPN turned off anyway. I was originally thinking that it's some Firewall related problem (the problem with wifi clients pings/connections), as I saw Firewall->Custom rules...now I know it's not related, so I'm rather curious. Thank you.

sharkys wrote:

Well, sorry for asking again, but I have no 'modem', I'm connected via WAN (optics behind), getting IP via DHCP, so it is useless then, or ?

I guess so. You can remove the interface from /etc/config/network and clear the three lines in /etc/firewall.user that make it work, and it'll be gone.

Also, there is an entry for the modem in /etc/hosts, you may want to get rid of that too.

Just a suggestion but the fastest way to do it is to log in through SSH (PuTTY), type mc and press Enter. Use the file browser to locate each file, press F4 to edit and when done F2 to save, Esc to exit.

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.

This might also be caused by a number of other factors, such as your modem overheating or suffering from a memory leak if it's been running for a long time without a reboot.

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.

This might also be caused by a number of other factors, such as your modem overheating or suffering from a memory leak if it's been running for a long time without a reboot.

Hi StrangeOrange,


Thanks for the warning.


Regards,

FJorgeR.

StrangeOrange wrote:
sharkys wrote:

Well, sorry for asking again, but I have no 'modem', I'm connected via WAN (optics behind), getting IP via DHCP, so it is useless then, or ?

I guess so. You can remove the interface from /etc/config/network and clear the three lines in /etc/firewall.user that make it work, and it'll be gone.

Also, there is an entry for the modem in /etc/hosts, you may want to get rid of that too.

Just a suggestion but the fastest way to do it is to log in through SSH (PuTTY), type mc and press Enter. Use the file browser to locate each file, press F4 to edit and when done F2 to save, Esc to exit.

Thank you....however when I was in cleaning process I found something weird - is it good idea to have hosts "hardcoded" ?

Eg. I got there :

10.0.0.1 OpenWrt
192.168.1.1 Modem

...while Modem got somehow another internal IP and I renamed Openwrt to something else (in System -> System), while my LAN IP is also different from 10.0.0.1. Maybe it's better to use Network -> Hostnames instead ? (I guess it's not storing values in hosts...not sure about that)

Just my '50' cents.

(Last edited by sharkys on 23 Jan 2016, 06:59)

Anybody who is running on StrangeOrange FW minimal version and have installed Transmission Deamon+Remote?
After few minutes / hours  i get this error:

Unable to establish ubus connectionstack
traceback:        [C]: in function '?'       
?: in function 'ubus'       
?: in function 'dispatch'       
?: in function <?:141>

(After install u just edit etc/config/Transsmision conffig file for storing downloaded torrentss to my USB HDD mnt/sda1/Torrents/...

I am testing if it is really caused by Transmission or any other module/ files / etc... Thanks guys!

/edit: CONFIRMED, problem is caused by Transmission - any ideas?

---------------------------------------------------------------------------------------
edit1: I flashed v1216 and it seems, it is working, but after 1 hour there is a next problem:
I am really tired of testing this version, maybe i will go back to stable version without any issues at all... (Except 5G wifi won´t autoboot I can live with it)

Error after 1h:
/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute function dispatcher target for entry '/'.The called action terminated with an exception:/usr/lib/lua/luci/sauth.lua:60: Security Exception: Session ID is invalid!stack traceback:        [C]: in function 'assert'        /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'        /usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>
Maybe anybody will know what can cause this error msg? Thanks!

edit2: Rebooted.. and test again if the problem occurs

(Last edited by kaper on 23 Jan 2016, 22:22)

Hey StrangeOrange I have been running your openwrt optimal since today and 2 devices can't connect to the internet anymore.
A Philips Fidelio speaker (9800w) and the Heos link.

Could it be because of the different local IP range? I removed the MODEM switch and the text in firewall.user and hosts. Changed back the IP of the lan switch to 192.168.1.1. The two devices still won't connect and my macbook can't ssh into the router or reach the luci interface anymore.

Any idea's? I have an old settings backup from pandorabox. Perhaps replace some config files after a reset? Don't know which ones.

(Last edited by aldo on 24 Jan 2016, 00:43)

Firstly i have to say, that i am disappointed that this FW is useless for me, i am missing some cool features from stock pandora, ip bandwidth...

I thought that this FW is tested, and is "stable", but is not.
I tried to do all my best to test my patch, but its not stable at all. I tried both version.

I am back on STABLE release v1214 -> there is one thing which not work, and it is autostart 5G wifi -> i can live with it, but if anybody know how to fix it, i will be happy.
( I don´t know how and why. But my 5G now starts after reboot - smile Nice... Hope this will stay)

Thanks to StrangeOrange, but if can recommend, i would better create stable FW - deoxided from bloatware, but i don´t see any sesne to remove bloatware from testing release, which are not stable.

Good luck to all. smile Byeee

Off-topic warning

kaper wrote:

Firstly i have to say, that i am disappointed that this FW is useless for me, [...]

To put things in context, this person (user "KartiQ" from the MIUI forum, where I also posted this firmware) expected me to provide support over private messages and log in to his router remotely to fix his problems, and the problems were essentially that he wanted to reinstall and use the traffic accounting interface ("IP Bandwidth"), which I removed along with some other packages, but he did not want to build his own custom version from the sources I provided but instead wanted to do it by putting some of the removed files back into the filesystem.

I was assisting him initially but at some point, as it became apparent that my contribution towards finding a solution for his problem exceeded his own contribution, I bailed out. I responded to him already in the original thread, so I don't know what the purpose for bringing all this here is but if he had the same motivation towards patching PandoraBox that he has for discussing his expectations of what my patch should provide for him, we'd already be halfway through to a flawless version of PandoraBox ready for everyone to flash.

To avoid causing any further disappointment, I'd like to emphasize that I never claimed my patched firmware will be useful for user "kaper" or "KarthiQ," or for anyone else for that matter. The way it works is basically: "here it is, I did it, it works for me, and you can have it too, as it is." In particular, if your needs are very different than mine, you will need to evaluate your options carefully. Feel free to use my patch or the source as a base for what you want to have, but if you require some specific functionality, you might need to put some of your own work into setting it up. Please be aware of this. There are some limitations or bugs in PandoraBox, even with the latest version (their bug tracker currently has 49 issues open), and I could only deal with some of the most annoying things (from my point of view), I will not be able to fix all the other ones.

Thank you for your understanding, and I wish everyone a great Sunday evening or afternoon, depending on the timezone you are in.

@StrangeOrange, to be clear, for sure majority take it as it is, it's only your good will you are sharing it with us.
Any your response id absolutely on top and we really appreciate it. At least I do. THANK YOU, don't give up!

Hello again, just to be clear.

I have no objection to your (StrangeOrange) person anything wrong, I just said my opinion and my experience with this FW. I tried rebuild it with your patches, as you helped me, but as you can see, i was getting errors.

As i wrote on MIUI Forum:
-You are talking with me as with developer, but I am not! Please respect it. I am just noob user, I am new in openwrt, and as every user, i just need some stable and solid FW in my small box.

- What is bad on PM? I just wrote you my login, for check settings, not for fixing my problems... nvm...

-I spent my 2 days of free time testing this fw and do this FW better, but i don´t enough skills and knowledge to make own custom FW etc.

-I am not blaming on you smile.  As I wrote, I appreciate your work, unfortunately things, which i need are not included, and i tried bring these things back, but everytime i had different problems.

I think only time will tell the views and experiences of other people on your work / FW. But I am afraid that few users are looking and using WRT on Xiaomi. Most of them are using original FW. (Although there is useless app on mobile, but for most ppl, this is so cool and they are happy with it...)

Just peace, and keep the good work.  (Sry for my english)

(Last edited by kaper on 24 Jan 2016, 15:35)

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.

This might also be caused by a number of other factors, such as your modem overheating or suffering from a memory leak if it's been running for a long time without a reboot.

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.

Hi StrangeOrange, thx for your work, this patched version rocks, best so far in my xiaomi mi wifi. 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?)

Thanks everybody for this useful forum/thread.

Regards

StrangeOrange wrote:

Update #3 to my patched version, and this time a significant one, as I discovered where some newer builds of PandoraBox are located. Accordingly, I was able to update the PandoraBox base for my images from release 1216 up to 1597, the latest one at the moment. It's still OpenWrt Barrier Breaker but it appears some parts were backported from newer branches.

There were many changes between the two releases, which meant I needed to redo a lot of my patches. There was some new stuff that needed to be removed and a couple of issues by default but I managed to sort them out (I think), and it all works well now, at least for me.

Some changes to the Wi-Fi setup suggest that performance might improve, and the package repository is slightly more up-to-date, so hopefully it was worth it. Also, as there's nothing wrong with the previous version, and flashing any new one might be potentially opening, so to say, Pandora's box for some people, I kept the previous update (#2) in the downloads folder as well. Please make sure you get the one you want.

Just a short heads-up about this here so as not to abuse the hospitality of the OpenWrt forum (which is much appreciated) but I always update the original post whenever there is anything new so please look there for full changelog and downloads.

(Anything below is unrelated to the new version announcement above.)


darkpsy wrote:

If I set WPS setting to "Disable", it's disabled indeed. But if I reboot the router - I see that WPS is enabled again

That's not a bug, that's a "feature" of PandoraBox: just like the regulatory domain, the WPS settings are hardcoded into /lib/netifd/wireless/*.sh and /lib/wifi/*.sh, so you'd need to make changes there. If you want to get rid of WPS completely, there's also /bin/wps_pbc activated from /etc/rc.button/reset.

irwan6179 wrote:

Anyone else having trouble using 5Ghz in client mode? I'm using Luci but can't get the scanning button to work.

I haven't really tried such a setup myself and in fact I wouldn't even have a way to test it now but I think your best bet is to have a look into the files above and see whatever hardcoded defaults are there that might be preventing it. This is a general note for anyone attempting a more complicated setup, the clash with the settings hardcoded into one of the myriad PandoraBox scripts is inevitable.

gazambuja wrote:

@StrangeOrange how to add new packages to this custom firmware? (I follow the *Edit* instructions)

Manually: opkg --force-overwrite --offline-root /tmp/fw_fs install <PackageName>.ipk

If you want to automate it, feel free to adapt to your needs the script 4_Patch_Optimal.sh in scripts_patch.tar.gz within the Source ZIP file. If you were redoing the whole patch, you could just add them to the add_packages directory extracted with everything else from the Source file and put into /tmp/ on the router, and then that script would install everything from that directory.

valentt wrote:

I live in EU and have lots of Huawei modems, and it would be great feature to have support for them in your image. Can you please consider putting Huawei drivers back in?

Also I would really like to be able to test how their traffic shaping works, that usually helps in having lower bufferbloat and better responsiveness.

You can install any packages you want from the PandoraBox repository (see above for instructions). OpenWrt Barrier Breaker packages might also work, although I didn't test that. All the stuff I removed, including China DNS, Shadow Socks, Oray.com binaries, whatever they were supposed to do, etc. means there's more space for packages you choose to install yourself, and that's how OpenWrt is supposed to work in the first place ("Wireless Freedom," not "one size fits all").

Getting rid of the preloaded cruft was an important reason why I made this whole thing at all but if I'm removing too much for your preference, you can also make your own custom version of the patch with the Source file I posted, and control what is being removed by editing rm_packages.txt and rm_files_*.txt. (As for the Huawei package in question, it's no longer preinstalled in the newer PandoraBox anyway, although it's probably still somewhere in the repository.)

Hi

AnnoyingOrange

your tutorial failed with miwifi firmware so let's get back on subject

[Confidential information removed]

(Last edited by jow on 25 Jan 2016, 10:53)

[Confidential information removed]

(Last edited by jow on 25 Jan 2016, 10:51)

[Confidential information removed]

(Last edited by jow on 25 Jan 2016, 10:51)

sharkys wrote:

THANK YOU, don't give up!

Thank you, and other people who have expressed support. I really appreciate it.

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.

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.)

(Last edited by StrangeOrange on 25 Jan 2016, 09:51)

sharkys wrote:

I found something weird - is it good idea to have hosts "hardcoded" ?

Eg. I got there :

10.0.0.1 OpenWrt
192.168.1.1 Modem

...while Modem got somehow another internal IP and I renamed Openwrt to something else (in System -> System), while my LAN IP is also different from 10.0.0.1. Maybe it's better to use Network -> Hostnames instead ? (I guess it's not storing values in hosts...not sure about that)

Just my '50' cents.

I somehow missed this previous post from you and didn't answer before, sorry.

There needs to be some default IP address for the local interface. I changed it to 10.0.0.1 for the reasons I mentioned before but even if I didn't do it, there would still need to be another address there (192.168.1.1 by default).

On OpenWrt this is not just the usual hosts file but also where the DNS server gets its records from for DNS and reverse-DNS lookups, and I mainly put it there for this purpose. This allows you to, by default, open http://openwrt/ to reach the Web interface, whether in the Minimal or Optimal version (with different default IP addresses). It also makes it possible to have a "green padlock" (no certificate warnings) by just adding the default certificate as trusted, without changing any other settings. I was hoping setting it up like that would save a lot of time for a lot of people: no need to do anything unless you want to change the default hostname, and if you want to change it, you know that you need to do it in this file as well.

As for the modem part, I thought it's much easier to remove it if someone doesn't need it rather than to figure out where and how to add it, and many people can benefit from this option. Also, it should be harmless unless someone is beyond a double NAT, and there are hosts on the 192.168.1.0/24 subnet they need to access as well (quite an unusual setup but perhaps I'm wrong?). I am open to removing it if there is a consensus against it, particularly so if it breaks someone's default setup.

No problem @StrangeOrange for me, really. The point was just it wasn't expected to be there while eg. you are using LuCi as I do to make required config, but I see your point now.... naturally it's very easy to be removed, so really no issue for me. There are much more important stuff, like for example make it rock stable ;-)

Btw, so far, with HW NAT disabled, all is fine so far.

International PandoraBox/OpenWrt updated, based on a newer yet PandoraBox release 1696.

Since PandoraBox keeps evolving to include more and more packages, with this update I took a new approach and as an experiment decided to keep most of what was added, only removing the China-specific stuff, FTP server, MWAN, and the (incomplete anyway) translations to languages other than English.

As a result, the current version includes in particular IP Bandwidth, the traffic accounting interface that I used to remove with my patch and Transmission, a BitTorrent Client (new in this release), as well as a couple of other packages that will be immediately noticeable from the Web interface menu. All the kernel modules that were originally provided have also been kept, with the single exception of the Simplified Chinese codepage.

Hopefully this change is in line with what (at least the most vocal) people wanted, so let's see how it works out.

As you will notice immediately when trying to log in to the Web interface, PandoraBox now comes with the Material theme as the default one. I kept it this way and made it the default in the Optimal version as well. The previous Bootstrap theme is still included however, so you can switch back to it whenever you want to. I fixed the double-slash URL issues in both of them and also removed the badly-formatted "Loading..." text in the Material theme, so it should be really enjoyable.

This new PandoraBox version also seems to have added support for some USB network cards through kernel modules: a question about it was asked before, and now it should be possible to deduce whether a card is supported by looking at the file list in /lib/modules/....

There are now three international PandoraBox versions to choose from, so hopefully there will be something for everyone:

  • Release 1216 has been used the longest and seems to work well with packages from the repository. It is also the smallest in size.

  • Release 1597 improves 2.4 GHz Wi-Fi performance and backports some functionality from newer OpenWrt versions but trying to install certain packages on top of it seems to fail for some people.

  • Release 1696 has the potential to be the best PandoraBox yet but only time will tell whether this is the case. It also remains to be seen whether there is any impact on performance due to its larger size.

I have been using release 1696 myself since I finished patching it earlier today and it works well for me but since I want to share it with everyone as soon as it is available, it could not be extensively tested, so please have that in mind.

New version of Breed bootloader also available

In other news, there is also a new version of Breed bootloader (release 833). According to the changelog the update was principally about adding support for more devices but maybe there are some smaller changes that did not warrant a mention. I mirrored it in the downloads folder but did not get to try it myself yet.

Thank you everyone, and hope you enjoy it.

(Last edited by StrangeOrange on 26 Jan 2016, 19:39)

@StrangeOrange, this sounds awesome, but let me ask you - what is the best way to perform upgrade please ?

jffs2reset -y
sysupgrade -n <filename>.bin

...and then restore config eg. via LuCI ?

Eg. no way to do it via LuCI directly ?

Btw, where to check the current PandoraBox version ? I mean mostly "release".

Thank you once more.

(Last edited by sharkys on 26 Jan 2016, 19:45)

On first boot in the Optimal version the /sbin/revert_config script will run, so the configuration will not be preserved throughout the upgrade but it can be restored anytime later. The way I'd do it:

  • To save (where [...] are any other filenames you want to backup as well):
    tar czvf /tmp/config_backup.tar.gz /etc/config/* /etc/dropbear/* /etc/ethers /etc/hosts [...]

  • Store the backup file outside the device, and then copy it over again after the update.

  • To restore:
    tar xzvf /tmp/config_backup.tar.gz -C /

After restoring the configuration manually you need to do /sbin/reload_config or reboot.

This is just one way to go about it, and probably far from the best. Backup and restore through the Web interface should work to the same effect, it's just that I never used it, so I don't know.

Update: The above is a simplified example. You need to adjust it to your specific situation. Do not overwrite all the configuration with files saved from a different version and expect it to work.

Copy only the files that you changed (from /overlay) and manually merge the changes into the new files, or, if you want to have a truly automated, version-independent configuration, one way would be to keep it as a list of uci commands.

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

Seeems that on latest version Luci don't work, at least I'm getting error below :

error loading module 'luci.controller.commands' from file '/usr/lib/lua/luci/controller/commands.lua':
    /usr/lib/lua/luci/controller/commands.lua: unexpected end in precompiled chunk
stack traceback:
    [C]: ?
    [C]: in function 'require'
    ?: in function 'createindex'
    ?: in function 'createtree'
    ?: in function 'dispatch'
    ?: in function <?:141>

I took XMWiFiMini-OpenWrt-PandoraBox-14.09r1696-StrangeOrange-Optimal-U4

sharkys wrote:

Seeems that on latest version Luci don't work

Reflashed it just to check again, and it does work for me:

http://i.imgur.com/uu2QbgQ.png

Could it be because you changed some configuration files?

The way to backup and restore the configuration I posted above was an example I was hoping you would adjust to your needs. I will edit that post now with a warning. If you overwrite all the configuration with the files from the previous version, I would expect something like that to happen.

If it's some other change please share what it was but it does work by default, with either theme.

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

Thank you, problem was naturally with /etc/config/luci only...

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

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.

(Last edited by sharkys on 27 Jan 2016, 06:50)