Support for Xiaomi Wifi R3P Pro?

Messing with wireless interfaces I got into boot loop.
Basically I've removed all non-working wireless networks:

  • the ones on .1.5, 2.2

Then wanted to configure repeater mode to my another AP on 1.2:

  • I've scanned networks
  • configured the one I wanted to connect to
  • enabled repeater mode
  • reloaded config for activation

Since the connection was not established I tried to scan again - no networks found. Maybe because of the repeater mode - so I disabled it and reloaded config.
Before I could start another scan, router rebooted and keeps so. Reset button does not seem to work either (it worked before on OpenWRT, I've tried).
Probably I'll have to do the stock recovery with USB.

If I'll be able to recover, in spare time I'll prepare uart for deeper debuging.

@lolyinseo honestly i don't know... it seems like "all's well that ends well" so i just assumed the mt7615 driver needed that time (for whatever reason) as it ended up coming up OK in the end...

@tekaeren unfortunately i'm on the road now and don't have access to my router at the moment (should be back over the weekend)...

regarding mt7615.1/2 and APCli/AP ... IIRC for each (physical) interface (ie, ra0 and rai0) we get 3 "interfaces"... (off the top of my head: ra0 => ra0 + rax0 + apcli0)... where ra0 is 5ghz, rax0 is 2.4ghz and honestly i have no idea what apcli0 is (but what you say in your message makes sense)... similarly for rai0 (the 2nd physical interface)

in response to your question of "how the use of bands on these interfaces" etc... I tried to say something about it in my previous posts, but you seem to have arrived at the same conclusions: we need to disable one of the frequencies (2.4ghz/5ghz) for each physical card. hence my script (which is pretty basic) turns off (IIRC) ra0 (5ghz on 1st chip), ray0 (2.4ghz on 2nd chip) and (i think) apcli0 (again for first chip)... as you seem to have seen, you end up with a very weak 5ghz signal on mt7615.1.5 if you don't disable it.

as for luci and interfaces... yeah it's pretty annoying how that works. the real thing we need to figure out is how to configure those *.dat files ... maybe someone who has pandorabox can take a look at what their configuration files are like (or something)

as for disabling interfaces (after making changes with luci)... you can just do it manually (see also /etc/init.d/mtkwifi ... i'm writing the following off the top of my head)

BAD_IFS="ra0 ray0 apcli0"
for i in $BAD_IFS
do
    /sbin/ifconfig $i down
done

my goal so far has been to bring up wifi/openwrt on R3P ... obviously there are more "nits" that need to be cleaned up (like you're pointing out wrt luci etc)

@tekaeren thanks for the testing... you should be able to recover from the bootloop, although maybe because you didn't set the nvram flags just plugging in a USB stick won't work.

you'll know more once you connect to the uart, but if you're bootlooping openwrt (and not stock), press '4' on the bootloder menu and then set the 'flag_try_sys2_failed' (IIRC) to 1 and 'flag_try_sys1_failed' to 0 and saveenv and reset. that should boot you into stock recovery mode.

let me know how it goes.

thanks for testing

PS: @tekaeren my /etc/init.d script brings up mt7615 at boot-up, but obviously if you've made configuration changes that cause it to panic you're going to get stuck in a boot-loop (like you have). in the future, when making (untested) configuration changes, disable /etc/init.d/mtkwifi first. that way at least you'll be able to boot.

@pellmen ... don't need to revert to stock

however (in the new partitioning scheme after booting openwrt) there is no more "kernel1" or "rootfs0" partition... there is a combined "firmware" partition instead.

so instead you'll do


mtd write factory.bin firmware
reboot

(or:
mtd -r write factory.bin firmware
)

BTW, good question. I'll add something to the release notes.

1 Like

@ilyas I will be getting home from work in a few hours so I'd like to install this finally. Is there any chance we could get a simple installation guide up.

I've got a bundle of network devices, IP cameras and smart home devices so I can give this firmware a good run.

Oh and how about a factory restore method for reverting back to factory if needed?...

@SOUK: see the release notes on github for the installation guide. there's also information on how to restore to factory (stock) rom. let me know if they're incomplete or confusing.

1 Like

If you speak russian, you can read my post with instructions here.
And in @ilyas's repo in release info it already exists in English.

1 Like

Router revived. It took some time, and even I've used USB with Xiaomi firmware file the router got back to OpenWRT. Have no idea why - it did not work earlier.

More testing coming:

  • it seems that WiFi settings from MTK tab are not part of router config backup - or I've just forgot to export after I made those
  • it managed to connect to upstream AP via appcli (type STA) interface. No IP was assigned, no routing, or access to upstream network available. I'll check how my other Lede/OpenWRT box has this configured.
  • enable/disable button for wireless interfaces in lede does nothing - state resets after page reload.

@ilyas as mentioned earlier the appclii/appclix interfaces are configured for connecting upstream AP in relay mode. In fact I'm using that config right now with my other box, and want to be able to set it up with r3p.

@tekaeren check the "bridge" settings if you're not getting an IP address or traffic:

brctl show

make sure the apcli interface you are trying to use is included in the "bridge"

@pellmen just checked your installation instructions on 4pda.ru ...
one small 'nit':

the two commands:


mtd write factory.bin firmware
reboot

are equivalent to the single command:

mtd -r write factory.bin firmware

(the "-r" flag to mtd tells it to reboot after writing)

FWIW :wink:

btw, very nice, concise, well-organized build instructions and information... you guys at 4pda are awesome.

2 Likes

br-lan includes all apcli* interfaces - it rather looks like dhcp client is not started on these. I'll investigate later.

Another issue: when You remove wireless interface and want to add it again You'll get 500 error form LuCI. Interface template seems to be broken for 'vifs' field.

Failed to execute template dispatcher target for entry '/admin/mtk/wifi'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:97: Failed to execute template 'admin_mtk/mtk_wifi_overview'.
A runtime error occurred: [string "/usr/lib/lua/luci/view/admin_mtk/mtk_wifi_o..."]:9: attempt to index field 'vifs' (a nil value)
stack traceback:
	[string "/usr/lib/lua/luci/view/admin_mtk/mtk_wifi_o..."]:9: in main chunk
stack traceback:
	[C]: in function 'error'
	/usr/lib/lua/luci/template.lua:97: in function 
	(tail call): ?
	/usr/lib/lua/luci/dispatcher.lua:849: in function

Brilliant, thank you.

R3p does work in repeater mode when enabled MAC clone mode on interface with APCli mode enabled.
It connects to upstream AP, and seamlessly integrates networks.

!!!Warning!!!
In this mode the upstream AP is managing traffic, serving IP via DHCP, and do routing. It is possible that You will loose access to R3P management interface while this mode is enabled.

@ilyas I've managed to reconfigure the .dat files that:

  • both .1 and .2 SoC are working in AP mode (and not .1 in APCli)
  • radios for .1.5 and .2.2 are disabled in .dat but the start script are still needed, so that interfaces are disable too.

I'd create PR on github, but can not find .dat location in https://github.com/iscilyas/openwrt-r3p repo.

@tekaeren that's all @nossiac's code... I just slapped them all together and pushed them until they worked.

As for configuring the *dat files... congratulations! they aren't part of the repository since they come from @nossiac's feeds... but maybe if you could post the most significant diff here... ? I think mt7615 needs considerably better README's for configuration....

1 Like

It's quite easy :wink:

To disable APCli mode unset value for: ApCliEnable=
To disable radio for frequency set value for: RadioOn=0

Then (without disabling scrip) the interfaces are visible, but in iwconfig transmit power show 0.

they have it https://cn.widora.io/_media/mtk_wi-fi_softap_software_programming_guide_v4.6.pdf

1 Like

@lolyinseo this will be of use.

Anyone considering properly adding this here : https://openwrt.org/supported_devices/adding_to_toh

yeah.... i have a pull request somewhere in the pipeline...

anyone who wants to go ahead and add it to the toh, go ahead. otherwise i'll do it once the changes are pushed to openwrt.

1 Like