roxymon
Posts: 2
Joined: Fri Aug 18, 2017 1:45 am

Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 1:48 am

Great. Raspbian Stretch it out!

First problem.

Fresh install on a Raspberry Pi 3. Running

Code: Select all

systemctl status bluetooth
gives:

Code: Select all

$ systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2017-08-18 01:37:37 UTC; 1s ago
     Docs: man:bluetoothd(8)
 Main PID: 667 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─667 /usr/lib/bluetooth/bluetoothd

Aug 18 01:37:37 raspberrypi systemd[1]: Starting Bluetooth service...
Aug 18 01:37:37 raspberrypi bluetoothd[667]: Bluetooth daemon 5.43
Aug 18 01:37:37 raspberrypi systemd[1]: Started Bluetooth service.
Aug 18 01:37:37 raspberrypi bluetoothd[667]: Starting SDP server
Aug 18 01:37:38 raspberrypi bluetoothd[667]: Bluetooth management interface 1.14 initialized
Aug 18 01:37:38 raspberrypi bluetoothd[667]: Failed to obtain handles for "Service Changed" characteristic
Aug 18 01:37:38 raspberrypi bluetoothd[667]: Sap driver initialization failed.
Aug 18 01:37:38 raspberrypi bluetoothd[667]: sap-server: Operation not permitted (1)
What are some steps to start on diagnosis?

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 12:35 pm

The Sap warnings are normal. Ignore them.

roxymon
Posts: 2
Joined: Fri Aug 18, 2017 1:45 am

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 4:17 pm

It would seem they are not normal. It causes the adapter to not be detected by bluetoothctl.

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 4:39 pm

No, if that's the case, it's not the result of the Sap warnings. What is the response from 'hciconfig -a'? I'm loading up the new Stretch image now and will post my results.

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 6:56 pm

I've just loaded up the 2017-08-16 Raspbian Stretch image. Here're the results of 'systemctl status bluetooth':

Code: Select all

● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2017-08-18 18:42:59 UTC; 22min ago
     Docs: man:bluetoothd(8)
 Main PID: 475 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─475 /usr/lib/bluetooth/bluetoothd

Aug 18 18:42:59 raspberrypi systemd[1]: Starting Bluetooth service...
Aug 18 18:42:59 raspberrypi bluetoothd[475]: Bluetooth daemon 5.43
Aug 18 18:42:59 raspberrypi systemd[1]: Started Bluetooth service.
Aug 18 18:42:59 raspberrypi bluetoothd[475]: Starting SDP server
Aug 18 18:42:59 raspberrypi bluetoothd[475]: Bluetooth management interface 1.14 initialized
Aug 18 18:42:59 raspberrypi bluetoothd[475]: Failed to obtain handles for "Service Changed" characteristic
Aug 18 18:43:00 raspberrypi bluetoothd[475]: Sap driver initialization failed.
Aug 18 18:43:00 raspberrypi bluetoothd[475]: sap-server: Operation not permitted (1)
Aug 18 18:43:00 raspberrypi bluetoothd[475]: Endpoint registered: sender=:1.6 path=/MediaEndpoint/A2DPSource
Aug 18 18:43:00 raspberrypi bluetoothd[475]: Endpoint registered: sender=:1.6 path=/MediaEndpoint/A2DPSink
And here's the result from starting up bluetoothctl:

Code: Select all

[NEW] Controller 43:43:A1:12:1F:AC raspberrypi [default]
So if your Pi is not recognizing the adapter, it's not attributable to the new Stretch image.

loza14
Posts: 5
Joined: Sat Feb 18, 2017 2:37 pm

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 9:27 pm

I have updated to Stretch from Jessie on my pi3 and I've got EXACTLY the same problem.
Moreover it shows the mac-address of the device as AA:AA:AA:AA:AA:AA
It can detect my keyboard but does not want to pair with it.
Everything was working perfectly on Jessie.

RonR
Posts: 270
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 11:14 pm

FWIW, I don't seem to have a problem on the new Stretch. This is from a virgin image:

Code: Select all

[email protected]:~# systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2017-08-18 22:54:33 UTC; 10min ago
     Docs: man:bluetoothd(8)
 Main PID: 443 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─443 /usr/lib/bluetooth/bluetoothd

Aug 18 22:54:33 raspberrypi systemd[1]: Starting Bluetooth service...
Aug 18 22:54:33 raspberrypi bluetoothd[443]: Bluetooth daemon 5.43
Aug 18 22:54:33 raspberrypi systemd[1]: Started Bluetooth service.
Aug 18 22:54:33 raspberrypi bluetoothd[443]: Starting SDP server
Aug 18 22:54:33 raspberrypi bluetoothd[443]: Bluetooth management interface 1.14 initialized
Aug 18 22:54:33 raspberrypi bluetoothd[443]: Failed to obtain handles for "Service Changed" characteristic
Aug 18 22:54:33 raspberrypi bluetoothd[443]: Sap driver initialization failed.
Aug 18 22:54:33 raspberrypi bluetoothd[443]: sap-server: Operation not permitted (1)
The SAP errors can be eliminated with:

Code: Select all

sed -i 's|^ExecStart=/usr/lib/bluetooth/bluetoothd$|ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap|' /lib/systemd/system/bluetooth.service
I haven't yet figured out how to eliminate the "Failed to obtain handles for "Service Changed" characteristic" error.

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 18, 2017 11:50 pm

Yes, you can remove the Sap warnings by telling Bluetooth not to load the SAP profile. Or not. The result is the same in both cases: you won't be able to access your phone's SIM card using the SAP profile.

toney
Posts: 1
Joined: Sun Aug 20, 2017 5:20 pm

Re: Raspbian Stretch Bluetooth is Broken

Sun Aug 20, 2017 5:34 pm

I also had the "Failed to obtain handles for "Service Changed" characteristic" messages, and no sound playback over bluetooth (raspberry as playback device).

Audio playback now works using /usr/bin/bluealsa-aplay (procedure similar to https://volumio.org/forum/volumio-bluez ... t6130.html).
("Failed to obtain..." messages are still logged.)

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Mon Aug 21, 2017 1:09 am

Yes, again, those warning messages may be safely ignored.

loza14
Posts: 5
Joined: Sat Feb 18, 2017 2:37 pm

Re: Raspbian Stretch Bluetooth is Broken

Mon Aug 21, 2017 9:14 am

is there any way to force reinstall the Bluetooth driver or something like that?

rainer.brito
Posts: 26
Joined: Tue Aug 22, 2017 1:55 pm

Re: Raspbian Stretch Bluetooth is Broken

Tue Aug 22, 2017 2:09 pm

Hi,

I have some related issues pairing and using a bluetooth speaker (JBL GO). The device can be paired only after a reboot or before any management with bluetooth (GUI or CLI). Although the pairing "works" it is unable to remain functional after some seconds (or minutes) of audio stream (youtube, local sound). I'm using Chromium on a fresh, clean Stretch image recently update e totally functional.

I've searched a lot around forums for some workaround, but didn't find a really useful answer for this.


Thanks

SierraKilo
Posts: 8
Joined: Fri Aug 25, 2017 4:37 pm

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 25, 2017 5:58 pm

I'm experiencing a slightly another, but similar problem:
Configuration: Raspian read only boot device with unisonFS overlay. During boot the stored /var/lib/bluetooth/xx:xx:xx:xx:xx/yy:yy:yy:yy/* directory is restored from an external usb device (that makes the whole system configurable by an external usb while still having the root medium read only)

Then I connected to the bluetooth speaker by

Code: Select all

echo -e "connect yy:yy:yy:yy" | bluetoothctl
That worked well on raspian Jessy, but on Stretch it fails with a mysterious "org.bluez.Error.Failed" message:

Code: Select all

[bluetooth]# connect FC:58:FA:C1:A0:AE
Attempting to connect to FC:58:FA:C1:A0:AE
[CHG] Device FC:58:FA:C1:A0:AE Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device FC:58:FA:C1:A0:AE Connected: no
(where on Stretch I also have to do

Code: Select all

    systemctl restart bluetooth
first to make bluetoothctl aware about the FC:58:FA:C1:A0:AE device at all, which was not needed on Jessie)

So something has changed on Stretch, but I can not figure out what and how to fix it.

Any idea is highly appreciated ;-)

Thanks in advance
Steffen

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Fri Aug 25, 2017 7:36 pm

Have you done a 'sudo apt-get update && sudo apt-get upgrade' lately? Immediately after booting up, what do 'hciconfig -a' and 'bluetoothctl' tell you?

LordMyschkin
Posts: 15
Joined: Sun Feb 22, 2015 12:10 pm

Re: Raspbian Stretch Bluetooth is Broken

Sat Aug 26, 2017 8:23 pm

it does indeed seem that bluetooth alsa ist broken in rasbian lite; I spend a few hours connecting my bt speaker in "lite", then switched to the standard "fat" edition, were i can connect via bluetoothctl - just have to figure hout how to configure alsa.

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Sat Aug 26, 2017 8:32 pm

I suspect what you're seeing is some additional code Simon added to the GUI. Just a guess, though.

SierraKilo
Posts: 8
Joined: Fri Aug 25, 2017 4:37 pm

Re: Raspbian Stretch Bluetooth is Broken

Sun Aug 27, 2017 10:16 am

Douglas6 wrote:
Fri Aug 25, 2017 7:36 pm
Have you done a 'sudo apt-get update && sudo apt-get upgrade' lately? Immediately after booting up, what do 'hciconfig -a' and 'bluetoothctl' tell you?
Hello Douglas, thanks for your support and sorry for my late answer. After apt-get update & upgrade I found that I have to

sudo apt-get install bluealsa

to get rid of the

Failed to connect: org.bluez.Error.Failed


That makes bluetoothctl works "normal" again, so the normal interactive search and connect functions work now

- but my original problem is still open:

On Jessie I was able to remember a known speaker by save and restore its info file

/var/lib/bluetooth/B8:27:EB:1E:90:30/FC:58:FA:C1:A0:AE/info

but even that this file (and some others) will be generated under Stretch too, a restore does not make bluetoothctl to remember the speaker and to connect to it without any manual additional scan on /off circle (As said, my device runs as a headless read only device with overlayFS, where the user specific settings gets restored from an USB at boot time, so that is what it makes so special)

So it seems that the bluetooth system on Stretch stores it's found devices and settings anyhow in a different way as Jessie did, but I can't figure out how and how to save and restore this :-(

So if maybe anybody has a good idea??

regards
Steffen

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Sun Aug 27, 2017 11:32 am

Try 'sudo apt-get update && sudo apt-get upgtade'

SierraKilo
Posts: 8
Joined: Fri Aug 25, 2017 4:37 pm

Re: Raspbian Stretch Bluetooth is Broken

Sun Aug 27, 2017 12:47 pm

Douglas6 wrote:
Sun Aug 27, 2017 11:32 am
Try 'sudo apt-get update && sudo apt-get upgtade'
Hi Doug
As written, I did update and upgrade already (which installed a new bluetooth-pi package, btw). Together with the additional bluealsa I can now interactively pair with a speaker again, but to backup and restore stored BT device connections, as I did in Jessie, don't work anymore in Stretch. Stretch seems to use another mechanism or locations, I assume - but how? :|

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Sun Aug 27, 2017 1:22 pm

I'd be surprised if it did, but I haven't looked into it. Of course the initial glitch of using the wrong adapter bdaddr would have changed the location, but if you upgraded, that should be fixed.

schriek
Posts: 8
Joined: Thu Aug 31, 2017 9:51 am

Re: Raspbian Stretch Bluetooth is Broken

Thu Aug 31, 2017 9:53 am

I am having the same issue as SierraKilo, where connecting without scanning first is impossible (whereas this worked fine on Jessie).

@SierraKilo, did you manage to resolve the issue, or did you find a workaround perhaps?

SierraKilo
Posts: 8
Joined: Fri Aug 25, 2017 4:37 pm

Re: Raspbian Stretch Bluetooth is Broken

Thu Aug 31, 2017 10:21 am

schriek wrote:
Thu Aug 31, 2017 9:53 am
I am having the same issue as SierraKilo, where connecting without scanning first is impossible (whereas this worked fine on Jessie).

@SierraKilo, did you manage to resolve the issue, or did you find a workaround perhaps?
No, unfortunately not far, but I also didn't had time to look into it in the last days.

Just to summarize: On Jessie I was able to pair first interactively via bluetoothctl, then I saved the info file and was able to restore that pairing then by copying the saved file structure onto a virgin raspian image and re-pairing then with a echo -r "connect xx:yy.." | bluetoothctl in a script.

On Stretch this don't work anymore, even if I save and restore the whole /var/lib/bluettooth/xx:yy... folder with all its contents like settings and cache files :roll:

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Thu Aug 31, 2017 12:51 pm

@schreik: That doesn't sound like the same problem at all. Perhaps you could give some details.

@SierraKilo: Are you sure the Bluetooth device addresses of the saved files match the addresses of the new image?

schriek
Posts: 8
Joined: Thu Aug 31, 2017 9:51 am

Re: Raspbian Stretch Bluetooth is Broken

Fri Sep 01, 2017 10:22 am

@Douglas6 The problem is exactly as SierraKilo explained in his last post, maybe my problem description was a bit vague.
I used to do a "echo -e "connect xx:yy.. | bluetoothctl" after boot to connect automatically to my phone in my car. As SierraKilo explained, this does not work on Stretch as long as the pi has not discovered the phone (i.e. knows about it), contrary to Jessie.

User avatar
Douglas6
Posts: 4354
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspbian Stretch Bluetooth is Broken

Fri Sep 01, 2017 11:41 pm

Have you upgraded Stretch? What does 'hciconfig' tell you?

Return to “Raspbian”

Who is online

Users browsing this forum: fabsfabsfabs, TheZajic and 13 guests