BPI-R2 2.4Ghz and 5.6Ghz Wifi Working fine

why do you use separated ports if you bridge them together? Kernel 4.4 have eth0 for wan-ports and eth1 for wan…leave your br0 and you have same result

ok thanks will try with branch 4.9-patched. Might be a miss understanding, but i need to all 4 NICs to be plug, i was thinking it require separated ports. With only eth0, will it act as a bridge?

In any case the wifi with bridge does works. i have all my lan and ap interfaces assign to the bridge.

In 4.4 lan-ports bridged by hardware (7530) and assigned to eth0,wan is eth1. So you can use lan and wan as 2 interfaces. If you want to bridge lan and internal wifi you have to bridge ap0+eth0

Can anyone rewrite the corrects passage for active AP mode on BPI-R2 an the configuration for connect eth0 with ap0?

Thank you

Which kernel do you use? eth0 can only be bridged in 4.4.x all other kernels for r2 using lanx/wan-ports for physical access.

Imho no one has done a working lan-wifi-bridge yet. I do routing between them.

You cannot bridge it via /etc/network/interfaces because ap0 does not exist. You can try to create the bridge in wifi.sh (can be found on my github)

Meanwhile, thanks for the reply. So far I have used the last image available at the site download (https://drive.google.com/file/d/1Ze_YGDT3B1-P57wPcm3gcVFcCMfBLspL/view?usp=sharing, Ubuntu 16.04 V1.3 for BPI-R2 ). Now given the new release published on the forum regarding the 4.14 kernel I thought I would try it, but I think I understood that it is not yet fully implemented the fact of doing AP and switch on ethernet ports at the same time, so I stay on the link aforementioned.

Now then my question becomes, how do I create an ap0 + eth0, knowing that eth1 turns out to be the WAN? Also, how do I sect the iptables rules accurately?

Last thing, if I wanted to compile my image file the process is still the following? (What´s the best Practice to Build own Kernel)

Thank you so much for your availability

Official 4.14 is afaik not yet ready to use.

You don’t need to create a repo from the base…you can use my repo to get nearly actual kernel.

mainline-kernel misses some patches/code for r2…

Some infos can be found in my wiki: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:start

btw. As i said in higher kernel-versions eth0/eth1 are not directly usable…these are connections between soc and switch-chip. Do not use them in a bridge

Ok, perfect, thank you

Hey Frank, your page shows the schematic of V1 board that has a battery connector. The new V2 board doesn’t have the battery connector. It was replaced by a EMMC/SD boot switch. Do you have the new schematic?

Thanks

No,i have only a few infos about new version like the replaced battery-connector an 4pin to 2pin sata-power-connector. Nothing official

Also i have 2 v1.1-boards,one running as router, the other for testing

Hello

I build the kernel 4.4.70 for BPI-R2 on my own from the official github repository and put it together with a plain debian. Now I tried to get the WIFI working. I installed wmt_loader on the way it is descriebed in the repo. If I try to load the modules with wmt_loader I get the error Message failed to init module WIth dmesg I get the following result

[  750.394452] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 1020)
[  750.401544] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
[  750.408798] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
[  750.416143] set current consys chipid (0x7623)
[  750.420641] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
[  750.428130] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
[  750.440244] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  750.447676] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[  750.455803] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  750.463200] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[  750.471384] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  750.478800] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[  750.488645] [WMT-CONSYS-HW][E]mtk_wmt_probe(122):Wmt Cannot find pinctrl default!
[  750.496626] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[  750.503499] [BT-MOD-INIT][I]do_bluetooth_drv_init:start to do bluetooth driver init
[  750.511826] [MTK-BT] BT_init: mtk_stp_BT_chrdev driver(major 192) installed
[  750.527297] [BT-MOD-INIT][I]do_bluetooth_drv_init:finish bluetooth driver init, i_ret:0
[  750.535272] [GPS-MOD-INIT][I]do_gps_drv_init:CONFIG_MTK_COMBO_GPS is not defined
[  750.536884] vcn18: mode operation not allowed
[  750.547546] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(292):Read CONSYS         chipId(0xfffff093)
[  750.547547] [WCN-MOD-INIT][E]do_connectivity_driver_init(62):do common driver init failed, ret:-1
[  750.564794] [FM-MOD-INIT][I]do_fm_drv_init:start to do fm module init
[  750.571210] [FM-MOD-INIT][I]do_fm_drv_init:finish fm module init
[  750.577193] [WLAN-MOD-INIT][I]do_wlan_drv_init:start to do wlan module init 0x7623
[  750.584989] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 153) installed.
[  750.592570] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[  750.600756] [WLAN-MOD-INIT][I]do_wlan_drv_init:WLAN-GEN2 driver init, ret:0
[  750.607742] [WLAN-MOD-INIT][I]do_wlan_drv_init:finish wlan module init
[  750.614550] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 1020)
[  750.617126] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  750.617134] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[  750.617140] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  750.617145] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[  750.617151] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  750.617157] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[  750.617440] [WMT-CORE][E]wmt_core_stp_init(648):WMT-CORE: no hif info!
[  750.617446] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 649, (0)
[  750.617451] [WMT-CORE][E]opfunc_pwr_on(918):WMT-CORE: wmt_core_stp_init fail (-1)
[  750.617454] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 919, (0)
[  750.617459] [WMT-CORE][W]wmt_core_stp_deinit:gMtkWmtCtx.p_ic_ops is NULL
[  750.617465] [WMT-CTRL][W]wmt_ctrl_stp_conf:CTRL_STP_ENABLE but invalid Handle of WmtStp
[  750.617470] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(1), value(0) iRet:(-1)
[  750.617474] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  750.617477] [WMT-CTRL][W]wmt_ctrl_stp_conf:CTRL_STP_ENABLE but invalid Handle of WmtStp
[  750.617482] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(0), value(0) iRet:(-1)
[  750.617486] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  750.617497] [STP-BTIF][W]mtk_wcn_consys_stp_btif_rx_cb_register:NULL BTIF ID reference
               !
[  750.617498] [WMT-CTRL][W]wmt_ctrl_stp_close:mtk_wcn_stp_rxcb_unregister fail(-1)
[  750.617503] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(3), type(0), value(0) iRet:(-2)
[  750.617506] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  750.617509] [WMT-CORE][W]wmt_core_stp_deinit:end with fail:-4
[  750.836816] vcn18: mode operation not allowed
[  750.841263] [WMT-CORE][W]opfunc_pwr_off:HW_PWR_OFF ok
[  750.846297] vcn18: mode operation not allowed
[  750.852965] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(292):Read CONSYS chipId(0xfffff093)
[  750.937023] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  750.944541] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[  750.952711] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  750.960081] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[  750.968223] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  750.975563] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[  750.983941] [WMT-CORE][E]wmt_core_stp_init(648):WMT-CORE: no hif info!
[  750.990456] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 649, (0)
[  750.998537] [WMT-CORE][E]opfunc_pwr_on(918):WMT-CORE: wmt_core_stp_init fail (-1)
[  751.005961] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 919, (0)
[  751.014057] [WMT-CORE][W]wmt_core_stp_deinit:gMtkWmtCtx.p_ic_ops is NULL
[  751.020745] [WMT-CTRL][W]wmt_ctrl_stp_conf:CTRL_STP_ENABLE but invalid Handle of WmtStp
[  751.028714] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(1), value(0) iRet:(-1)
[  751.038662] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  751.046688] [WMT-CTRL][W]wmt_ctrl_stp_conf:CTRL_STP_ENABLE but invalid Handle of WmtStp
[  751.054646] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(0), value(0) iRet:(-1)
[  751.064589] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  751.072636] [STP-BTIF][W]mtk_wcn_consys_stp_btif_rx_cb_register:NULL BTIF ID reference
               !
[  751.080591] [WMT-CTRL][W]wmt_ctrl_stp_close:mtk_wcn_stp_rxcb_unregister fail(-1)
[  751.088118] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(3), type(0), value(0) iRet:(-2)
[  751.098053] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  751.106084] [WMT-CORE][W]wmt_core_stp_deinit:end with fail:-4
[  751.136786] vcn18: mode operation not allowed
[  751.141130] [WMT-CORE][W]opfunc_pwr_off:HW_PWR_OFF ok
[  751.146142] vcn18: mode operation not allowed
[  751.152299] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(292):Read CONSYS chipId(0xfffff093)
[  751.236996] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  751.244511] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[  751.252675] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  751.260038] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[  751.268171] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  751.275507] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[  751.283880] [WMT-CORE][E]wmt_core_stp_init(648):WMT-CORE: no hif info!
[  751.290382] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 649, (0)
[  751.298426] [WMT-CORE][E]opfunc_pwr_on(918):WMT-CORE: wmt_core_stp_init fail (-1)
[  751.305846] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 919, (0)
[  751.313886] [WMT-CORE][W]wmt_core_stp_deinit:gMtkWmtCtx.p_ic_ops is NULL
[  751.320549] [WMT-CTRL][W]wmt_ctrl_stp_conf:CTRL_STP_ENABLE but invalid Handle of WmtStp
[  751.328506] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(1), value(0) iRet:(-1)
[  751.338439] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  751.346462] [WMT-CTRL][W]wmt_ctrl_stp_conf:CTRL_STP_ENABLE but invalid Handle of WmtStp
[  751.354417] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(0), value(0) iRet:(-1)
[  751.364353] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  751.372400] [STP-BTIF][W]mtk_wcn_consys_stp_btif_rx_cb_register:NULL BTIF ID reference
               !
[  751.380354] [WMT-CTRL][W]wmt_ctrl_stp_close:mtk_wcn_stp_rxcb_unregister fail(-1)
[  751.387877] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(3), type(0), value(0) iRet:(-2)
[  751.397811] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[  751.405835] [WMT-CORE][W]wmt_core_stp_deinit:end with fail:-4
[  751.436773] vcn18: mode operation not allowed
[  751.441115] [WMT-CORE][W]opfunc_pwr_off:HW_PWR_OFF ok
[  751.446123] [WMT-CORE][E]opfunc_func_on(1025):func(0) pwr_on fail(-2)
[  751.452544] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 1026, (0)
[  751.460681] [WMT-LIB][W]wmtd_thread:opid (3) failed, iRet(-3)
[  751.466400] [WMT-LIB][W]wmt_lib_put_act_op:opId(3) result:-3
[  751.472062] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup
[  751.479418] [WMT-EXP][W]mtk_wcn_wmt_func_ctrl:OPID(3) type(0) fail
[  751.485554] mtk_bt_hci_open func on failed with 0

As far as I can see the FM, GPS, and BT Module is loaded successfully. The loading of the WIFI module fails with the error Message No hif Info in line 649 of file drivers/misc/mideatek/connectivity/common/conn_soc/core/wmt_core.c. The other error Messages following are a result of this error. It is retryed 3 times to load the wifi Module and each time it fails with the same error.

I hope someone here can help me to get the wifi working.

I guess you are on second step (stp_uart_launcher -p /etc/firmware)…

Have you the firmware-files in this directory?

Please show your command an ls -lR of the dir you use for that command

Hello,

Is there any chance getting wifi working with OpenWRT on BPI-R2? I managed to compile and run openwrt from garywang, but I cant see any wireless interface.

Is there any openwrt repository, that has the wifi drivers included? Or some step by step for dummies how to patch myself? All the instructions seem to be focused on Debian/Ubuntu and mounting and modifying the image, but I can’t (loop) mount the mtk-bpi-r2-SD.img

Garys openwrt should have wifi-driver included…but it has to be enabled the same way (via wmt-tools) as debian/ubuntu. Imho also lexa2’s openwrt includes wifi-driver

OK, maybe I’m missing something obvius… How do I include wmt-tools in openwrt image? I cannot mount the image. Or do I just copy the files from https://github.com/BPI-SINOVOIP/BPI-R2-bsp/tree/master/vendor/mediatek/connectivity to the live system?

I thought gary had included them in his image,but if not you should load them from binary folder

And you need config (only that this file exists) and firmwarefile. And call them like this

  1. wmt_loader
  2. stp_uart_launcher -p /etc/firmware &
  3. echo A >/dev/wmtWifi (activate AP-Mode)

Driver itself is added by this commit

https://github.com/garywangcn/bpi-r2_lede/commit/33d47e212f7f6df50c26a9522a32dda84b22c632

Wmt-utils are added here: https://github.com/garywangcn/bpi-r2_lede/commit/4c3635d6aacf666279b8f25fef5c858e6613bce7 so they should be included (also with firmware and config)

Oh OK, I did not notice that wmt tools are one of the options that can be configured during make menuconfig. It has no description so I did not think this is the killer feature. Also it is quite unusual to enable stuff this way. All the time I was looking for something like modprobe mtk6628 and for similar option in config…

Anyway, it does not work:

root@LEDE:~# wmt_loader 
init combo device
Opened combo device
get device id : 30243
set device id : 30243
do module init: 30243
failed to init module 
root@LEDE:~# stp_uart_launcher -p /etc/firmware
Can't open device node(/dev/stpwmt) error:-1 
Can't open device node(/dev/stpwmt) error:-1 
... inifinitely repeating ever 1s  ...

dmesg:

[   93.212916] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 1288)
[   93.220068] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
[   93.227253] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
[   93.234640] set current consys chipid (0x7623)
[   93.239143] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
[   93.246644] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
[   93.283876] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[   93.291252] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[   93.299389] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[   93.306747] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[   93.314885] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[   93.322229] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[   93.331596] [WMT-CONSYS-HW][E]mtk_wmt_probe(122):Wmt Cannot find pinctrl default!
[   93.339665] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[   93.346425] [BT-MOD-INIT][I]do_bluetooth_drv_init:CONFIG_MTK_COMBO_BT is not defined
[   93.354106] [WCN-MOD-INIT][E]do_connectivity_driver_init(57):do common driver init failed, ret:-1
[   93.362924] [GPS-MOD-INIT][I]do_gps_drv_init:CONFIG_MTK_COMBO_GPS is not defined
[   93.370275] [WCN-MOD-INIT][E]do_connectivity_driver_init(62):do common driver init failed, ret:-1
[   93.379089] [FM-MOD-INIT][I]do_fm_drv_init:start to do fm module init
[   93.385490] [FM-MOD-INIT][I]do_fm_drv_init:finish fm module init
[   93.391448] [WLAN-MOD-INIT][I]do_wlan_drv_init:start to do wlan module init 0x7623
[   93.399152] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 153) installed.
[   93.406690] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[   93.414403] [WLAN-MOD-INIT][I]do_wlan_drv_init:WLAN-GEN2 driver init, ret:0
[   93.421339] [WLAN-MOD-INIT][I]do_wlan_drv_init:finish wlan module init
[   93.428049] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 1288)
[ 1110.954822] [WMT-DEV][W]WMT_open:wait_event_timeout (2000)ms,(200)jiffies,return -EIO

And there is no wlan0 or ap0 interface, maybe there is some typo in the WMT_SOC.cfg ?

Wifi-driver does not yet support module…lexa2 is working on it for better debugging

Config file does not set any options…it only have to exist (else kernel crashes).

Main problem should be stp-error (cannot open device)

Try this steps here: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:wlan#known_issues

Btw. Please select your code and click on code-button (<>) it makes it more readable

Thank you, on second try it did work… Now I can see some wifi networks around…

Now it seems that wifi is working if I start everything by hand - hostapd, assign ip adresses, etc. But I cant configure it using LuCI. It just does not do anything.

When I start wmt_loader, 3 wirelss interfaces appear in luci: radio0,1,2. All with all-zeros mac address. So I tried to edit manually /etc/config/wireless and edited the values to

config wifi-device 'ap0'
        option type 'mac80211'
        option hwmode '11g'
        option macaddr '02:08:22:90:C0:FF' (the mac of wlan0 begins wit 00:xx)
        option channel '1'
        option country 'CZ'

config wifi-iface 'default_ap0'
        option device 'ap0'
        option network 'lan'
        option mode 'ap'
        option ssid 'LEDE'

I was able to edit the network options like encryption using LuCI, also added the interface to the lan bridge, or tried to make it separate - just nothing happens. As if some tools are missing or what? I tried with hostapd and wpad - neither does anything.

The only relevent thing in syslog seems to be this:

Sun Oct 20 21:46:11 2019 daemon.notice netifd: ap0 (2751): Could not find PHY for device 'ap0'
Sun Oct 20 21:46:11 2019 daemon.notice netifd: ap0 (2759): WARNING: Variable 'data' does not exist or is not an array/object

Any suggestions? I’m just stating to bang my head against wall… And wonder how can anyone sell these devices and claim that openwrt is working on them? Um… it is working after several days of fiddling and doing non standard stuff… Aaargh…