2.4Ghz and 5.6Ghz Wifi Working fine

Both low and high band Wifi are working correctly on both releases :-

2017-08-01-ubuntu-16.04-mate-desktop-docker-preview2-bpi-r2-sd-emmc.img
2017-09-04-ubuntu-16.04-mate-desktop-bpi-r2-sd-emmc-v1.2.0.img

user do some test for 2.4G & 5.8G,for reference only

5.8G test:

8G wireless test

2.4G test:

4G wireless test

1 Like

Do you have tried on AP Mode?

The AP mode isn’t working yet, I will debug it when I finish higher priority tasks,

1 Like

Can you explain how you created the image? then we can do same steps e.g. for debian (jessie/stretch)

I’ve compiled kernel from github…but how to work further without using an existing image and replacing there.

Hi frank

We don’t have an instruction to describe how to create a debian image withtout using an available image yet

ok, thanks for now, jessie is running, i try kernel upgrade :wink: waiting for AP-Mode :slight_smile:

We are very interested in AP mode for the MT7615 ad- in cards. Gemtek/AsiaRF etc. When will AP mode support get resources? Also would love to get support for the Qualcomm wifi cards like the Compex 4x4 cards

hello, do you have a news?

Hi Ben

The AP mode is not working fine, so far we don’t have a plan to fix this,

Thanks Gary

What is the value of this board without AP mode? Why is the BananaPi team not providing further support for AP mode it is detrimental to the platform.

Do I understand right? We will have no possibility to use R2 as wireless access point? If yes this board is useless …

Not sure but the HostAP mailing list might be of some help :-

https://lists.infradead.org/mailman/listinfo/hostap

the problem is there is no full driver support, it’s not fault of hostapd…hostapd only USES that driver

1 Like

Hi All

I’m debug AP mode, After reviewing the code, I find a way to enable it, but it doesn’t work for me:

Steps to enable AP mode(not vaildated yet):

  1. echo A > /dev/wmtWifi

  2. killall wpa_supplicant

  3. hostapd -B -dd /etc/hostapd/hostapd.conf

Hi Gary,

After you echo A to /dev/wmtWifi, it should have a device node called /dev/apX. In your hostapd.conf, you must change the interface name to apX, not wlanX.

Thanks a lot.

On my board, the interface is configured to ap0. Does the AP mode work on your board?

What does “does not work” mean? Any error-messages, which Problems?

Don’t see any error log on console, but can’t find out the SSID.

Gary, I tried with following nmcli commands and I see tons of errors in syslog (I also got a kernel crash):

create the connection

  • nmcli connection add type wifi ifname ap0 con-name wlanAP autoconnect no ssid BananaR2
  • nmcli connection modify wlanAP 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
  • nmcli connection modify wlanAP wifi-sec.key-mgmt wpa-psk
  • nmcli connection modify wlanAP wifi-sec.psk “12345678”

enable the connection

  • nmcli connection up wlanAP

For me it works briefly. The SSID is visible at first, but when I try to connect there is a kernel panic (see below). From that point, the system is broken.

I’m running on ArchlinuxARM with a kernel from BPI-R2 github page and default configuration. hostapd with default config as well.

[ 1015.666910] [MTK-WIFI] WIFI_open: WIFI_open: major 153 minor 0 (pid 8160)
[ 1015.684243] [MTK-WIFI] WIFI_write: WIFI_write A

[ 1015.731654] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt wlan func on before wlan probe
[ 1016.804540] [MTK-WIFI] register_set_p2p_mode_handler: (pid 8184) register set p2p mode handler c071f534
[ 1016.824227] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt call wlan probe ok
[ 1016.841654] [WMT-CORE][W]wmt_core_dump_func_state:[AF FUNC ON]status(b:0 f:0 g:0 w:2 lpbk:2 coredump:0 wmt:2 stp:0)
[ 1016.864324] [WMT-EXP][W]mtk_wcn_wmt_func_ctrl:OPID(3) type(3) ok
[ 1016.881505] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
[ 1016.898993] [MTK-WIFI] WIFI_write: Set wlan mode 0 --> 1
[ 1016.914772] [MTK-WIFI] WIFI_close: WIFI_close: major 153 minor 0 (pid 8160)
[ 1281.064828] ------------[ cut here ]------------
[ 1281.079627] WARNING: CPU: 1 PID: 8197 at net/wireless/nl80211.c:3618 nl80211_put_sta_rate+0xf8/0x1f8()
[ 1281.099112] Modules linked in: input_leds led_class ahci libahci libata mtk_thermal mtk_cir ip_tables x_tables
[ 1281.119464] CPU: 1 PID: 8197 Comm: tx_thread Not tainted 4.4.70-BPI-R2-Kernel #2
[ 1281.136976] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 1281.152708] [<c001a180>] (unwind_backtrace) from [<c0014c1c>] (show_stack+0x20/0x24)
[ 1281.170691] [<c0014c1c>] (show_stack) from [<c0564048>] (dump_stack+0x94/0xa8)
[ 1281.188082] [<c0564048>] (dump_stack) from [<c0034944>] (warn_slowpath_common+0x94/0xc4)
[ 1281.206255] [<c0034944>] (warn_slowpath_common) from [<c0034a30>] (warn_slowpath_null+0x2c/0x34)
[ 1281.225180] [<c0034a30>] (warn_slowpath_null) from [<c0aa2adc>] (nl80211_put_sta_rate+0xf8/0x1f8)
[ 1281.244195] [<c0aa2adc>] (nl80211_put_sta_rate) from [<c0a7a08c>] (nl80211_send_station+0x4f8/0xb1c)
[ 1281.263549] [<c0a7a08c>] (nl80211_send_station) from [<c0a7a740>] (cfg80211_new_sta+0x90/0x18c)
[ 1281.282483] [<c0a7a740>] (cfg80211_new_sta) from [<c0735124>] (kalP2PGOStationUpdate+0x94/0x9c)
[ 1281.301426] [<c0735124>] (kalP2PGOStationUpdate) from [<c074fc5c>] (p2pRunEventAAASuccess+0x24/0x2c)
[ 1281.320844] [<c074fc5c>] (p2pRunEventAAASuccess) from [<c0739f44>] (aaaFsmRunEventTxDone+0x194/0x19c)
[ 1281.340460] [<c0739f44>] (aaaFsmRunEventTxDone) from [<c07187e8>] (nicRxProcessEventPacket+0x7f4/0x9b4)
[ 1281.360288] [<c07187e8>] (nicRxProcessEventPacket) from [<c0718b10>] (nicRxProcessRFBs+0xbc/0x188)
[ 1281.379755] [<c0718b10>] (nicRxProcessRFBs) from [<c0718ea8>] (nicProcessRxInterrupt+0x3c/0x40)
[ 1281.399042] [<c0718ea8>] (nicProcessRxInterrupt) from [<c07122bc>] (nicProcessIST_impl+0x5c/0xb4)
[ 1281.418511] [<c07122bc>] (nicProcessIST_impl) from [<c071236c>] (nicProcessIST+0x58/0xa4)
[ 1281.437278] [<c071236c>] (nicProcessIST) from [<c07045a8>] (wlanIST+0x50/0x9c)
[ 1281.455021] [<c07045a8>] (wlanIST) from [<c0722c2c>] (tx_thread+0x3bc/0x440)
[ 1281.472548] [<c0722c2c>] (tx_thread) from [<c0054350>] (kthread+0x118/0x120)
[ 1281.490061] [<c0054350>] (kthread) from [<c0010038>] (ret_from_fork+0x14/0x3c)
[ 1281.507806] ---[ end trace 2a0a5799a7240bb4 ]---

Edit: I’ve added a printk just before the switch case near line 3618 in net/wireless/nl80211.c, printing info->bw. In a single run, the printk got hit twice:

[  108.431013] nl80211_put_sta_rate(3610): info->bw=218
PANIC TRACE
[  109.266831] nl80211_put_sta_rate(3610): info->bw=223
PANIC TRACE

Both values do not match a value from enum rate_info_bw, hitting the default clause, triggering the trace output. I will try to find where this value is determined.

Then, subsequently, a different trace is printed:

[  108.780753] ------------[ cut here ]------------
[  108.795727] WARNING: CPU: 3 PID: 418 at net/wireless/util.c:1124 cfg80211_calculate_bitrate+0x208/0x238()
[  108.815771] Modules linked in: ahci libahci libata mtk_cir mtk_thermal ip_tables x_tables
[  108.834560] CPU: 3 PID: 418 Comm: tx_thread Tainted: G        W       4.4.70-BPI-R2-Kernel #3
[  108.853563] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  108.869589] [<c001a180>] (unwind_backtrace) from [<c0014c1c>] (show_stack+0x20/0x24)
[  108.887806] [<c0014c1c>] (show_stack) from [<c0564048>] (dump_stack+0x94/0xa8)
[  108.905474] [<c0564048>] (dump_stack) from [<c0034944>] (warn_slowpath_common+0x94/0xc4)
[  108.923982] [<c0034944>] (warn_slowpath_common) from [<c0034a30>] (warn_slowpath_null+0x2c/0x34)
[  108.943183] [<c0034a30>] (warn_slowpath_null) from [<c0a5ef08>] (cfg80211_calculate_bitrate+0x208/0x238)
[  108.963169] [<c0a5ef08>] (cfg80211_calculate_bitrate) from [<c0aa2a3c>] (nl80211_put_sta_rate+0x58/0x214)
[  108.983277] [<c0aa2a3c>] (nl80211_put_sta_rate) from [<c0a7a08c>] (nl80211_send_station+0x4f8/0xb1c)
[  109.002970] [<c0a7a08c>] (nl80211_send_station) from [<c0a7a740>] (cfg80211_new_sta+0x90/0x18c)
[  109.022195] [<c0a7a740>] (cfg80211_new_sta) from [<c0735124>] (kalP2PGOStationUpdate+0x94/0x9c)
[  109.041497] [<c0735124>] (kalP2PGOStationUpdate) from [<c074fc5c>] (p2pRunEventAAASuccess+0x24/0x2c)
[  109.061335] [<c074fc5c>] (p2pRunEventAAASuccess) from [<c0739f44>] (aaaFsmRunEventTxDone+0x194/0x19c)
[  109.081261] [<c0739f44>] (aaaFsmRunEventTxDone) from [<c07187e8>] (nicRxProcessEventPacket+0x7f4/0x9b4)
[  109.101407] [<c07187e8>] (nicRxProcessEventPacket) from [<c0718b10>] (nicRxProcessRFBs+0xbc/0x188)
[  109.121197] [<c0718b10>] (nicRxProcessRFBs) from [<c0718ea8>] (nicProcessRxInterrupt+0x3c/0x40)
[  109.140739] [<c0718ea8>] (nicProcessRxInterrupt) from [<c07122bc>] (nicProcessIST_impl+0x5c/0xb4)
[  109.160488] [<c07122bc>] (nicProcessIST_impl) from [<c071236c>] (nicProcessIST+0x58/0xa4)
[  109.179554] [<c071236c>] (nicProcessIST) from [<c07045a8>] (wlanIST+0x50/0x9c)
[  109.197603] [<c07045a8>] (wlanIST) from [<c0722c2c>] (tx_thread+0x3bc/0x440)
[  109.215443] [<c0722c2c>] (tx_thread) from [<c0054350>] (kthread+0x118/0x120)
[  109.233280] [<c0054350>] (kthread) from [<c0010038>] (ret_from_fork+0x14/0x3c)
[  109.251348] ---[ end trace ef406c8ee8e40661 ]---

Edit 2: Good news! It seems the kernel was crashing on uninitialized memory. After I added the line below in drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/gl_p2p_kal.c on line 1078, hostapd accepted the key handshake and no more kernel trace outputs :smiley:

memset(&rStationInfo, 0, sizeof(struct station_info));

@garywang: Could you please test and add this line to the repo?

Result:

Oct 18 22:14:46 alarm hostapd[438]: Using interface ap0 with hwaddr 02:08:22:10:f8:fc and ssid "BPI-R2"
Oct 18 22:14:46 alarm hostapd[438]: ap0: interface state UNINITIALIZED->ENABLED
Oct 18 22:14:46 alarm hostapd[438]: ap0: AP-ENABLED
Oct 18 22:15:35 alarm hostapd[438]: ap0: STA 38:ca:da:a0:f8:aa IEEE 802.11: associated
Oct 18 22:15:35 alarm hostapd[438]: ap0: STA 38:ca:da:a0:f8:aa IEEE 802.11: associated
Oct 18 22:15:35 alarm hostapd[438]: ap0: AP-STA-CONNECTED 38:ca:da:a0:f8:aa
Oct 18 22:15:35 alarm hostapd[438]: ap0: STA 38:ca:da:a0:f8:aa RADIUS: starting accounting session ECFA0EF00D8C6ED2
Oct 18 22:15:35 alarm hostapd[438]: ap0: STA 38:ca:da:a0:f8:aa WPA: pairwise key handshake completed (RSN)
Oct 18 22:15:35 alarm hostapd[438]: ap0: STA 38:ca:da:a0:f8:aa RADIUS: starting accounting session ECFA0EF00D8C6ED2
Oct 18 22:15:35 alarm hostapd[438]: ap0: STA 38:ca:da:a0:f8:aa WPA: pairwise key handshake completed (RSN)

My device now indicates it is connected, although i didn’t setup any IP configuration yet. :slight_smile:

Edit 3: I just configured DHCP and NAT on the R2, seems to work perfectly in my limited test.

2 Likes