rpiforfun
Posts: 28
Joined: Wed Jan 15, 2014 11:25 pm

bluetooth trouble

Thu Feb 12, 2015 3:10 am

I wanted to ask how best to troubleshoot a bluetooth issue I've been having recently.

I rely on a USB bluetooth adapter (GBU521) for scanning for certain devices. It has worked well, but seems to become very flaky with its detection, even when they were direct proximate to each other. The devices are paired.

In testing tonight, I was manually testing using "hcitool name aa:bb:cc:dd:ee:ff" and it consistently failed to locate the device - which was in fact on and detectable by a second non-pi computer. I did notice that the command would instantly return most of the time, as if it wasn't even trying to do anything. Other bluetooth commands behaved similarly.

I tried a bunch of options, but the only fix was to stop and start bluetooth. It was immediately able to detect the device after I did that.

I have reviewed my syslog and I see nothing indicating a crash, but after some time I suspect that bluetooth will "die" again.

Is there any way to crank up debug logging for bluetooth components? My bluetooth script logs when the device is/isn't seen, but I need more technical info to solve this. I'm using the recommended wall wart from Adafruit.

Here are some non-contiguous log snippets I thought were interesting:

Code: Select all

<4>1 2015-02-06T21:36:36-05:00 spypi kernel - - - kernel: [    7.661894] bluetooth hci0: Direct firmware load for brcm/BCM20702A0-0a5c-21e8.hcd failed with error -2
<30>1 2015-02-06T21:36:39-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: HCI dev 0 up
<27>1 2015-02-06T21:36:39-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: Proximity GATT Reporter Driver: Operation not permitted (1)
<27>1 2015-02-06T21:36:39-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: Could not get the contents of DMI chassis type
<27>1 2015-02-06T21:36:39-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: input-headset driver probe failed for device aa:cc:AC:46:cc:dd
<27>1 2015-02-06T21:36:40-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: input-headset driver probe failed for device aa:bb:2B:19:cc:ee
<27>1 2015-02-06T21:36:40-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: Unable to load keys to adapter_ops: Function not implemented (38)
<30>1 2015-02-06T21:36:40-05:00 spypi bluetoothd 2252 - - bluetoothd[2252]: Adapter /org/bluez/2252/hci0 has been enabled

rpiforfun
Posts: 28
Joined: Wed Jan 15, 2014 11:25 pm

Re: bluetooth trouble

Tue Feb 17, 2015 1:30 am

Sure enough, this bluetooth wonk out happened again. restarting bluetoothd has fixed the ability to consistently detect my device.

Anyone have any ideas on how to solve this? I'll look at a cron to restart bluetoothd every night, but that shouldn't need to happen.

UPDATE: I'm attempting to load this firmware based on seeing the related error and hoping it will improve bluetooth.

https://bugs.launchpad.net/ubuntu/+sour ... mments=all

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

Re: bluetooth trouble

Tue Feb 17, 2015 3:53 am

My experience is that Bluetooth is a bit flaky on all non-firmware stacks, whether Linux or Android. Using 'hcitool name' to test connectivity also seems odd. I would stick with 'hcitool scan' for testing availability. hcidump is a good tool for viewing the low level hci activity.

rpiforfun
Posts: 28
Joined: Wed Jan 15, 2014 11:25 pm

Re: bluetooth trouble

Tue Feb 17, 2015 11:56 pm

Thanks for the response. The device doesn't appear using a scan. I have to use the name method to see it.

I have started to run the same script on my Ubuntu 14.04 system (but different BT adapter) to see how it lines up over time via my script log.

Since my Ubuntu system isn't usually near the BT device, it doesn't make a clear cut comparison. But it does seem like it is more stable. If I bring the device over, the log shows it consistently sees it.

That gives me some hope that the RPI can do the same thing. And makes me suspect the RPI (software) or the specific USB adapter.

rpiforfun
Posts: 28
Joined: Wed Jan 15, 2014 11:25 pm

Re: bluetooth trouble

Sat Feb 21, 2015 12:55 am

I just did a rpi-update and my rpi seems so much faster. Could be placebo right now but it seems much faster. I think my firmware could have had some issues. (I was doing apt-upgrade consistently)

So my bluetooth timeout issue timer is reset yet again. Hopefully I'll have the patience to go 4-5 days without restarting it again.

rpiforfun
Posts: 28
Joined: Wed Jan 15, 2014 11:25 pm

Re: bluetooth trouble

Thu Feb 26, 2015 3:12 am

Its been 5 days since I rebooted. I am still seeing better performance than ever. I think a firmware update has really helped. bluetooth has been fine since. Handling all the detection changes correctly.

/solved

erotavlas
Posts: 41
Joined: Wed Mar 11, 2015 5:26 pm

Re: bluetooth trouble

Wed Apr 29, 2015 8:08 am

I have a similar trouble with my Raspbian and my bluetooth adapter Broadcom BCM20702A0 chip.
In particular, I have latest version of Raspbian

Code: Select all

lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 8.0 (jessie)
Release:	8.0
Codename:	jessie
kernel

Code: Select all

Linux raspbian 3.18.5+ #748 PREEMPT Wed Feb 4 21:24:41 GMT 2015 armv6l GNU/Linux
It seems that the firmware for my bluetooth device is not properly loaded

Code: Select all

dmesg | grep tooth
[    8.985158] Bluetooth: Core ver 2.19
[    9.377429] Bluetooth: HCI device and connection manager initialized
[    9.791952] Bluetooth: HCI socket layer initialized
[    9.798621] Bluetooth: L2CAP socket layer initialized
[   10.188329] Bluetooth: SCO socket layer initialized
[   10.437073] bluetooth hci0: Direct firmware load for brcm/BCM20702A0-0a5c-21e8.hcd failed with error -2
[   10.451730] Bluetooth: hci0: BCM: patch brcm/BCM20702A0-0a5c-21e8.hcd not found
[   24.338675] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   24.338683] Bluetooth: BNEP filters: protocol multicast
[   24.338736] Bluetooth: BNEP socket layer initialized
I read here about a bug of Ubuntu with this devices https://bugs.launchpad.net/ubuntu/+sour ... mments=all, but I think that also Raspbian is interested.
Do you have any suggestions?

Thank you

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

Re: bluetooth trouble

Wed Apr 29, 2015 8:47 pm

I'll dig out my Broadcom adapter and do some testing. Had troubles with it years ago, but they seemed to have been fixed at some point. Perhaps things went south again.

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

Re: bluetooth trouble

Wed Apr 29, 2015 11:24 pm

Sorry, my Broadcom adapter uses a BCM92046DG-CL1ROM chipset, and doesn't have problems.

It appears that that patch fixes some HFP/HSP problems. I would contact your device manufacturer to see if they provide the ROM patch (BCM20702A0-0a5c-21e8.hcd) and installation instructions.

It is very possible that the problems you're experiencing (you didn't mention) have nothing to do with this patch.

chappallebhargav
Posts: 1
Joined: Wed Sep 20, 2017 7:33 am

Re: bluetooth trouble

Wed Sep 20, 2017 9:32 am

Hi all,
I have been trying for the last few days to use pan profile of Bluetooth. I have configured Ethernet bridging .
I am running server as
pand --listen --role NAP

in client side device
pand --connect 5C:B6:CC:03:CE:A5
i have checked var/log/messages
it is showing
Jul 7 10:27:26 daemon.info pand[2577]: Bluetooth PAN daemon version 2.25
Jul 7 10:27:26 daemon.info pand[2577]: Connecting to 5C:B6:CC:03:CE:A5
Jul 7 10:27:28 daemon.err pand[2577]: Connect to 5C:B6:CC:03:CE:A5 failed. Connection refused(111)
Jul 7 10:27:30 daemon.err bluetoothd[2558]: input-headset driver probe failed for device 5C:B6:CC:03:CE:A5

please suggest me how to enable pan service in blue-tooth so that i can share Internet through Blue-tooth
Please tell me the steps
My pan daemon version : 2.25
Bluez version : 4.94

Return to “Troubleshooting”