[BPI-R2] internal Wifi/BT (MT6625L) - Kernel

I’ll try.

Interesting. Does iwconfig wlan0 show you’re associated to r2_AP0 after that?

I don’t think so…have not checked (already off),but it have not asked for pwd…so i guess it does not work. But also not the warning and not my debug-info

i guess it’s rejected before it…need to setup ap with my r64 first :wink:

Only running iwconfig wlan0 essid r2_AP0 won’t ask for a password; it will simply associate to the base station. Then it’s up to wpa-supplicant to take care of authentication. Next time you turn it on, give it a try; could be that wlan0 associated!

In any case, I wonder why you’re getting different results.

This call to cfg80211_get_bss() is returning NULL:

Which means cfg80211_get_bss() is failing to find a matching base station:

I wonder if you’re seeing success because your AP uses 802.11 privacy whereas mine does not? That could explain different results.

not connected…had put wlan0 up before

9: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN grou0
    link/ether 00:08:22:34:84:fc brd ff:ff:ff:ff:ff:ff

root@bpi-r2:~# iwconfig wlan0 essid r2_AP0                                      
root@bpi-r2:~# iwconfig wlan0                                                   
wlan0     Disconnected  ESSID:""                                                
          Mode:Managed  Access Point: Not-Associated   Tx-Power=off             
          RTS thr=0 B   Fragment thr:off                                        
          Encryption key:off                                                    
          Power Management:off                                                  
          Link Quality:0  Signal level:0  Noise level:0                         
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0              
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0 

but strange anyway that i did not get the error you got…ok, with unencrypted ap, i got the warning…

root@bpi-r2:~# iwconfig wlan0 essid r64_APi
root@bpi-r2:~# iwlist wlan0 scan[  397.946902] DEBUG: Passed __cfg80211_connect0
[  397.953460] ------------[ cut here ]------------
[  397.958078] WARNING: CPU: 1 PID: 595 at net/wireless/sme.c:734 __cfg80211_coc

maybe encrypted waits in background for wpa-supplicant?

my debug says that bss given on that function is also 0x0

DEBUG: Passed __cfg80211_connect_result 667 bss:0x00000000

OK, so maybe this only affects open APs. I could totally be wrong about iwconfig wlan0 essid encrypted_ap; iwconfig wlan0 showing an associated base station. I don’t have a way to test right now, though.

Anyway, I tried to track down exactly where things were going wrong yesterday, but didn’t get a final answer. Here is the dmesg after running iwconfig wlan0 essid 'Los Abuelitos' with debugging enabled (and my own debug statements, including diffs):

Starting at line 139 in the dmesg log, you can see where cfg80211_get_bss() (in net/wireless/scan.c) is checking for base stations matching the requested ESSID. In the first two calls, the ssid string contained the ESSID (plus junk), but apparently there were no base stations listed in the rdev->bss_list. In the third call, the ssid string contained only junk in the ssid string, and while there was a base station in the rdev->bss_list, obviously it couldn’t be matched.

That’s all the tracing I can do on my own, since I don’t know which call to cfg80211_get_bss() should have succeeded, or how the interfaces all work. Let me know if you have any good ideas about where to go from here. I’ll install a miniPCIe card if we can’t figure this out, not a problem.

Nice debugging…if i look at these lines (i guess you mean them too)

kalIndicateStatusAndComplete:(AIS INFO) wlan0 netif_carrier_on [ssid:Los Abuelitos 24:a2:e1:f1:79:06 ]
[75718.054554] cfg80211_get_bss:  ssid = Los Abuelitosם\xffffffdb\xffffffdc"\xffffffc0\xffffffe4 \xffffffc0\xffffffb8\xffffffa7\\xffffffdfT\xffffff8c\xffffffc0\xffffffb8\xffffffa7\߀\\xffffffc1\xffffffdd4\xffffffd8\xffffff9d۸ם\xffffffdbT\xffffff8c\xffffffc0\xffffffa08\xffffffc0

I think buffer is not initialzed with 0x0 before copy the name of bss in

But i guess we need someone with more knowledge about wifi drivers than me.

Hi!

I purchased Banana R2 for my home router, as well as for learning Linux. I found the wiki of the respected @frank-w and tried to configure everything using it. I used an image of ubuntu-18.04-bpi-r2-preview with kernel 4.19.138. I also wanted to have access to Banana via Webmin.

I have now configured internal AP, but I ran into a problem - after some time of operation, the access point becomes unavailable.

hostapd.log

WPA: e0:dc:ff:c9:6c:2b WPA_PTK entering state INITIALIZE wpa_driver_nl80211_set_key: ifindex=11 (ap0) alg=0 addr=0x570170 key_idx=0 set_tx=1 seq_len=0 key_len=0 addr=e0:dc:ff:c9:6c:2b nl80211: Set STA flags - ifname=ap0 addr=e0:dc:ff:c9:6c:2b total_flags=0x0 flags_or=0x0 flags_and=0xfffffffe authorized=0 ap0: STA e0:dc:ff:c9:6c:2b IEEE 802.1X: unauthorizing port Could not set station e0:dc:ff:c9:6c:2b flags for kernel driver (errno=11). ap0: Deauthentication callback for STA e0:dc:ff:c9:6c:2b ap0: Removing STA e0:dc:ff:c9:6c:2b from kernel driver nl80211: sta_remove -> DEL_STATION ap0 e0:dc:ff:c9:6c:2b --> 0 (Success) ap0: STA e0:dc:ff:c9:6c:2b MLME: MLME-DEAUTHENTICATE.indication(e0:dc:ff:c9:6c:2b, 2) ap0: STA e0:dc:ff:c9:6c:2b MLME: MLME-DELETEKEYS.request(e0:dc:ff:c9:6c:2b) wpa_driver_nl80211_set_key: ifindex=11 (ap0) alg=0 addr=0x570170 key_idx=0 set_tx=1 seq_len=0 key_len=0 addr=e0:dc:ff:c9:6c:2b nl80211: Event message available nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for ap0 nl80211: Delete station e0:dc:ff:c9:6c:2b ap0: Event DISASSOC (1) received ap0: STA e0:dc:ff:c9:6c:2b IEEE 802.11: disassociated ap0: STA e0:dc:ff:c9:6c:2b WPA: event 2 notification wpa_driver_nl80211_set_key: ifindex=11 (ap0) alg=0 addr=0x570170 key_idx=0 set_tx=1 seq_len=0 key_len=0 addr=e0:dc:ff:c9:6c:2b WPA: e0:dc:ff:c9:6c:2b WPA_PTK entering state DISCONNECTED

I tried running with a different core (4.14), in 5GHz mode, and as an open AP. The problem still remains… Please help me solve this problem

( I’m sorry my bad english)

Log_Settings&Info_files.tar.xz (34.6 КБ)

How much time is it (approx)? Which channel (2.4ghz)? Have you overlapping channels in neighborhood? Can you reconnect or is ap dead?

I have only this very buggy driver and not much knowledge to make it better :frowning:

I see you have prepared bridge with ap0,but disabled…do not bridge ap0 as it does not work

0 to 10 minutes after connecting to AP. 2.4 and 5GHz are the same.

as I understand it depends on the load on AP.

Yes, 2.4 GHz all channels overlap more or less. At 5 GHz, most channels are free.

I try to reconnect to the AP, the AP is available, visible, but the client connection resets and it is on a loop

then I just have to try to install and configure everything again, because other people have internal WIFI AP :ok_man:

I can make and send you an SD card image with my system :sweat_smile:

I wanted wired LAN clients and WiFi clients to be on the same subnet

Hi, Frorip,

Please check if sch_fq module is loaded, i previously had the problem with this module and internal wifi.

You can search around my post from jan 9th for additional info: [BPI-R2] internal Wifi/BT (MT6625L) - Kernel

+/- a couple of days.

Maybe i should block sch_fq if combo is enabled via kconfig? How was it added in your case (automaticly by any other option or manually)?

Hi! thank you for your help!

I rebuilt the kernel with configuration CONFIG_NET_SCH_FQ=m - the trouble remained…

Is module unloaded? Could you completely remove this option?

try lsmog | grep sch_fq, if it’s loaded - you’ll likeli won’t be able to unload it, so you can try to rename/delete it or to set CONFIG_NET_SCH_FQ=n.

Also You may check other network scheduler modules.

Please show your lsmod and tc qdisc show dev ap0

P.S. mine is :

bpi-r2-gentoo ~ # tc qdisc show dev ap0
qdisc mq 0: root
qdisc pfifo_fast 0: parent :4 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :3 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

and it works fine.

If it’s the reason then likely yes, at-least unless the issue is be fixed.

By build.sh importconfig, i suppose. I don’t remember exactly, i use my own config since 5.4(w/o this scheduler).

i don’t think so as it is not enabled in my tree after running importconfig…

Yes, I copied and added the sch_fq module for autoloading. And it not work…

Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.19.138-bpi-r2 armv7l)
 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Last login: Wed Sep  9 00:24:54 2020 from 192.168.0.13
root@bpi-r2-ubuntu:~# lsmod
Module                  Size  Used by
ipt_MASQUERADE         16384  5
iptable_nat            16384  1
nf_nat_ipv4            16384  2 ipt_MASQUERADE,iptable_nat
nf_nat                 36864  1 nf_nat_ipv4
nf_conntrack          147456  3 ipt_MASQUERADE,nf_nat_ipv4,nf_nat
nf_defrag_ipv6         20480  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
mtk_thermal            16384  0
thermal_sys            61440  1 mtk_thermal
spi_mt65xx             20480  0
pwm_mediatek           16384  0
mt6577_auxadc          16384  0
mtk_pmic_keys          16384  0
nvmem_mtk_efuse        16384  0
sch_fq_codel           24576  7
sch_fq                 20480  0
ip_tables              24576  1 iptable_nat
x_tables               32768  2 ip_tables,ipt_MASQUERADE
root@bpi-r2-ubuntu:~# tc qdisc show dev ap0
qdisc mq 0: root 
qdisc fq_codel 0: parent :4 limit 3068542532p flows 3068542532 quantum 3068542532 target 5.0ms interval 100.0ms memory_limit 32Mb ecn 
qdisc fq_codel 0: parent :3 limit 3068542532p flows 3068542532 quantum 3068542532 target 5.0ms interval 100.0ms memory_limit 32Mb ecn 
qdisc fq_codel 0: parent :2 limit 3068542532p flows 3068542532 quantum 3068542532 target 5.0ms interval 100.0ms memory_limit 32Mb ecn 
qdisc fq_codel 0: parent :1 limit 3068542532p flows 3068542532 quantum 3068542532 target 5.0ms interval 100.0ms memory_limit 32Mb ecn 
root@bpi-r2-ubuntu:~#

You should disable it…it is known to break ap

Oh, I’m sorry, I misunderstood you. Initially, the module sch_fq was disabled, missing from the root, and not loaded into the kernel. Only be sch_fq_codel

You have issues without sch_fq and sch_fq_codel ?

Could you please try only with my defconfig (no additional options)? There i have no problems in 5.4. How much clients are connected and which signal strength? Do you have issues only with much traffic or also in idle?