How to use Wifi, as client, from BPI-R2 to shared internet to Ethernet interfaces?

Hello,

I have a BPI-R2. I would like to:

  1. connect the BPI-R2 to my local network using wifi (so, as client, not acting like AP).
  2. connect my computers to Ethernet interfaces.
  3. forward internet from the wifi interface to the Ethernet.
  4. have all devices in the same network than my local network (192.168.1.0/24)

I tried different images and I struggle with the first step. The only image I found with working wifi as client is

But I couldn’t manage to share my internet connection.

I saw a similar topic from 5years ago, but restricted to OpenWRT and it was a dead end

I hope since them, things got better.

My first question is, is it possible? If so, what’s the best image for this purpose?

Thank you!

Hi Clement, welcome to the forum!

If you mean using the BPI-R2’s own built-in WiFi, then no, I don’t think this is possible. The R2’s wifi uses an old MediaTek WiFi chipset (MT6625) that was a dead end and never got mainline Linux support. There are a few patched kernels and images out there that have support for it, but these haven’t been updated in years and I would not use them. I fought with the source code to try and get this driver to work in modern OpenWrt builds and failed.

In my view, the only real option is to get a mPCIe card for the R2 and use it that way. This is what I do. I have an AsiaRF AW7915-NP1 card in mine, and this works very very well with all modern versions of OpenWrt

If you have or get a card like this, then yes, what you want is very possible. One of two ways:

  1. The best way is if you have another OpenWrt router as the main router broadcasting WiFi. Then you can use WDS mode on the main router (access point) and the second router (wifi/ethernet bridge) and it will work seeamlessly.
  2. If your main router isn’t also OpenWrt then you need to set up the second router as a client bridge. Instructions are here: https://openwrt.org/docs/guide-user/network/wifi/relay_configuration

My R2 with the 7915 card in it is working as a client bridge right now, and it works great.

You could even use a cheap mt7612en…

If you must have the same subnet, then you do not use maquerade / nat.

This means that you need to put the wifi and lan ports on the very same bridge. Then also dhcp negotiation goes over the wifi connection to the main router. Then your ethernet clients are in the same subnet as the wifi clients of the router.

Thank you for your answers! It is very unfortunate that I cannot use the MT6625. I got this board because of the integrated wifi chip.

I have couple of wifi card at home, they were meant for other devices, but I’ll try with them, otherwise I’ll get the one you recommend.

I have upported the messy driver for mt6625l long time but changes in linux 6.0 were too much to change it.

But you can my 5.15 lts kernel which has support for it some years as it is a LTS

Sry

I’d like to try that :slight_smile: Where shall I start? Do you have an image somewhere? or do I need to build my own (if so, do you have a doc)? Thanks!

I have some images (debian/ubuntu) posted here in forum but afaik not with 5.15,but you can replace kernel with precompiled from my github-repo (releases page)

Here what I did.

From https://drive.google.com/drive/folders/1oP7jy1KrrIOifvImo2nQ59wx3_9hHkgk I got the image bpi-r2-buster_5.4.58.img. I copied it on the SD Card

sudo dd status=progress if=bpi-r2-buster_5.4.58.img of=/dev/sdb

Then I cloned this repo

git clone https://github.com/frank-w/BPI-Router-Linux

And follow the instructions

sudo apt install gcc-arm-linux-gnueabihf libc6-armhf-cross u-boot-tools bc make ccache gcc libc6-dev libncurses5-dev libssl-dev bison flex

cd BPI-Router-Linux
./build.sh importconfig
./build.sh

Then I extracted the archive

cd
gunzip SD/bpi-r2_5.15.103-main.tar.gz
tar -xf SD/bpi-r2_5.15.103-main.tar

I update the boot partition

mkdir boot
sudo mount /dev/sdb1 boot
sudo rm -r boot/bananapi/bpi-r2/linux
sudo cp -r BPI-BOOT/bananapi/bpi-r2/linux boot/bananapi/bpi-r2
sudo umount boot

Then I add the files for the root partition

mkdir root
sudo mount /dev/sdb2 root
sudo rsync -a BPI-ROOT/ root
sudo umount root

After I boot, I can see the kernel is right one

root@bpi-r2:~# uname -r
5.15.103-bpi-r2-main
root@bpi-r2:~#

But I cannot see the wifi card (I’d expect something like wlan)

root@bpi-r2:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether fa:b2:e0:a1:98:26 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether de:3b:0e:ae:a1:58 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether fa:b2:e0:a1:98:26 brd ff:ff:ff:ff:ff:ff
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
7: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether fa:b2:e0:a1:98:26 brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether fa:b2:e0:a1:98:26 brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether fa:b2:e0:a1:98:26 brd ff:ff:ff:ff:ff:ff
10: aux@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether fa:b2:e0:a1:98:26 brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~#

Which step did I miss?

I also tried

root@bpi-r2:~# wmt_loader 
init combo devic[  881.746261] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 801)
e
[  881.754767] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[  881.762354] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[  881.770865] set current consys chipid (0x7623)
 id : 30243
[  881.776676] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [  881.785376] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[  881.800224] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  881.807718] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  881.815137] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  881.825543] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[  881.832494] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, ret:-1
[  881.841448] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
do module init: [  881.849716] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 801)
30243
failed to init module 
root@bpi-r2:~#

But it seems to have an issue and ip link confirms that no new interface appears.

there are 2 commands needed to make it work…look in the wifi.sh i have on my lts-main-branches (5.4-main,5.10-main,5.15-main).

have you loaded the wifi-modules?

I’m sorry, I probably miss something obvious, but I cannot find the wifi.sh in the repo :confused:

Here the list of loaded modules

root@bpi-r2:~# lsmod
Module                  Size  Used by
spidev                 20480  0
lima                   61440  0
gpu_sched              40960  1 lima
spi_mt65xx             20480  0
pwm_mediatek           16384  0
mtk_pmic_keys          16384  0
ip_tables              24576  0
x_tables               36864  1 ip_tables
root@bpi-r2:~#

Ok, this script is not present in 5.15 branch, that’s why I could find it. Thanks.

root@bpi-r2:~# modprobe wlan_gen2
[   37.285353] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   37.317984] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   37.327683] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   37.336386] cfg80211: failed to load regulatory.db
[   37.356189] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[   38.277974] vusb: disabling
[   38.280818] vmc: disabling
[   38.283533] vmch: disabling
[   38.286334] vgp1: disabling
[   38.289241] vcamaf: disabling
[   38.866464] [WMT-STP-EXP][E]mtk_wcn_wmt_msgcb_reg(384):ERROR! mtk_wcn_wmt_msgcb_reg_f cb is null
root@bpi-r2:~# lsmod
Module                  Size  Used by
wlan_gen2            1548288  0
wmt_chrdev_wifi        20480  1 wlan_gen2
cfg80211              753664  1 wlan_gen2
spidev                 20480  0
lima                   61440  0
gpu_sched              40960  1 lima
spi_mt65xx             20480  0
pwm_mediatek           16384  0
mtk_pmic_keys          16384  0
ip_tables              24576  0
x_tables               36864  1 ip_tables
root@bpi-r2:~# wmt_loader
init combo devic[   64.976447] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 398)
e
[   64.984973] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[   64.992541] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[   65.001058] set current consys chipid (0x7623)
 id : 30243
[   65.006862] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [   65.015539] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[   65.034180] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[   65.041655] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[   65.049119] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[   65.059377] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[   65.066216] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, ret:-1
[   65.075243] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
do module init: [   65.083573] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 398)
30243
failed to init module 
root@bpi-r2:~# 

It seems there is still an issue.

There is no file regulatory.db on the system. Is such file expected?

root@bpi-r2:~# find / -name "regulatory*"
/sys/devices/platform/regulatory.0
/sys/bus/platform/devices/regulatory.0
root@bpi-r2:~#

I have some wmt entries in dev

root@bpi-r2:~# ls /dev/wmt*
/dev/wmtWifi  /dev/wmtdetect
root@bpi-r2:~# 

but it seems not fully working

root@bpi-r2:~# echo 0 >/dev/wmtWifi
root@bpi-r2:~# echo A >/dev/wmtWifi
-bash: echo: write error: Input/output error
root@bpi-r2:~#

Have you started the stp command and is it running?

Look in wifi.sh for more

Regulatory.db is not needed for wifi driver. It is maybe needed for 5g if there is no other way to load regulatory (afair crda works around this and uses builtin regdb from linux kernel).

I use 5.15 (afaik .80) on my router with the internal wifi and debian.

This is what I did

root@bpi-r2:~# modprobe wlan_gen2
[  219.227826] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  219.266336] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  219.276124] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[  219.284950] cfg80211: failed to load regulatory.db
[  219.304175] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[  220.816372] [WMT-STP-EXP][E]mtk_wcn_wmt_msgcb_reg(384):ERROR! mtk_wcn_wmt_msgcb_reg_f cb is null
root@bpi-r2:~# wmt_loader
init combo devic[  243.928446] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 481)
e
[  243.936815] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[  243.944428] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[  243.953067] set current consys chipid (0x7623)
 id : 30243
[  243.958905] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [  243.967550] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[  243.984982] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  243.992513] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  243.999982] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  244.010457] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[  244.017353] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, ret:-1
[  244.026269] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
do module init: [  244.034492] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 481)
30243
failed to init module 
root@bpi-r2:~# /usr/bin/stp_uart_launcher -p /etc/firmware &
[1] 500
open device node[  269.549738] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
 succeed.(Node:/[  269.557929] vcn18: mode operation not allowed
dev/stpwmt, fd:3) 
chip id is 0x7623
chiId:0x7623, setting to property(D?)
chiId:0x7623
run SOC chip flow
create pwr on thread ok
root@bpi-r2:~# [  269.565295] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(290):Read CONSYS chipId(0xfffff093)
[  269.667753] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  269.683691] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  269.691161] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
enter power on connsys flowpatch name pre-fix:ROMv2_lm_patch
fwVersion:0x8a00
/etc/firmware/ROMv2_lm_patch_1_0_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x22,0x00,0x06,0x00
gpatchnum = [2]
gdwonseq = [2]
/etc/firmware/ROMv2_lm_patch_1_1_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x21,0x00,0x0e,0xf0
gdwonseq = [1]
cmd(srh_patch) resp(ok)
[  270.254157] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup

root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 6e:7f:c2:2b:84:d7 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6c7f:c2ff:fe2b:84d7/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:e3:c9:da:46:30 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 6e:7f:c2:2b:84:d7 brd ff:ff:ff:ff:ff:ff
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
7: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6e:7f:c2:2b:84:d7 brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6e:7f:c2:2b:84:d7 brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6e:7f:c2:2b:84:d7 brd ff:ff:ff:ff:ff:ff
10: aux@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6e:7f:c2:2b:84:d7 brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~#

Now that I found your release page, I will try with one from your CI

Steps I followed

Clean old folders

rm -rf BPI-BOOT
rm -rf BPI-ROOT

Get the build

wget https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-5.15-main-5.15.103-2023-03-18_2023/bpi-r2_5.15.103-main.tar.gz
gunzip bpi-r2_5.15.103-main.tar.gz
tar -xf bpi-r2_5.15.103-main.tar

Boot partition

mkdir -p boot
sudo mount /dev/sdb1 boot
sudo rm -r boot/bananapi/bpi-r2/linux
sudo cp -r BPI-BOOT/bananapi/bpi-r2/linux boot/bananapi/bpi-r2
sudo umount boot

Root partition

mkdir -p root
sudo mount /dev/sdb2 root
sudo rsync -a BPI-ROOT/ root
sudo umount root

Still no luck

root@bpi-r2:~# uname -a
Linux bpi-r2 5.15.103-bpi-r2-main #1 SMP Sat Mar 18 20:23:21 UTC 2023 armv7l GNU/Linux
root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
    inet6 fe80::544e:25ff:fed7:d7af/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether c2:6a:d1:00:27:97 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
7: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
10: aux@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~# lsmod 
Module                  Size  Used by
spidev                 20480  0
lima                   61440  0
gpu_sched              40960  1 lima
pwm_mediatek           16384  0
spi_mt65xx             20480  0
mtk_pmic_keys          16384  0
ip_tables              24576  0
x_tables               36864  1 ip_tables
root@bpi-r2:~# modprobe wlan_gen2
[  384.043894] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  384.078283] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  384.085224] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[  384.093926] cfg80211: failed to load regulatory.db
[  384.113332] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[  385.444029] [WMT-STP-EXP][E]mtk_wcn_wmt_msgcb_reg(384):ERROR! mtk_wcn_wmt_msgcb_reg_f cb is null
root@bpi-r2:~# wmt_loader
init combo devic[  442.935929] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 592)
e
[  442.944354] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[  442.951827] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[  442.960522] set current consys chipid (0x7623)
 id : 30243
[  442.966322] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [  442.975011] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[  442.989877] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  442.997426] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  443.004856] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  443.015111] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[  443.022073] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, ret:-1
[  443.031039] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
do module init: [  443.039317] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 592)
30243
failed to init module 
root@bpi-r2:~# /usr/bin/stp_uart_launcher -p /etc/firmware &
[1] 609
open device node[  455.307732] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
 succeed.(Node:/[  455.315921] vcn18: mode operation not allowed
dev/stpwmt, fd:3) 
chip id is 0x7623
chiId:0x7623, setting to property(D?)
chiId:0x7623
run SOC chip flow
create pwr on thread ok
root@bpi-r2:~# [  455.323922] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(290):Read CONSYS chipId(0xfffff093)
[  455.417182] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  455.433112] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  455.440592] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
enter power on connsys flowpatch name pre-fix:ROMv2_lm_patch
fwVersion:0x8a00
/etc/firmware/ROMv2_lm_patch_1_0_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x22,0x00,0x06,0x00
gpatchnum = [2]
gdwonseq = [2]
/etc/firmware/ROMv2_lm_patch_1_1_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x21,0x00,0x0e,0xf0
gdwonseq = [1]
cmd(srh_patch) resp(ok)
[  456.002596] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup

root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
    inet6 fe80::544e:25ff:fed7:d7af/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether c2:6a:d1:00:27:97 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
7: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
10: aux@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 56:4e:25:d7:d7:af brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~#

Since you mention the .80, I try this one.

Clean old folders

rm -rf BPI-BOOT
rm -rf BPI-ROOT

Get the build

wget https://github.com/frank-w/BPI-Router-Linux/releases/download/CI-BUILD-5.15-main-5.15.80-2022-11-28_1508/bpi-r2_5.15.80-main.tar.gz
gunzip bpi-r2_5.15.80-main.tar.gz
tar -xf bpi-r2_5.15.80-main.tar

Boot partition

mkdir -p boot
sudo mount /dev/sdb1 boot
sudo rm -r boot/bananapi/bpi-r2/linux
sudo cp -r BPI-BOOT/bananapi/bpi-r2/linux boot/bananapi/bpi-r2
sudo umount boot

Root partition

mkdir -p root
sudo mount /dev/sdb2 root
sudo rsync -a BPI-ROOT/ root
sudo umount root

It still doesn’t work.

root@bpi-r2:~# uname -a
Linux bpi-r2 5.15.80-bpi-r2-main #1 SMP Mon Nov 28 15:08:19 UTC 2022 armv7l GNU/Linux
root@bpi-r2:~# modprobe wlan_gen2
[  135.731277] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  135.763721] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  135.770683] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[  135.779383] cfg80211: failed to load regulatory.db
[  135.799421] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[  137.129955] [WMT-STP-EXP][E]mtk_wcn_wmt_msgcb_reg(384):ERROR! mtk_wcn_wmt_msgcb_reg_f cb is null
root@bpi-r2:~# wmt_loader
init combo devic[  157.375853] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 452)
e
[  157.384348] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[  157.391759] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[  157.400432] set current consys chipid (0x7623)
 id : 30243
[  157.406252] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [  157.414926] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[  157.429727] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  157.437260] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  157.444686] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  157.454973] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[  157.461939] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, ret:-1
[  157.470918] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
do module init: [  157.479275] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 452)
30243
failed to init module 
root@bpi-r2:~# /usr/bin/stp_uart_launcher -p /etc/firmware &
[1] 473
open device node[  186.257747] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
 succeed.(Node:/[  186.266192] vcn18: mode operation not allowed
dev/stpwmt, fd:3) 
chip id is 0x7623
chiId:0x7623, setting to property(D?)
chiId:0x7623
run SOC chip flow
create pwr on thread ok
root@bpi-r2:~# [  186.273907] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(290):Read CONSYS chipId(0xfffff093)
[  186.367209] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  186.383158] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  186.390631] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
enter power on connsys flowpatch name pre-fix:ROMv2_lm_patch
fwVersion:0x8a00
/etc/firmware/ROMv2_lm_patch_1_0_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x22,0x00,0x06,0x00
gpatchnum = [2]
gdwonseq = [2]
/etc/firmware/ROMv2_lm_patch_1_1_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x21,0x00,0x0e,0xf0
gdwonseq = [1]
cmd(srh_patch) resp(ok)
[  186.951212] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup

root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether de:87:5b:45:b4:40 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::dc87:5bff:fe45:b440/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 36:fe:97:44:1d:11 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether de:87:5b:45:b4:40 brd ff:ff:ff:ff:ff:ff
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
7: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether de:87:5b:45:b4:40 brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether de:87:5b:45:b4:40 brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether de:87:5b:45:b4:40 brd ff:ff:ff:ff:ff:ff
10: aux@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether de:87:5b:45:b4:40 brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~#

I don’t know what am I missing :frowning:

Ok, I have a clue on which steps I’m missing. I tried the kernel 5.10 and I managed to get the AP mode. From wifi.sh, I understood that I need to write something the device wmtWifi. So 0 is to reset the device, A for AP mode. What am I suppose to write to get the wifi working as client? I stupidly write 1 and I think I’m into something :slight_smile:

root@bpi-r2:~# echo 1 >/dev/wmtWifi
[  455.810358] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 395)
[  455.817143] [MTK-WIFI] WIFI_write: WIFI_write 1
[  455.817143] 
[  455.862938] kalFirmwareImageMapping firmware size 225840
[  456.901646] DEBUG: Passed wlanNetRegister 2264 devname:mt6625_%d
[  456.908748] DEBUG: Passed wlanNetRegister 2273 devname:mt6625_0 (need to be used everywhere "wlan0" is used)
[  456.918804] [MTK-WIFI] register_set_p2p_mode_handler: (pid 437) register set p2p mode handler 99402b16
[  456.928326] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
[  456.934160] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 395)
root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b6:e9:7c:8b:21:27 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b4e9:7cff:fe8b:2127/64 scope link 
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
4: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether b6:e9:7c:8b:21:27 brd ff:ff:ff:ff:ff:ff
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b6:e9:7c:8b:21:27 brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b6:e9:7c:8b:21:27 brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b6:e9:7c:8b:21:27 brd ff:ff:ff:ff:ff:ff
11: mt6625_0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:08:22:b2:64:02 brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~#

I rebooted and configured the interface

auto mt6625_0
iface mt6625_0 inet static
   address 192.168.1.19
   netmask 255.255.255.0
   gateway 192.168.1.1
   wpa-ssid XXXX
   wpa-psk XXXX
   wpa-key-mgmt WPA-PSK
   wpa-group CCMP
   wpa-auth-alg OPEN
   wpa-proto WPA RSN
   wpa-scan-ssid 1

But still doesn’t work

root@bpi-r2:~# wmt_loader
init combo devic[   60.809529] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 414)
e
[   60.817997] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[   60.825412] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[   60.834123] set current consys chipid (0x7623)
 id : 30243
[   60.839973] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [   60.848622] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[   60.869537] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[   60.877021] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[   60.884482] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[   60.894932] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[   60.901902] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, ret:-1
[   60.910879] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
do module init: [   60.919055] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 414)
30243
failed to init module 
root@bpi-r2:~# /usr/bin/stp_uart_launcher -p /etc/firmware &
[1] 427
open device node[   68.402263] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
 succeed.(Node:/[   68.410482] vcn18: mode operation not allowed
dev/stpwmt, fd:3) 
chip id is 0x7623
chiId:0x7623, setting to property(D?)
chiId:0x7623
run SOC chip flow
create pwr on thread ok
root@bpi-r2:~# [   68.417816] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(290):Read CONSYS chipId(0xfffff093)
[   68.510588] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[   68.526512] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[   68.533992] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
enter power on connsys flowpatch name pre-fix:ROMv2_lm_patch
fwVersion:0x8a00
/etc/firmware/ROMv2_lm_patch_1_0_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x22,0x00,0x06,0x00
gpatchnum = [2]
gdwonseq = [2]
/etc/firmware/ROMv2_lm_patch_1_1_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x21,0x00,0x0e,0xf0
gdwonseq = [1]
cmd(srh_patch) resp(ok)
[   69.120181] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup

root@bpi-r2:~# modprobe wlan_gen2
[   91.058031] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   91.089966] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   91.099716] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   91.108442] cfg80211: failed to load regulatory.db
[   91.124199] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
root@bpi-r2:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
4: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~# echo 1 >/dev/wmtWifi
[  110.280502] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 392)
[  110.287400] [MTK-WIFI] WIFI_write: WIFI_write 1
[  110.287400] 
[  110.337372] kalFirmwareImageMapping firmware size 225840
[  111.391925] DEBUG: Passed wlanNetRegister 2264 devname:mt6625_%d
[  111.399036] DEBUG: Passed wlanNetRegister 2273 devname:mt6625_0 (need to be used everywhere "wlan0" is used)
[  111.409146] [MTK-WIFI] register_set_p2p_mode_handler: (pid 419) register set p2p mode handler 20491810
[  111.418718] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
[  111.424564] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 392)
root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::1436:82ff:fed3:f54f/64 scope link 
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
4: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
9: mt6625_0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:08:22:0c:1f:fd brd ff:ff:ff:ff:ff:ff
root@bpi-r2:~# ifup mt6625_0
RTNETLINK answers: File exists
ifup: failed to bring up mt6625_0
root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::1436:82ff:fed3:f54f/64 scope link 
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
4: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 08:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global lan0
       valid_lft forever preferred_lft forever
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 16:36:82:d3:f5:4f brd ff:ff:ff:ff:ff:ff
9: mt6625_0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:08:22:0c:1f:fd brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.19/24 brd 192.168.1.255 scope global mt6625_0
       valid_lft forever preferred_lft forever
root@bpi-r2:~#

I never used client mode with the internal wifi,so it is possible that driver is broken here. I renamed the original wlan0 (was hardcoded in driver) to mt6625_0 to avoid clashes with pcie wifi-cards because for ap-mode this is only a control interface as step between to get ap0 interface…maybe for client-mode it does more.