Hello all, Just completed a down and dirty hack to get the ap6212 Bluetooth functional in a novice user gui interface. Should work for others your success is your own. To get it working I did the following, why so if you have a better way to fix the issue do so please and reply here I will update my hack.
A. Hciattach and Hciconfig refuse to be run as root or privileged user from a start up service or init script. So
chmod u+s /usr/bin/hciattach
chmod u+s /bin/hciconfig
B. All other references I found online concerning the /etc/firmware directory mislead me to believe that the correct firmware name was only the numbers. I got the source code of the latest Bluez package and the correct firmware locations and names are;
rev b with Power jack
/etc/firmware/ap6212/BCM43430A1.hcd
/etc/firmware/ap6212/config.txt
/etc/firmware/ap6212/nvram.txt
/lib/firmware/ap6212/BCM43430A1.hcd
/lib/firmware/ap6212/config.txt
/lib/firmware/ap6212/nvram.txt
Rev A with microusb
/etc/firmware/ap6212/BCM43430A0.hcd
/etc/firmware/ap6212/config.txt
/etc/firmware/ap6212/nvram.txt
/lib/firmware/ap6212/BCM43430A0.hcd
/lib/firmware/ap6212/config.txt
/lib/firmware/ap6212/nvram.txt
C. Bluez and Bluetooth conflict somehow. (i do not care how) We need hciattach and hciconfig so remove bluetooth.
apt remove bluetooth
D. We need to also change the permissions on rfkill or it can not write to the state files.
chmod u+s /usr/sbin/rfkill
E. The bluetooth kernel initialization does not pull in the firmware. SO we need a script that runs at boot. You can not run the script successfully from a privilege user account therefore it can not be made to function as a service or init. My thought is something in bluez denies “privilege escalation” the incorrect way.
the script
#!/bin/bash
while [ ! -f /sys/class/rfkill/rfkill0/state ]
do
` /bin/sleep 1`
done
/usr/sbin/rfkill unblock all
/usr/bin/hciattach /dev/ttyS1 bcm43xx 1500000
/usr/bin/hciattach /dev/ttyS1 bcm43xx 1500000
/bin/hciconfig hci0 up
We have to send the attach command twice Not exactly sure why but I suspect that the first time initializes the variables in python for bluez and the second time python can read the variables find the port and the firmware.
Anyway save the script chmod +x and chmod u+s. Add the script path to a user startup autostart.
This will start and configure the bluetooth module on the M3 and provide a HCI0 interface to use. bluman may or may bot autolaunch but is in the applications menu.
Open bluesman connect your stuff and have at it.