BPI-R2 integrated WiFi trouble

Echo 0 has been done before in my wifi script ( based on yours ). Now I’ve downloaded your script, and run it, but no success! I see ap0 is there, has ip address, but not visible as wifi.

Hostapd doesn’t throw anything :

/usr/sbin/hostapd -dd /etc/hostapd/hostapd_2.4_onboard.conf
nl80211: Event message available
nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for ap0
nl80211: Delete station d8:f1:5b:e7:87:b0
ap0: Event DISASSOC (1) received
ap0: STA d8:f1:5b:e7:87:b0 IEEE 802.11: disassociated
Disassociation notification for unknown STA d8:f1:5b:e7:87:b0
nl80211: Event message available
nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for ap0
nl80211: Delete station 28:6d:cd:23:13:eb
ap0: Event DISASSOC (1) received
ap0: STA 28:6d:cd:23:13:eb IEEE 802.11: disassociated
Disassociation notification for unknown STA 28:6d:cd:23:13:eb
nl80211: Event message available
nl80211: Drv Event 16 (NL80211_CMD_STOP_AP) received for ap0
ap0: Event INTERFACE_UNAVAILABLE (28) received
Interface ap0 is unavailable -- stopped
RTM_NEWLINK: ifi_index=38 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
nl80211: Interface down (ap0/ap0)
ap0: Event INTERFACE_DISABLED (26) received
ap0: INTERFACE-DISABLED 
VLAN: RTM_NEWLINK: ifi_index=38 ifname=ap0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(ap0)
RTM_DELLINK: ifi_index=38 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
RTM_DELLINK: Interface 'ap0' removed - mark if_removed=1
ap0: Event INTERFACE_STATUS (5) received
Unknown event 5
VLAN: RTM_DELLINK: ifi_index=38 ifname=ap0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_dellink(ap0)
RTM_DELLINK: ifi_index=37 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
RTM_DELLINK: Interface 'wlan0' removed
VLAN: RTM_DELLINK: ifi_index=37 ifname=wlan0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_dellink(wlan0)
nl80211: Event message available
nl80211: Ignored event (cmd=36) for foreign interface (ifindex -1 wdev 0x0)
nl80211: Event message available
nl80211: Ignored event (cmd=36) for foreign interface (ifindex -1 wdev 0x0)
RTM_NEWLINK: ifi_index=0 ifname=wlan%d wext ifi_family=0 ifi_flags=0x1002 ()
ap0: Event INTERFACE_STATUS (5) received
Unknown event 5
VLAN: RTM_NEWLINK: ifi_index=0 ifname=wlan%d ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(wlan%d)
RTM_NEWLINK: ifi_index=39 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: RTM_NEWLINK: ifi_index=39 ifname=wlan0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(wlan0)
RTM_NEWLINK: ifi_index=40 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
nl80211: Update ifindex for a removed interface
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=1
nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=6
nl80211: interface ap0 in phy phy12
nl80211: Set mode ifindex 40 iftype 3 (AP)
nl80211: Unsubscribe mgmt frames handle 0x88d2ec21 (start AP)
nl80211: Setup AP(ap0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x5a64a8 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0501
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0503
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0504
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=08
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=12
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=7f
nl80211: Probe Request reporting already on! nl_preq=0x88d2fbc1
nl80211: Connect handle already created (nl_connect=0x5a59e0)
nl80211: Mark if_removed=0 for ap0 based on RTM_NEWLINK event
ap0: Event INTERFACE_STATUS (5) received
Unknown event 5
RTM_NEWLINK: ifi_index=40 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
nl80211: Interface up (ap0/ap0)
ap0: Event INTERFACE_ENABLED (25) received
ap0: INTERFACE-ENABLED 
wpa_driver_nl80211_set_key: ifindex=40 (ap0) alg=3 addr=0x53f9fc key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=58): 80 00 00 00 ff ff ff ff ff ff 02 08 22 50 c7 3d 02 08 22 50 c7 3d 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 07 48 46 47 2d 49 6f 54 01 08 82 84 8b 96 0c 12 18 24 03 01 03
nl80211: Beacon tail - hexdump(len=123): 07 06 48 55 20 01 0d 14 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 0c 00 2d 1a 0e 00 03 ff 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 03 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 04 00 00 00 02 dd 18 00 50 f2 02 01 01 00 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00
nl80211: ifindex=40
nl80211: beacon_int=100
nl80211: beacon_rate=0
nl80211: rate_type=0
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=7):
     48 46 47 2d 49 6f 54                              HFG-IoT         
  * beacon_int=100
  * dtim_period=2
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x1
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x10
nl80211: group_cipher=0x10
nl80211: SMPS mode - off
nl80211: beacon_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: proberesp_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: assocresp_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: Beacon set failed: -22 (Invalid argument)
Failed to set beacon parameters
nl80211: Set IF_OPER_UP again based on ifi_flags and expected operstate
netlink: Operstate: ifindex=40 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
RTM_NEWLINK: ifi_index=40 ifname=ap0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=40 ifname=ap0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(ap0)
VLAN: RTM_NEWLINK: ifi_index=40 ifname=ap0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
VLAN: vlan_newlink(ap0)
VLAN: RTM_NEWLINK: ifi_index=40 ifname=ap0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(ap0)

I get just this output :

[ 4440.135629] [WMT-LIB][E]wmt_lib_cmb_rst(1674):[whole chip reset] fail at wmt_lib_hw_rst!
[ 4440.874756] [WMT-DEV][E]wmt_dev_rx_timeout(1430):gRxCount != 0 (-1), reset it!
[ 4440.890322] [WMT-CTRL][E]wmt_ctrl_rx(262):wmt_dev_rx_timeout: timeout,jiffies(414081),timeoutvalue(20000)
[ 4440.908251] [WMT-CORE][E]wmt_core_rx(346):WMT-CORE: wmt_core_ctrl failed: WMT_CTRL_RX, iRet:-1
[ 4440.925221] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 348, (0)
[ 4440.925234] [WMT-CORE][E]opfunc_pwr_sv(1208):wmt_core: read SLEEP_EVT fail(-1) len(0, 6)
[ 4440.925246] [WMT-CTRL][E]wmt_ctrl_evt_parser(967):parser wmt evt from BTIF buf fail(0)
[ 4440.925254] [WMT-CORE][E]wmt_core_ctrl(499):WMT-CORE: wmt_core_ctrl failed: id(29), type(1), value(0) iRet:(-1)
[ 4440.925260] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[ 4440.925275] [STP-PSM] [E]_stp_psm_notify_stp(1006):ERROR! Action = SLEEP, ACT state, the case should not happens
                                                                                                                                                             
[ 4440.925281] [STP-PSM] [E]_stp_psm_notify_stp(1008):ERROR! state = 0, flag = 40
[ 4440.925367] [MTK-WIFI] register_set_p2p_mode_handler: (pid 796) register set p2p mode handler 00000000
[ 4441.425357] vcn18: mode operation not allowed
[ 4441.438161] vcn18: mode operation not allowed
[ 4441.452672] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(291):Read CONSYS chipId(0xfffff093)
[ 4441.545018] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[ 4441.577573] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[ 4441.593222] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[ 4442.159635] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup
[ 4442.175293] [MTK-WIFI] wifi_reset_end: WIFI state recovering...
[ 4442.197566] kalFirmwareImageMapping firmware size 225840
[ 4443.267750] [MTK-WIFI] register_set_p2p_mode_handler: (pid 796) register set p2p mode handler 67c012d1
[ 4443.286729] [MTK-WIFI] wifi_reset_end: WMT turn on WIFI success!
[ 4443.304139] [MTK-WIFI] wifi_reset_end: Set wlan mode 1

Maybe I should test it with another OS, but I’m afraid there is a harware issue!

I guess it’s no hw issue…more the buggy driver :slight_smile:

This looks strange…need to look where it is located…have you tried simple reboot? Where do you call the initialisation script? Which OS do you use? Stretch and earlier may have problems with kernels 5.4+ (i saw some warning about unsupported modes in stretch+5.4,but in my case they did not break).

Sometimes reset failes,but after clean boot (maybe try powercycle) it should came “up”.

Simple reboot was tried more times. I call my initialisation script with rc.local. OS is debian buster, kernel is 5.4.72.

5.4 kernel is in use since april, then was ordered an MT7612e card and helped me set it up. The problem is recognised maybe a month ago, only from yesterday I’m not able to use it.

mhm, so basicly same setup as my current non-migrated version (up since 19days 18h with kernel 5.4.66). so here output of my lsmod:

Module                  Size  Used by
aes_arm_bs             24576  1
crypto_simd            16384  1 aes_arm_bs
cryptd                 24576  1 crypto_simd
veth                   24576  0
xt_mark                16384  3
xt_addrtype            16384  4
xt_iprange             16384  12
xt_recent              20480  12
xt_nat                 16384  12
xt_tcpudp              16384  43
xt_limit               16384  1
xt_state               16384  0
xt_conntrack           16384  32
ipt_REJECT             16384  2
nf_reject_ipv4         16384  1 ipt_REJECT
xt_MASQUERADE          16384  4
iptable_mangle         16384  1
iptable_nat            16384  1
nf_nat                 45056  3 xt_nat,xt_MASQUERADE,iptable_nat
nf_conntrack          131072  5 xt_state,xt_nat,xt_MASQUERADE,xt_conntrack,nf_nat
tun                    49152  2
nf_defrag_ipv6         20480  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
nf_tables             139264  0
iptable_filter         16384  1
nfnetlink              16384  1 nf_tables
pppoe                  20480  4
pppox                  16384  1 pppoe
ppp_generic            36864  10 pppox,pppoe
slhc                   16384  1 ppp_generic
mt76x2e                24576  0
mt76x2_common          24576  1 mt76x2e
mt76x02_lib            69632  2 mt76x2_common,mt76x2e
mt76                   57344  3 mt76x02_lib,mt76x2_common,mt76x2e
lima                   45056  0
mt6577_auxadc          16384  0
spi_mt65xx             20480  0
gpu_sched              32768  1 lima
pwm_mediatek           16384  0
mtk_thermal            16384  0
mtk_pmic_keys          16384  0
nvmem_mtk_efuse        16384  0
ip_tables              24576  4 iptable_mangle,iptable_filter,iptable_nat
x_tables               32768  14 xt_state,ipt_REJECT,xt_nat,iptable_mangle,ip_tables,iptable_filter,xt_mark,xt_tcpudp,xt_MASQUERADE,xt_limit,xt_recent,xt_addrtype,xt_iprange,xt_conntrack

maybe it gives you a clue if and which module may break internal wifi

Which kernel do you use exactly? Maybe there is any breaking commit after 5.4.66 i’m using

Sorry for the late answer! Kernel is 5.4.72 ( added nft_queue ) . I see following difference, in my kernel modules this one has bigger size :

mt76x2_common 28672 1 mt76x2e

You are using iptables, therefore more modules related to it, on my side nftables works.

Should I try re-copy the driver?

Have you tried without nft_queue? Maybe this has same breaking effect as the known CONFIG_NET_SCH_FQ_CODEL / CONFIG_NET_SCH_FQ

I tried it now, without success! Same output, as before!

What does it mean:

[  459.053262] [STP-BTM] [E]_stp_btm_notify_wmt_dmp_wq(1132):ERROR! paged dump fail
[  459.069348] drivers/misc/mediatek/connectivity/common/conn_soc/core/btm_core.c, 824, (!RB_EMPTY(pOpQ))
[  459.087344] [STP-BTM] [W]_stp_btm_get_op: RB_GET fail
[  459.101574] [STP-BTM] [E]_stp_btm_handler(750):ERROR! polling CTRL STATE fail
[  459.101617] [STP-BTM] [W]_stp_btm_proc: opid id(0x7)(STP_OPID_BTM_PAGED_TRACE) error(-1)
[  459.101670] [MTK-WIFI] wifi_reset_start: Turn off p2p/ap mode
[  459.101709] [STP-PSM] [W]_stp_psm_put_op: RB_FULL, RB_COUNT=16 , RB_SIZE=16
[  459.101717] [STP-PSM] [W]_stp_psm_proc: +++++++++++ Put op to FreeOpQ fail, maybe disable/enable psm
[  461.111179] [WMT-LIB][E]wmt_lib_put_act_op(1056):wait completion timeout, opId(19), show wmtd_thread stack!
[  461.130137] Backtrace:

Other idea?

Without this option you have same state as my repo? Strange because the uploaded version works on my buster-image…have you installed wpa_supplicant or any other related package i have not (hostapd,dnsmasq,lxc with net,openvpn,iptables)?

I’ve copied all files from here to under /lib/firmwares :

No wpa-cupplicant, but hostapd, dnsmasq, lxc with net, nftables. It’s strange because it worked for a while.

Now I’m testing 5ghz on internal wifi, it’s stable. But with 2,4ghz comes trouble. It disturbs me a bit, because this was set only for some IoT devices. On the other hand, I’m not really satisfied with the range of mt7612 2,4ghz. What about BPI-MT7615? Better range?

have not done AP-test on mt7615 yet due to missing time

Could you try without nftables loaded?

Which one do you have?

Or this one :

I can’t, because my firewall is fully nftables! But I have another idea!

About 2 months ago I migrated boot and root partitions from sd to emmc and had problem with lxcfs and fuse fs. My system is running from sd, hadn’t enough time to handle this. I remember it run whitout issue. Tomorrow I will test it, the 2 months previously system is untouchable.

this one: 802.11ac 4x4 standard size mini pcie card is launched

but i thought you have problem with internal wifi and 2g4 mode

Frank! I wasn’t clear enough, sorry! I just wanted to say that I have a copie from my system!

Now I tested, and my suspicion comes true!

If you can remember, you generated for me 2 deb packages :

[frank-w] released this 24 days ago - defconfig: add NETFILTER_XT_TARGET_NFQUEUE

and one day later

[frank-w] released this 23 days ago - defconfig: r2: add CONFIG_NFT_QUEUE

I think the issue exists with NETFILTER_XT_TARGET_NFQUEUE module.

Why do I say it? Because after eliminated CONFIG_NFT_QUEUE module, problem still existed.

Have you tried without NETFILTER_XT_TARGET_NFQUEUE?

Yes, I’ve compiled a kernel whitout NETFILTER_XT_TARGET_NFQUEUE!

root@bpi-r2:/home/kernel$ cat running.config | grep -i queue
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_NETFILTER_NETLINK_QUEUE=m
CONFIG_NFT_QUEUE=m
# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
# Queueing/Scheduling
root@bpi-r2:/home/kernel$ uname -a
Linux bpi-r2 5.4.80-bpi-r2-main #2 SMP Thu Nov 26 14:30:11 CET 2020 armv7l GNU/Linux

I’m able to run internal wifi finally.

Two question : I"ve followod your instructions in order to recompile kernel on github. Deb package is ready and installed. Why don’t see corresponding config file under /boot? Anyway, I could check it.

How did you get mentioned MTK7615 pcie card? On the page you linked is to expensive! Rather I should order it from aliexpress and all the same from which vendor(Unielec, Sinovoip)?

1 Like

the new deb-package is created from modified linux-script and does not contain the uEnv.txt modifications, you have to do it your own. but it contains the source-Package if you want to compile additional modules on BPI-R2 itself

root@bpi-r2:/home/kernel$ cat running.config | grep -i queue

you know ikconfig?

modprobe configs
zcat /proc/config.gz | grep '...'

you do not need to copy the .config to target-system :slight_smile: but good to hear, your problem is solved…i guess i should drop this module, right?

Absolutely, please drop this module!

I did it so, modprobe configs, didn’t know, just googled! :slight_smile:

What about the card? On the page you’ve linked is to expensive! Or should I order it from aliexpress and all the same from which vendor(Unielec, Sinovoip)?

all mt7615 i see except the one from asiarf were too large for bpi-r2…only this card hast standard fullsize

1 Like

I see, no question! :slight_smile: