4

The Issue:

I'm having an issue with my Mac where if I try to pair it with my Pi using Bluetooth, it connects after confirming the code it displays, then after about 5-10 seconds, it randomly disconnects. I don't get an error, it just drops my connection from each device that I have paired with my Pi.

Here's what I am using:

  • Raspberry Pi 2 Model B+ (Canakit Edition)
  • Plugable USB Bluetooth 4.0 Low Energy Micro Adapter
  • Macbook-Air Mid 2011, 11-inch. (Running OS X 10.10.3 to(*) 10.10.5 Yosemite)

The software I'm using is blueman.

I don't know if this is a timeout thing with Mac or with my Pi but I can never get it to stay connected for more than 10 seconds.

(*) - The reason I said to on my specs of my Mac is because more than one Mac will be pairing, specifically about 20 Macbook Airs, all of the same model.


Updates:

UPDATE 28/3/16 -

I found a way to keep it paired. It doesn't make any sense, but if I go to the Blueman Bluetooth Manager and setup a new device under a group network, I somehow stay connected to the Pi. It never establishes a connection to the "group network", but it does keep the Pi and Mac connected. (Not really what I'm looking for though.)

UPDATE 29/3/16 -

Tried Bluedevil, as well as executing through bluetoothctl that @Chris suggested, but no luck. Started looking into editting the /usr/bin/bluetoothctl to bypass the issue specified in @Chris' 2nd link in his post, which got confusing as the line already existed when the tutorial stated it didn't, making me guess it was outdated. Will be trying the first link method later when I can to see if it fixes it. I did try to pair it with the Windows 10 side of a Mac Mini and I actually was able to pair successfully, yet when on OS X on the Mac Mini, it didn't pair correctly.

UPDATE 4/4/16 -

Haven't been able to fix this problem. Also came around an issue when checking for an address nearby using a Python script, but my device I'm testing it with is shut down and the only way I can stop it from automatically saying it's here is by removing it from trusted devices.

  • I suggest you try to find some log or disconnect message by checking system logs or connecting your bluetooth devices in a terminal through bluetoothctl – Chris Mar 29 '16 at 0:02
5

Had the same problem and found this to work. The error in syslog as mentioned in previous post: "Protocol not available" suggest the Sound (Multimedia device) protocol is not available.

Make sure the PulseAudio Bluetooth Library is installed:

sudo apt-get install pulseaudio-module-bluetooth

then make sure the Pulse Audio server is actually running. First stop it:

sudo killall pulseaudio

and start it:

pulseaudio --start

Assuming you've paired the bluetooth device successfully and it is trusted simply run bluetoothclt again and

connect xx:xx:xx:xx:xx:xx
  • 1
    this helped....i think this should be the accepted answer... – anshulkatta Apr 20 '17 at 14:43
  • 1
    jeez... after about 4 hours.. at least, this works. – DevDonkey May 20 '17 at 11:13
3
+50

I am getting the same issues as you and it may be a driver related incompatibility at this point that we can't easily fix. Please read this report, on how someone has fixed it in Arch Linux for a specific bluetooth device (the solution there is on page 2), but this probably won't work for you: https://bbs.archlinux.org/viewtopic.php?id=197469

To get more information and insight into the issue, you should try the following to connect your Raspberry Pi 2 to your MacBook Air:

  1. Open a Terminal Window on RPi2
  2. Open bluetoothctl (it should show the RPi2 Bluetooth MAC Controller and possibly any paired Device)
  3. help will list all commands and power on will turn on Bluetooth if it isn't already
  4. paired-devices will show you if you have succeeded in pairing with your MacBook Air (I'll assume this is your MBA address from now on: 00:00:00:00:00::00)
  5. type info 00:00:00:00:00::00 and check that it's trusted and not blocked
  6. If the MacBook Air is not trusted try: trust 00:00:00:00:00::00
  7. Next try connect 00:00:00:00:00::00 and check what happens, if everything appears fine check info 00:00:00:00:00::00 again to see if they are now connected (probably it won't work, though).

In case your MacBook Air is not listed as paired in the first place, make your RPi discoverable (type discoverable on and pairable on, then scan on). On Mac OS X go to the System Preferences > Bluetooth to also make your Mac discoverable. Try to pair your devices from the RPi - it should show a PIN on your MBA and you need to confirm that on the RPi. Afterwards you can try to connect with connect 00:00:00:00:00::00

You may get to see these messages:

Failed to connect: org.bluez.Error.Failed
Failed to pair: org.bluez.Error.AuthenticationFailed

If you now check your system log /var/log/syslog you likely will find this:

bluetoothd[379]: a2dp-source profile connect failed for 00:00:00:00:00::00: Protocol not available

Where to go from here?

First I would try to connect the RPi with another bluetooth device, such as a Phone, Keyboard, Mouse or Speaker to see if you encounter the same issues there.

Another suggestion you can try was suggested in this answer over here: https://unix.stackexchange.com/questions/258074/error-when-trying-to-connect-to-bluetooth-speaker-org-bluez-error-failed

There is another path using hcitool and bluez to try and connect bluetooth devices with a Raspberry Pi over here: https://dustplanet.de/howto-connect-your-bluetooth-keyboard-to-raspbmc-logitech-ultrathin-keyboard/

  • Tried your method with the same output. I tried using my iPhone and my iPhone couldn't even see that it was discoverable. – FivePixels Mar 29 '16 at 13:17
  • Updated my post with some odd information I found. Tried the second link and the vi was way too much and had to reinstall bluez. – FivePixels Mar 29 '16 at 14:14
  • Any suggestions? – FivePixels Mar 30 '16 at 16:10
  • I have had some basic success going with a python wrapper, but don't think it will help here ... – Chris Mar 30 '16 at 22:37
  • I've had the same issues and have been able to fix this by (re)starting PulseAudio before connecting to devices: pulseaudio -k && pulseaudio --start – Momro Jan 6 '17 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.