Difference between revisions of "Raspberry Pi 3 - Setting Up Bluetooth"

From Alpine Linux
Jump to: navigation, search
(Work in progress - still broekn)
Line 1: Line 1:
 
== Work in progress - still broken==
 
 
  
 
The Raspberry Pi 3 has bluetooth chip on the BCM2837 and it is connected to the hardware UART.  
 
The Raspberry Pi 3 has bluetooth chip on the BCM2837 and it is connected to the hardware UART.  
Line 15: Line 12:
 
{{cmd|rc-update add bluetooth}}
 
{{cmd|rc-update add bluetooth}}
  
We'll need the firmware from Broadcom
+
We'll need the firmware from Broadcom. You'll have to look online for BCM43430A1.hcd to find $URL
  
 
{{cmd|mount -o remount,rw /dev/mmcblk0p1
 
{{cmd|mount -o remount,rw /dev/mmcblk0p1
Line 21: Line 18:
 
wget $URL/BCM43430A1.hcd -O /media/mmcblk0p1/firmware/brcm/BCM43430A1.hcd}}
 
wget $URL/BCM43430A1.hcd -O /media/mmcblk0p1/firmware/brcm/BCM43430A1.hcd}}
  
Next we load the hci_uart module and we attach the serial port to the bcm43xx
+
Next we need to stop the kernel using the device we want to attach to the bluetooth chip for as a console
 +
 
 +
{{cmd|<nowiki>remove "console=ttyAMA0,115200" from /media/mmcblk0p1/cmdline.txt</nowiki>
  
{{cmd|modprobe hci_uart
+
lbu commit && reboot}}
  
ln -s /lib/firmware /etc/firmware
+
After the reboot we attach the serial port to the bcm43xx
  
 +
{{cmd|
 
hciattach /dev/ttyAMA0 bcm43xx 115200 noflow -
 
hciattach /dev/ttyAMA0 bcm43xx 115200 noflow -
 
}}
 
}}
 +
 +
The output from the hciattach above should be
 +
 +
{{cmd|bcm43xx_init
 +
Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
 +
Set Controller UART speed to 115200 bit/s
 +
Device setup complete
 +
}}
 +
Then it's a matter of doing what you normally do with your bluetooth stack. This should get you going:
 +
{{cmd|hciconfig hci0 up
 +
hcitool dev
 +
hciconfig scan
 +
bluetoothctl}}

Revision as of 12:34, 31 May 2016

The Raspberry Pi 3 has bluetooth chip on the BCM2837 and it is connected to the hardware UART.

You can get bluetooth to work only if you are not using the UART for anything else.

You'll need the bluez package

apk add bluez

Start the bluetooth deamon at boot. This should load the right modules when you next reboot.

rc-update add bluetooth

We'll need the firmware from Broadcom. You'll have to look online for BCM43430A1.hcd to find $URL

mount -o remount,rw /dev/mmcblk0p1 wget $URL/BCM43430A1.hcd -O /media/mmcblk0p1/firmware/brcm/BCM43430A1.hcd

Next we need to stop the kernel using the device we want to attach to the bluetooth chip for as a console

remove "console=ttyAMA0,115200" from /media/mmcblk0p1/cmdline.txt lbu commit && reboot

After the reboot we attach the serial port to the bcm43xx

hciattach /dev/ttyAMA0 bcm43xx 115200 noflow -

The output from the hciattach above should be

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set Controller UART speed to 115200 bit/s Device setup complete

Then it's a matter of doing what you normally do with your bluetooth stack. This should get you going:

hciconfig hci0 up hcitool dev hciconfig scan bluetoothctl