Topgundreamer
Posts: 2
Joined: Sat Feb 18, 2017 7:20 am

Re: Bluetooth not working after update - information needed!

Sat Feb 18, 2017 7:42 am

Hi all, new to forum and to the raspberry pi, I have been trying for the last 5 hours to get bluetooth working on my pi 3, I have tried many different commands and still no luck

Under the status bluetooth.service I am seeing Active:failed

Once I type bluetoothctl I can no longer type anything else

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

Re: Bluetooth not working after update - information needed!

Sat Feb 18, 2017 10:19 am

It sounds to me like you are using a very old version of the operating system. Best idea is to start with the latest version of Jessie.

Topgundreamer
Posts: 2
Joined: Sat Feb 18, 2017 7:20 am

Re: Bluetooth not working after update - information needed!

Sat Feb 18, 2017 5:02 pm

Ok thank you, a coworker setup my pi so Ill try a new jesse, for got to mention I am using strictly for emulation station, the only thing I still cant understand is why the ps3 controller connects/pairs but nothing else will

If I do an hcitool scan I see the controller listed, but bluetoothctl still has no function

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

Re: Bluetooth not working after update - information needed!

Sat Feb 18, 2017 5:19 pm

Topgundreamer wrote:If I do an hcitool scan I see the controller listed, but bluetoothctl still has no function
This is an old problem. Try 'sudo bluetoothctl'. However, I don't know what else might be out of date / not working.

adrianotanaka
Posts: 2
Joined: Sat Apr 15, 2017 12:36 pm

Re: Bluetooth not working after update - information needed!

Sat Apr 15, 2017 2:38 pm

cresfang wrote:For me its bcoz of the ps3controller driver from RetroPie.

I noticed the bluetooth in Raspbian Jessie stopped working after I installed RetroPie with ps3controller driver.
After I removed that driver, all worked OK again.
Thanks,
This solved my problem.

:D :D :D :D :D :D

xhit
Posts: 4
Joined: Wed May 31, 2017 6:42 pm

Re: Bluetooth not working after update - information needed!

Wed May 31, 2017 7:02 pm

The mini-uart bluetooth connection have become unstable following the lastest kernel and firmware upgrade (2017-04-27). I have installed it from scratch from the April raspbian image and the while on that version it works fine, but as soon as I do the apt-get upgrade it gets unstable. Initially the connection works but after a while the connection stops working and the most basic bluetooth commands becomes unresponsive.

Code: Select all

hciconfig -a
hci0:	Type: BR/EDR  Bus: UART
	BD Address: XXXXXXXXXXXX  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:915 acl:0 sco:0 events:42 errors:0
	TX bytes:1728 acl:6 sco:0 commands:55 errors:0
	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH SNIFF 
	Link mode: SLAVE ACCEPT 
Can't read local name on hci0: Connection timed out (110)
At this point restarting hciuart service fails and I have to do a reboot to get the initial connection working again. I have tried to rollback of the firmware but that does not work since the whole upgrade is tied with a kernel upgrade. I have even lowered the baud-rate to 115200 in the hciattach command (/usr/bin/btuart) but to no avail. Any ideas to move forward?

config.txt additions:

Code: Select all

enable_uart=1
core_freq=250
dtoverlay=pi3-miniuart-bt 


Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 9:57 am

Hello,
I ve just dist-upgraded my pi3, i saw some news on bluez and various firmware, upgraded and now my rfcomm virtual serial port returns only this odd error

Code: Select all

read failed: device reports readiness to read but returne
d no data (device disconnected or multiple access on port
?)
What was wrong? And i dont know how to debug this..
Thanks

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

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 12:22 pm

Several people seem to be having problems with Bluetooth after a dist-upgrade. First, check the adapter. What does 'hciconfig -a' tell you?

(On a clean install, rfcomm seems to be working fine.)

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 2:09 pm

Hello douglas, i was hoping in you :)

Here is the output:

Code: Select all

pi@baguette:~ $ hciconfig -a                             
hci0:   Type: BR/EDR  Bus: UART                          
        BD Address: 43:43:A1:12:1F:AC  ACL MTU: 1021:8  S
CO MTU: 64:1                                             
        UP RUNNING                                       
        RX bytes:1602 acl:6 sco:0 events:69 errors:0     
        TX bytes:1668 acl:4 sco:0 commands:51 errors:0   
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH SNIFF                       
        Link mode: SLAVE ACCEPT                          
        Name: 'baguette'                                 
        Class: 0x000000                                  
        Service Classes: Unspecified                     
        Device Class: Miscellaneous,                     
        HCI Version: 4.1 (0x7)  Revision: 0x145          
        LMP Version: 4.1 (0x7)  Subversion: 0x2209       
        Manufacturer: Broadcom Corporation (15)          
Thanks ;)

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

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 2:57 pm

Well, that looks normal (except for the adapter name 😉). Maybe some more details; what are you trying to connect to? Are you connecting to the Pi or from the Pi? Is the SPP profile loaded ('sudo sdptool browse local')? What software are you using for serial comms? When exactly does the error occur?

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 3:40 pm

This is an old working hc06 adapter, set up and working for ages.
But this seems interesting ;)

Code: Select all

pi@baguette:~ $ sudo sdptool browse local                
Failed to connect to SDP server on FF:FF:FF:00:00:00: No 
such file or directory
Sounds arabic to me ;)

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

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 3:55 pm

OK, is the compatibility flag still set on the bluetoothd command in /etc/systemd/system/dbus-org.bluez.service? Review this post and repeat if necessary: viewtopic.php?p=947185#p947185

You may need to unpair and re-pair the devices once you get SPP running.

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 4:07 pm

I had to add the -C (never needed this before), but the sensor is still noto working.
Do you see anything useful in this? Andò thanks a lot, as always :)

Code: Select all

pi@baguette:/usr/local/bin/classes/sensors $ sudo sdptool
 browse local                                            
Browsing FF:FF:FF:00:00:00 ...                           
Service RecHandle: 0x10000                               
Service Class ID List:                                   
  "PnP Information" (0x1200)                             
Profile Descriptor List:                                 
  "PnP Information" (0x1200)                             
    Version: 0x0103                                      
                                                         
Browsing FF:FF:FF:00:00:00 ...                           
Service Search failed: Invalid argument                  
Service Name: Serial Port                                
Service Description: COM Port                            
Service Provider: BlueZ                                  
Service RecHandle: 0x10001                               
Service Class ID List:                                   
  "Serial Port" (0x1101)                                 
Protocol Descriptor List:                                
  "L2CAP" (0x0100)                                       
  "RFCOMM" (0x0003)                                      
    Channel: 1                                           
Language Base Attr List:                                 
  code_ISO639: 0x656e                                    
  encoding:    0x6a                                      
  base_offset: 0x100                                     
Profile Descriptor List:                                 
  "Serial Port" (0x1101)                                 
    Version: 0x0100                                      
                                                         
Service Name: Generic Access Profile                     
Service Provider: BlueZ                                  
Service RecHandle: 0x10002                               
Service Class ID List:                                   
  "Generic Access" (0x1800)                              
Protocol Descriptor List:                                
  "L2CAP" (0x0100)                                       
    PSM: 31                                              
  "ATT" (0x0007)                                         
    uint16: 0x0001                                       
    uint16: 0x0008                                       
                                                         
Service Name: Generic Attribute Profile                  
Service Provider: BlueZ                                  
Service RecHandle: 0x10003                               
Service Class ID List:                                   
  "Generic Attribute" (0x1801)                           
Protocol Descriptor List:                                
  "L2CAP" (0x0100)                                       
    PSM: 31                                              
  "ATT" (0x0007)                                         
    uint16: 0x0010                                       
    uint16: 0x0010                                       
                                                         
Service Name: AVRCP CT                                   
Service RecHandle: 0x10004                               
Service Class ID List:                                   
  "AV Remote" (0x110e)                                   
  "AV Remote Controller" (0x110f)                        
Protocol Descriptor List:                                
  "L2CAP" (0x0100)                                       
    PSM: 23                                              
  "AVCTP" (0x0017)                                       
    uint16: 0x0103                                       
Profile Descriptor List:                                 
  "AV Remote" (0x110e)                                   
    Version: 0x0105                                      
                                                         
Service Name: AVRCP TG                                   
Service RecHandle: 0x10005                               
Service Class ID List:                                   
  "AV Remote Target" (0x110c)                            
Protocol Descriptor List:                                
  "L2CAP" (0x0100)                                       
    PSM: 23                                              
  "AVCTP" (0x0017)                                       
    uint16: 0x0103                                       
Profile Descriptor List:                                 
  "AV Remote" (0x110e)                                   
    Version: 0x0104 
    

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

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 4:22 pm

Hmm, that looks like Jessie results, not Stretch. Should still work. Are you running an rfcomm command? Is it still failing the same way? What does 'bluetoothd -v' return?

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 4:35 pm

This is Jessie. I updated my Jessie install, maintenance i'd say :)
Still no stretch..

It's 5.23

This is the service file relevant part:

ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/usr/bin/sdptool add SP
ExecStartPost=/usr/bin/rfcomm bind rfcomm0 20:15:12:04:3$
ExecStartPost=/usr/bin/rfcomm bind rfcomm1 00:15:83:00:7$

Is this OK?
Then Ive always use the rfcomm0 port with python, but this stopped working with last update ;(

PS: until yesterday, it was working without the -C param and the add SP line..
Sadly i updated the system from an android SSH client while i'm on the seaside, it's a pain to debug it from here LOL

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

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 4:48 pm

The -C flag wasn't needed in BlueZ 4, it's needed in 5. My only guess is that the rfcomm commands are trying to run too early, before the SPP gets set up. Can you try running them from the command line? Also what does this say? 'systemctl status bluetooth'

Also also, the bdaddrs look odd. I didn't know you could use $s.

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 5:17 pm

The error OS noto something about the lack of the rfcomm porta, it's something happening in the communication over the port.
The bind commando cant be run since the address is already in use.
The bluetooth service seems also ok
So, i cant underatand ;)
Ill try fixing this next week when ill be back home.. In the meantime thanks for your help ;)
Btw i think the last update was something related to firmware, noto bluez, so probably its something deeper..

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 19, 2017 5:23 pm

OK, so stupid..
The update simply deleted alla the trusted and paired devices
Had to trust and pair it again with bluetoothctl..
Happy ;)

(Working without -C and without the SP add)

asavah
Posts: 307
Joined: Thu Aug 14, 2014 12:49 am

Re: STICKY: Bluetooth not working after update - need info

Tue Aug 22, 2017 7:24 pm

Massi wrote:
Sat Aug 19, 2017 5:23 pm
The update simply deleted alla the trusted and paired devices
No, it did not,the updated firmware seems to have a bug with BT MAC address.
Bluez stack saves it's pairing/trust data as /var/lib/blueetooth/AA:BB:CC:DD:EE:FF ,
Due to this bug all of us with updated firmware will have 43:43:A1:12:1F:AC as bt mac,
and due to this bluez will not use previously saved data.
The old data is still there.

See https://github.com/raspberrypi/firmware/issues/860

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

Re: STICKY: Bluetooth not working after update - need info

Tue Aug 22, 2017 7:36 pm

Thanks for pointing that out asavah. I can confirm the same Bluetooth device address.

Yotaphoner
Posts: 22
Joined: Fri Jun 09, 2017 3:11 pm

Re: STICKY: Bluetooth not working after update - need info

Wed Aug 23, 2017 12:57 pm

Hi. My bluetooth problm is of another kind, but I think this is the best place to post it.

My bluetooth connection is good, but my probems are with two different bluetooth keyboards, which work perfectly with many of other devices and systems. The prblem is connection is lost after only 15 sec of non pressing any key, and then sometimes it's hard to reconnect. With the other keboard the problem is when I press Bloq Mayus It stops working, and I have toait an undefinied time.. And I repat, both keyboards works perfectly under ubuntu and and and android devices.

I tried if doing a apt-get dist-upgrade solve something, but nothing happend.

Maybe if someone knows about a program to send bluetooth keep alive packets It will solve the problem with one of my keyboards.

An idea_ Thanks

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1434
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: STICKY: Bluetooth not working after update - need info

Wed Aug 23, 2017 3:15 pm

From my answer on GitHub:
The new Bluetooth firmware seems to be ignoring the MAC address programmed into its OTP - the address you have now is a default for that chip (4343 A1 ...). Fortunately there is a way to set a MAC address using hciattach. Here is a modified version of the /usr/bin/btuart script that should set the MAC address correctly.

If you want to try it, download it to the home directory of user pi and:

Code: Select all

sudo mv /usr/bin/btuart{,.orig}
sudo cp ~pi/btuart /usr/bin/btuart
sudo reboot
To return to the shipping version, which I recommend before updating the pi-bluetooth package, run:

Code: Select all

sudo mv /usr/bin/btuart{.orig,}

Massi
Posts: 1647
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: STICKY: Bluetooth not working after update - need info

Wed Aug 23, 2017 4:27 pm

asavah wrote:
Tue Aug 22, 2017 7:24 pm
Massi wrote:
Sat Aug 19, 2017 5:23 pm
The update simply deleted alla the trusted and paired devices
No, it did not,the updated firmware seems to have a bug with BT MAC address.
Bluez stack saves it's pairing/trust data as /var/lib/blueetooth/AA:BB:CC:DD:EE:FF ,
Due to this bug all of us with updated firmware will have 43:43:A1:12:1F:AC as bt mac,
and due to this bluez will not use previously saved data.
The old data is still there.

See https://github.com/raspberrypi/firmware/issues/860
Wow, thanks! I only saw the effect, you explained the source ;)

Yotaphoner
Posts: 22
Joined: Fri Jun 09, 2017 3:11 pm

Re: STICKY: Bluetooth not working after update - need info

Sat Aug 26, 2017 4:11 pm

Hi. My bluetooth problm is of another kind, but I think this is the best place to post it.

My bluetooth connection is good, but my probems are with two different bluetooth keyboards, which work perfectly with many of other devices and systems. The prblem is connection is lost after only 15 sec of non pressing any key, and then sometimes it's hard to reconnect. With the other keboard the problem is when I press Bloq Mayus It stops working, and I have toait an undefinied time.. And I repat, both keyboards works perfectly under ubuntu and and and android devices.

I tried if doing a apt-get dist-upgrade solve something, but nothing happend.

Maybe if someone knows about a program to send bluetooth keep alive packets It will solve the problem with one of my keyboards.

Any idea? Thanks
Some could say something about that? For example if are you using a bluetooth keyboard without any issues, or may beabout theexistence of the program I am requesting for?

Thanks!!

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 21 guests