Jump to content

Recommended Posts

Posted

Hi all !

 

Sinovoip just send me a free sample of a new board, BPi M2 plus.

- H3 SoC

- eMMC (7.3 Go)

-Inboard Wifi+BT ( chipset AP6212 )

 

Very good, thanks to them !

 

So I have installed Armbian (here), but the wifi doesn't work yet.

I have found the driver source, (http://www.mediafire.com/download/68vvpim3k3po0ur/support_ap6212.rar) but I think I must recompile all Armbian to try if this driver works.

Some questions:

 

1) Can I compile Armbian with a Ubuntu 16.04 x64 desktop, or 14.04 is better ?

2) If so, does a source is available somewhere (and maybe a tutorial? XD ) ?  I have look the Igor's repo, but I think sun8i is not available at this day.

 

Thanks for all lights :)

Posted

Just do a 

modprobe bcmdhd

and uncomment the entry in /etc/modules -- Igor fixed WiFi for M2+ 3 weeks ago but enabled automatic driver loading (uncommenting this single line in /etc/modules) just yesterday.

 

BTW: since you wrote 'very good' above. These two words do really not apply to this board. It's the slowest H3 board around due to dumb voltage regulator decisions and it seems SinoVoip isn't that lucky doing hardware. I'm currently testing DRAM reliability and this board already fails at 624 MHz! So it looks we've to decrease DRAM clockspeed for this board below 600 MHz to leave some safety headroom.

Posted

Ok, thanks for your answer.

 

So I have made a clean install.

After update/upgrade, modprobe bcmdhd works well.

 

But no wifi detected by Wicd Network Manager.

 

So I tried: 

$ iwconfig                
lo        no wireless extensions.

tunl0     no wireless extensions.

wlan0     IEEE 802.11  Access Point: Not-Associated    
         Link Quality:0  Signal level:0  Noise level:0
         Rx invalid nwid:0  invalid crypt:0  invalid misc:0

eth0      no wireless extensions.

p2p0      IEEE 802.11bg  ESSID:off/any   
         Mode:Managed  Access Point: Not-Associated    
         Retry  long limit:7   RTS thr:off   Fragment thr:off
         Power Management:on
$ lsmod 
Module                  Size  Used by
mali_drm                2732  1  
drm                   178255  2 mali_drm
mali                  123208  0  
ump                    29379  3 mali
bcmdhd                648477  0
$ iwlist wlan0 scan 
wlan0     Interface doesn't support scanning.

I suppose p2p0 is BT, I'm not sure.

Posted

I suppose p2p0 is BT, I'm not sure.

 

Nope, BT isn't working yet with BPi M2+ ('Team BPi' obviously has no clues how to support their own hardware correctly -- Armbian relies here on their drivers). The aforementioned device is for Wi-Fi Direct.

 

Can't help with bcmdhd since in my opinion all these cheap onboard 2.4 GHz WiFi solutions aren't worth the efforts. Maybe you have to load the module differently or using more parameters?

Posted

Ok, I post some lines, maybe Igor could solve this

$ sudo ifconfig wlan0 up 
SIOCSIFFLAGS: Operation not permitted
$ dmesg | tail  
[  188.147991] dhd_open: Exit ret=-1
[  188.150497] dhd_open: Enter ee710800

[  188.150580] Dongle Host Driver, version 1.201.34.2 (r491657)
[  188.150602] Compiled in drivers/net/wireless/bcmdhd on May 31 2016 at 18:59:58
[  188.150650] wl_android_wifi_on in 1
[  188.150700] wl_android_wifi_on in 2: g_wifi_on=0
[  188.150743] wifi_platform_set_power = 1
[  188.150776] ======== PULL WL_REG_ON HIGH! ========
[  188.150813] [wifi_pm]: set wl_reg_on 1 !

Maybe a firmware issue...

 

More diagnostics:

$ rfkill list all 
0: sunxi-bt: Bluetooth
       Soft blocked: no
       Hard blocked: no
1: phy0: Wireless LAN
       Soft blocked: no
       Hard blocked: no
2: brcmfmac-wifi: Wireless LAN
       Soft blocked: no
       Hard blocked: no
$ sudo lshw -C network      
 *-network:0 DISABLED     
      description: Wireless interface
      physical id: 7
      logical name: wlan0
      serial: 00:90:4c:11:22:33
      capabilities: ethernet physical wireless
      configuration: broadcast=yes driver=wl driverversion=0 multicast=yes wireless=IEEE 802.11
 *-network:1
      description: Ethernet interface
      physical id: 8
      logical name: eth0
      serial: 1a:63:b4:9c:f2:c5
      size: 100Mbit/s
      capacity: 1Gbit/s
      capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonego
tiation
      configuration: autonegotiation=on broadcast=yes driver=sunxi_geth driverversion=SUNXI Gbgit
driver V1.1 duplex=full ip=192.168.2.5 link=yes multicast=yes port=MII speed=100Mbit/s
 *-network:2 DISABLED
      description: Wireless interface
      physical id: 9
      logical name: p2p0
      serial: 00:90:4c:33:22:11
      capabilities: ethernet physical wireless
      configuration: broadcast=yes driver=p2p driverversion=0 multicast=yes wireless=IEEE 802.11bg
Posted

Thanks lvmc, here some results

$ iw list 
Wiphy phy0
       Band 1:
               Frequencies:
                       * 2412 MHz [1] (20.0 dBm)
                       * 2417 MHz [2] (20.0 dBm)
                       * 2422 MHz [3] (20.0 dBm)
                       * 2427 MHz [4] (20.0 dBm)
                       * 2432 MHz [5] (20.0 dBm)
                       * 2437 MHz [6] (20.0 dBm)
                       * 2442 MHz [7] (20.0 dBm)
                       * 2447 MHz [8] (20.0 dBm)
                       * 2452 MHz [9] (20.0 dBm)
                       * 2457 MHz [10] (20.0 dBm)
                       * 2462 MHz [11] (20.0 dBm)
                       * 2467 MHz [12] (20.0 dBm)
                       * 2472 MHz [13] (20.0 dBm)
                       * 2484 MHz [14] (20.0 dBm)
               Bitrates (non-HT):
                       * 1.0 Mbps
                       * 2.0 Mbps (short preamble supported)
                       * 5.5 Mbps (short preamble supported)
                       * 11.0 Mbps (short preamble supported)
                       * 6.0 Mbps
                       * 9.0 Mbps
                       * 12.0 Mbps
                       * 18.0 Mbps
                       * 24.0 Mbps
                       * 36.0 Mbps
                       * 48.0 Mbps
                       * 54.0 Mbps
       max # scan SSIDs: 10
       max scan IEs length: 2048 bytes
       Retry short limit: 7
       Retry long limit: 4
       Coverage class: 0 (up to 0m)
       Supported Ciphers:
               * WEP40 (00-0f-ac:1)
               * WEP104 (00-0f-ac:5)
               * TKIP (00-0f-ac:2)
               * CCMP (00-0f-ac:4)
               * CMAC (00-0f-ac:6)
       Available Antennas: TX 0 RX 0
       Supported interface modes:
                * IBSS
                * managed
                * AP
                * P2P-client
                * P2P-GO
       software interface modes (can always be added):
       valid interface combinations:
                * #{ AP } <= 1, #{ managed } <= 3, #{ P2P-client, P2P-GO } <= 2, #{ IBSS } <= 1,
                  total <= 4, #channels <= 2
       Supported commands:
                * new_interface
                * set_interface
                * new_key
                * start_ap
                * set_bss
                * join_ibss
                * set_pmksa
                * del_pmksa
                * flush_pmksa
                * remain_on_channel
                * frame
                * frame_wait_cancel
                * set_wiphy_netns
                * set_channel
                * tdls_oper
                * connect
                * disconnect
       Supported TX frame types:
                * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0
0xf0
                * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0
xe0 0xf0
                * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0
xf0
                * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0
xe0 0xf0
                * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd
0 0xe0 0xf0
                * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0x
e0 0xf0
       Supported RX frame types:
                * IBSS: 0xd0
                * managed: 0x40 0xd0
                * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                * P2P-client: 0x40 0xd0
                * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
       Device supports T-DLS.

and

$ iw wlan0 info 
Interface wlan0
       ifindex 5
       type managed
       wiphy 0
Posted

Ok guys, I've found a solution.

 

It was the firmware and the files in the /lib/firmware/ap6212

 

Here is a procedure:

1) Download the firmware

git clone https://github.com/BPI-SINOVOIP/BPI_WiFi_Firmware

or

git clone https://github.com/jrspruitt/FriendlyARM_NanoPi_Buildroot_Ext.git

2) Rename nvram_ap6212.txt to nvram.txt:

mv ~/BPI_>WiFi_Firmware/ap6212/nvram_ap6212.txt ~/BPI_>WiFi_Firmware/ap6212/nvram.txt 

3) Copy the ap6212 folder into /lib/firmware folder

sudo cp -r ~/BPI_>WiFi_Firmware/ap6212 /lib/firmware

Then,

sudo ifconfig wlan0 up

should work :)

Posted

On download section images (v5.13) wireless should work out of the box.

Posted (edited)

yes, just copy /lib/firmware/ap6212/bcm43438a0.hcd to /etc/firmware/ap6212/4343A0.hcd and then type:

echo "0" > /sys/class/rfkill/rfkill0/state
echo "1" > /sys/class/rfkill/rfkill0/state
echo " " > /dev/ttyS1
hciattach /dev/ttyS1 bcm43xx 1500000
hciconfig hci0 up

That should give you hci interface and can be checked with:

hciconfig -a

EDIT: Added one command I forgot.

EDIT2: Higher baud rate

Edited by jernej
Posted

 

yes, just copy /lib/firmware/ap6212/bcm43438a0.hcd to /etc/firmware/ap6212/4343A0.hcd and then type:

echo "0" > /sys/class/rfkill/rfkill0/state
echo "1" > /sys/class/rfkill/rfkill0/state
echo " " > /dev/ttyS1
hciattach /dev/ttyS1 bcm43xx 115200

That should give you hci interface and can be checked with:

hciconfig -a

 

Nothing shows in devices.... anything else I'm missing?
 
pi@bananapim2plus:~$ hcitool dev
Devices:
Posted

what is the output of those commands?

 

I got the answer .... need to do  "hciconfig hci0 up" then "hciconfig -a" will show 

 

hci0:   Type: BR/EDR  Bus: UART

        BD Address: 43:43:A0:12:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:7391 acl:0 sco:0 events:83 errors:0
        TX bytes:596 acl:0 sco:0 commands:37 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'BCM4343A0 26MHz AP6212_CL1-0061'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.1 (0x7)  Revision: 0xf2
        LMP Version: 4.1 (0x7)  Subversion: 0x2122
        Manufacturer: Broadcom Corporation (15)
 
However I don't know how to do pairing for next step
I'm doing "hcitool scan" then can see
 
Scanning ...
        00:07:61:EE:CE:50       Dell BT Travel Mouse
 
Then I'm doing following
 
sudo bluetoothctl
agent on
default-agent
pair 00:07:61:EE:CE:50
 
then get
Device 00:07:61:EE:CE:50 not available
 
I thought BT controller already found "00:07:61:EE:CE:50       Dell BT Travel Mouse"
but why not available?
Posted

I edited my commands if anyone will look at them. I can't help you further as my system uses daemons which overtakes interfaces automatically and I don't really know what's going on behind.

Posted

I edited my commands if anyone will look at them. I can't help you further as my system uses daemons which overtakes interfaces automatically and I don't really know what's going on behind.

 

apt-get install bluez blueman

 

after installed, bluetooth monitor in desktop also cannot find devices

what do you mean by using daemons?

Posted

Well, I'm preparing OpenELEC images and I fixed BananaPi M2+ bluetooth just today. I forgot "hciconfig hci0 up" command because I didn't need to use it on OE. Bluetooth is managed by scripts which are watching for changes in Kodi and everything is done automatically, except pairing.

Posted

Well, I'm preparing OpenELEC images and I fixed BananaPi M2+ bluetooth just today. I forgot "hciconfig hci0 up" command because I didn't need to use it on OE. Bluetooth is managed by scripts which are watching for changes in Kodi and everything is done automatically, except pairing.

 

how you get pair in OpenELEC ?

maybe i can follow the same method in armbian

Posted

I found "bluetoothctl" cannot recognize BT controller

Under bluetoothctl > list, does not show any controller

Could it be still driver missing?

I check raspberry pi 3 which using same AP6212 module, lsmod has btbcm

bnep                   10336  2
btbcm                   4196  1 hci_uart
bluetooth             317981  7 bnep,btbcm,hci_uart
rfkill                 16036  6 cfg80211,bluetooth

 

However "modprobe btbcm"

modprobe: FATAL: Module btbcm not found.

 

Also I checkout nanopi2 patch which using AP6212 module as well

(git clone https://github.com/jrspruitt/FriendlyARM_NanoPi_Buildroot_Ext.git)

 

In ~/FriendlyARM_NanoPi_Buildroot_Ext/package/broadcom-bluetooth/Config.in

-----------------------

if BR2_INIT_SYSV || BR2_INIT_BUSYBOX
config BR2_PACKAGE_BROADCOM_BLUETOOTH
        bool "brcm_patchram_plus"
    select BR2_PACKAGE_BLUEZ5_UTILS
 
        help
      Broadcom utility for loading firmware to
      Bluetooth devices.
 
endif
-----------------------------
But cannot find this BR2_PACKAGE_BROADCOM_BLUETOOTH in Armbian source
 

Maybe Armbian source needs this patch?

Posted

@Dony71

First, you are mixing two completely unrelated configurations - buildroot and kernel config. brcm_patchram_plus is replaced with hciattach ... bcm43xx ... command, which does the same. Again, you can't directly compare drivers with Raspberry Pi 3. It uses mainline (vanilla) kernel, which has different drivers for wifi and bluetooth for AP6216 module. BananaPi uses bcmdhd driver which was written by Broadcom and was used also on Android devices, whereas RaspberryPi uses two drivers which were written by community from scratch and are included in mainline linux. Maybe you can use backports if you want, but I wouldn't count on that. Third, if you want to use bluetooth mouse, did you modprobe hidp driver?

Posted

Same thing here:

# systemctl stop bluetooth.service   
# hciattach /dev/ttyS1 bcm43xx 115200        
bcm43xx_init
Flash firmware /etc/firmware/ap6212/4343A0.hcd
Set Controller UART speed to 115200 bit/s
Device setup complete
# hciconfig hci0 up
# hciconfig -a
hci0:   Type: BR/EDR  Bus: UART
       BD Address: 43:43:A0:12:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
       UP RUNNING  
       RX bytes:478 acl:0 sco:0 events:17 errors:0
       TX bytes:331 acl:0 sco:0 commands:17 errors:0
       Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
       Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3  
       Link policy: RSWITCH SNIFF  
       Link mode: SLAVE ACCEPT  
       Name: 'BCM4343A0 26MHz AP6212_CL1-0027'
       Class: 0x000000
       Service Classes: Unspecified
       Device Class: Miscellaneous,  
       HCI Version: 4.1 (0x7)  Revision: 0x3b
       LMP Version: 4.1 (0x7)  Subversion: 0x2122
       Manufacturer: Broadcom Corporation (15)
# hcitool scan
Scanning ...
       84:00:D2:6B:40:ED       Xperia ray
# hciconfig dev 
hci0:   Type: BR/EDR  Bus: UART
       BD Address: 43:43:A0:12:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
       UP RUNNING  
       RX bytes:2356 acl:0 sco:0 events:52 errors:0
       TX bytes:733 acl:0 sco:0 commands:43 errors:0

For blueman, no device detected.

I had to do 

sudo usermod -G bluetooth -a <username>

and reboot to have a window "No adapter found" when cliking on "Setup New Device". Before this usermod I havn't any window...

 

Weird that scanning works in terminal but not with blueman...

Posted

I tried bluetooth again on OpenELEC and I can pair with the phone and connect to it, but using phone as a speaker has evidently some problems (too slow serial speed?). Nevertheless, there is some sound comming out, which means that bluetooth connection should work. Are you sure that you are running bluetoothd daemon in the background? This daemon is responsible for D-Bus communication with blueman (I might be wrong on that, not sure). Last but not least, according to ArchWiki, you have to be member of lp group.

 

@Igor,

What did you try to do? Commands, mentioned in my post, should work.

Posted

I tried on Xenial and after this:

hciattach /dev/ttyS1 bcm43xx 115200

I got error that it cannot put the device up. 

Posted

That is definetly part of the problem, because port function should be <2> for uart and <3> is reserved, e.g. undefined.

Posted

I tried bluetooth again on OpenELEC and I can pair with the phone and connect to it, but using phone as a speaker has evidently some problems (too slow serial speed?). Nevertheless, there is some sound comming out, which means that bluetooth connection should work. Are you sure that you are running bluetoothd daemon in the background? This daemon is responsible for D-Bus communication with blueman (I might be wrong on that, not sure). Last but not least, according to ArchWiki, you have to be member of lp group.

 

@Igor,

What did you try to do? Commands, mentioned in my post, should work.

 

 

bluetooth daemon is running (see below)

the problem is bluetoothctl which suppose to control BT controller does not recognize BT controller device

 

------------------------------------------------------------------------------

pi@bananapim2plus:~$ sudo systemctl status bluetooth
â— bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Wed 2016-06-08 12:17:16 EDT; 13min ago
     Docs: man:bluetoothd(8)
 Main PID: 652 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           â””─652 /usr/lib/bluetooth/bluetoothd
 
Jun 08 12:17:16 bananapim2plus bluetoothd[652]: Bluetooth daemon 5.23
Jun 08 12:17:16 bananapim2plus bluetoothd[652]: Starting SDP server
Jun 08 12:17:16 bananapim2plus systemd[1]: Started Bluetooth service.
Jun 08 12:17:16 bananapim2plus bluetoothd[652]: Bluetooth management interfa...d
Jun 08 12:17:19 bananapim2plus systemd[1]: Started Bluetooth service.
Hint: Some lines were ellipsized, use -l to show in full.
Posted

Also notice "Service Classes: Unspecified"

Try changing device class in /etc/bluetooth/main.conf as following:

# Default device class. Only the major and minor device class bits are
# considered.
#Class = 0x000100 (from default config)
Class = 0x100100

 

But does not help, still "Service Classes: Unspecified"

 

 

pi@bananapim2plus:~$ hciconfig -a hci0
hci0:   Type: BR/EDR  Bus: UART
        BD Address: 43:43:A0:12:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:758 acl:0 sco:0 events:20 errors:0
        TX bytes:343 acl:0 sco:0 commands:20 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'BCM4343A0 26MHz AP6212_CL1-0061'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.1 (0x7)  Revision: 0xf2
        LMP Version: 4.1 (0x7)  Subversion: 0x2122
        Manufacturer: Broadcom Corporation (15)
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines