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

Re: Raspberry Pi 3 Bluetooth Setup

Fri Mar 18, 2016 9:57 pm

No, pretty sure blueman is the only thing you need to add to the last few distros, and only if you want the GUI interface.

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: Raspberry Pi 3 Bluetooth Setup

Fri Mar 18, 2016 10:17 pm

Douglas6 wrote:No, pretty sure blueman is the only thing you need to add to the last few distros, and only if you want the GUI interface.
I think you're right. I don't think blueman is entirely stable yet though, I had a nightmare trying to pair with it and ended up using the bluetoothctl approach a few posts back.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

ijzervreter
Posts: 1
Joined: Sat Mar 19, 2016 11:19 am

Re: Raspberry Pi 3 Bluetooth Setup

Sat Mar 19, 2016 11:30 am

The instruction post by silenced » Fri Mar 04, 2016 7:46 pm worked for me on both a r-pi3 and r-pi2. The r-pi2 with a very old (MyCom) bluetooth dongle attached.
I did use the 2016-02-26-raspbian-jessie image.
Before I tried it on my r-pi2 with the 2016-02-09-raspbian-jessie.img and

Code: Select all

install bluetooth bluez blueman
but that wouldn't get it working.
A bit double, but this got it working for me:
• sudo bluetoothctl
• agent on
• default-agent
make the keyboard discoverable
• scan on
wait... see your device listed, copy the device id
• pair xx:xx:xx:xx:xx (device id)
(if asked for a "PIN code" -> enter that "PIN code" on your bluetooth keyboard and press ENTER on the bluetooth keyboard)
• trust xx:xx:xx:xx:xx (if not asked for a pin code this may work too)
• connect xx:xx:xx:xx:xx

dp35
Posts: 5
Joined: Fri Mar 18, 2016 3:53 am

Re: Raspberry Pi 3 Bluetooth Setup

Mon Mar 21, 2016 4:09 am

I'm new to the world of RPi's. I just bought two RPi 3's. I can't get bluetooth to work on either of them. I've read every post on this thread and tried every suggested solution. I've also reformatted SD cards and started over with a new download of NOOBS, and also a new download of Jessie without using NOOBS. Everything leads to the same problem.

My symptoms are: the Pi seems to connect to a device (phone, speaker, or keyboard) but then within a few seconds it looses the connection and then won't attempt it again, unless that device is removed and then treated as new again.

I'm sure the problem is explained in the following code. But I have no idea how to correct it.

Code: Select all

[email protected]:~ $ sudo service bluetooth status
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Mon 2016-03-21 03:17:32 UTC; 39min ago
     Docs: man:bluetoothd(8)
 Main PID: 685 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─685 /usr/lib/bluetooth/bluetoothd

Mar 21 03:17:32 raspberrypi bluetoothd[685]: Bluetooth daemon 5.23
Mar 21 03:17:32 raspberrypi systemd[1]: Started Bluetooth service.
Mar 21 03:17:32 raspberrypi bluetoothd[685]: Starting SDP server
Mar 21 03:17:32 raspberrypi bluetoothd[685]: Bluetooth management interface 1.9 initialized
Mar 21 03:17:32 raspberrypi bluetoothd[685]: Sap driver initialization failed.
Mar 21 03:17:32 raspberrypi bluetoothd[685]: sap-server: Operation not permitted (1)
Mar 21 03:23:43 raspberrypi bluetoothd[685]: Timed out waiting for reply from agent
Mar 21 03:24:28 raspberrypi bluetoothd[685]: Failed requesting authentication
Mar 21 03:24:28 raspberrypi bluetoothd[685]: device_confirm_passkey: Device or resource busy
Mar 21 03:24:45 raspberrypi bluetoothd[685]: Failed requesting authentication
Mar 21 03:24:45 raspberrypi bluetoothd[685]: device_confirm_passkey: Device or resource busy
Mar 21 03:27:12 raspberrypi bluetoothd[685]: Failed requesting authentication
Mar 21 03:27:12 raspberrypi bluetoothd[685]: device_confirm_passkey: Device or resource busy
Mar 21 03:52:59 raspberrypi bluetoothd[685]: a2dp-sink profile connect failed for 8C:DE:52:AA:4C:D6: Protocol not available

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

Re: Raspberry Pi 3 Bluetooth Setup

Mon Mar 21, 2016 4:36 am

From a command line, open

Code: Select all

bluetoothctl
For each 'NEW' device (not controller) listed, do

Code: Select all

info <bdaddr>
If the device is paired but not trusted, trust it

Code: Select all

trust <bdaddr>
If the device is not paired, pair it by first turning on a pairing agent

Code: Select all

agent on
, make the device discoverable (see the instructions of the device), and then

Code: Select all

pair <bdaddr>
Enter the PIN code (see the instructions of the device), or verify the pass code. Then trust it as above. If a device is not listed turn on scanning

Code: Select all

scan on
wait for the device to be found, and then pair and trust it (as above). For keyboards or speakers, then connect

Code: Select all

connect <bdaddr>
For speakers, you'll also need to install and configure PulseAudio and the PA Bluetooth modules. For a phone it won't connect, you'll need to connect from the phone, but you'll need to perform additional steps on the Pi, depending on what you want to do from the phone.

dp35
Posts: 5
Joined: Fri Mar 18, 2016 3:53 am

Re: Raspberry Pi 3 Bluetooth Setup

Tue Mar 22, 2016 2:40 am

@Douglas6,
Thanks for trying to help. I tried everything you suggested, except the PulseAudio & PA Bluetooth modules. Please let me know if you think they'll help this situation. I'm still stuck in the same place. It starts to pair and then fails, and then won't try again.

Running "sudo service bluetooth status" still reveals several errors. I'm sure this is the root of the problem, but don't know how to correct it.

Just in case, I also tried downloading NOOBS from scratch again, this time on a different PC. Same result.

I'm all out of ideas. Any help much appreciated.

liuxieric123
Posts: 6
Joined: Mon Mar 21, 2016 3:51 pm

Re: Raspberry Pi 3 Bluetooth Setup

Sat Mar 26, 2016 2:40 pm

Hi, I want control my pi3 through bluetooth, but I failed to do that. I can connect Pi3 through bluetooth on the android phone use the blue-term, but I can't send command to Pi3, I just get what I input in the blue-term.

How can I to solve this problem?

Thanks!

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

Re: Raspberry Pi 3 Bluetooth Setup

Sat Mar 26, 2016 2:52 pm

Are you successfully connecting with BlueTerm? Are you running microcom or something else to read the /dev/rfcomm0 device on the Pi?

dp35
Posts: 5
Joined: Fri Mar 18, 2016 3:53 am

Re: Raspberry Pi 3 Bluetooth Setup

Tue Mar 29, 2016 4:08 am

Stuck with the same problems & no solutions, I ordered a new SD card from MCM pre-loaded with NOOBS. Same result. Typing "sudo service bluetooth status" still reveals error messages, which currently read:

Code: Select all

Mar 29 03:55:58 raspberrypi bluetoothd[697]: Sap driver initialization failed.
Mar 29 03:55:58 raspberrypi bluetoothd[697]: sap-server: Operation not permitted (1)
 
Apparently no one on this forum is able to solve this. Can anyone point me in the right direction to take this to the next step?

Thanks.

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

Re: Raspberry Pi 3 Bluetooth Setup

Tue Mar 29, 2016 4:27 am

Two suggestions, take the one that appeals best to you:
1. Ignore those informational messages. There is no earthly reason to have an SAP server running on the Pi.
2. Add the '--noplugin=sap' flag to the ExecStart= line in bluetooth.service. That will prevent BlueZ from trying to start the SAP server, and give you a message to that effect. Pointless, but I guess it makes some people feel better.

User avatar
6502
Posts: 23
Joined: Wed May 30, 2012 5:55 am

Re: Raspberry Pi 3 Bluetooth Setup

Sun Apr 03, 2016 8:32 am

I've also followed the isntructions above, but cannot get my keyboard to pair properly.
After "scan on" I see the device ID show up along with the comment "legacy pairing: yes" - no idea what that means.

Then I type "pair" followed by my keyboard device ID and I get the message "device not available".

If I then retype "scan on " I get "Failed to start discovery: org.bluez.Error.InProgress".

Any ideas what to try next?

I know that my keyboard works as I can pair it and use it with my Android phone, so there is something not right with the bluetooth setup on the pi which seems to be affecting several people.

bphick
Posts: 2
Joined: Thu Apr 07, 2016 3:41 pm

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 07, 2016 7:29 pm

Silenced:

• sudo bluetoothctl
• agent on
• default-agent
• scan on
• pair xx:xx:xx:xx:xx (device id)

(if asked for a "PIN code" -> enter that "PIN code" on your bluetooth keyboard and press ENTER on the bluetooth keyboard)

• trust xx:xx:xx:xx:xx (if not asked for a pin code this may work too)

Worked totally well for me and my new Pi 3 ... Thanks all contributors! Using a cheapy - 1byOne bluetooth keyboard.
• connect xx:xx:xx:xx:xx

danuselli
Posts: 3
Joined: Fri Apr 08, 2016 7:11 am

Re: Raspberry Pi 3 Bluetooth Setup

Fri Apr 08, 2016 7:59 am

Hi guys!

Im pretty new in pi and generaly not at the freshest status at linux so i would need your help do have my pi3 controlled by my multidevice keybord(Logitech K810) and mouse(Logitech Anywhere MX2).

I updated distri and firmware yesterday

Code: Select all

[email protected]:~ $ uname -a
Linux raspberrypi 4.1.21-v7+ #872 SMP Wed Apr 6 17:34:14 BST 2016 armv7l GNU/Linux
[email protected]:~ $ dmesg |grep Blue
[   13.217917] Bluetooth: Core ver 2.20
[   13.217986] Bluetooth: HCI device and connection manager initialized
[   13.218417] Bluetooth: HCI socket layer initialized
[   13.218429] Bluetooth: L2CAP socket layer initialized
[   13.219122] Bluetooth: SCO socket layer initialized
[   13.240888] Bluetooth: HCI UART driver ver 2.3
[   13.240905] Bluetooth: HCI UART protocol H4 registered
[   13.240910] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   13.240915] Bluetooth: HCI UART protocol BCM registered
[   13.569385] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   13.569398] Bluetooth: BNEP filters: protocol multicast
[   13.569413] Bluetooth: BNEP socket layer initialized
[   16.352874] Bluetooth: RFCOMM TTY layer initialized
[   16.352897] Bluetooth: RFCOMM socket layer initialized
[   16.352916] Bluetooth: RFCOMM ver 1.11
[email protected]:~ $ systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Fr 2016-04-08 09:42:33 CEST; 4min 19s ago
     Docs: man:bluetoothd(8)
 Main PID: 738 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─738 /usr/lib/bluetooth/bluetoothd
So bluetooth is on and agent is running, ready for the search, the info and try to connect:

Code: Select all

[email protected]:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:E2:88:3C raspberrypi [default]
[NEW] Device 00:1F:20:EA:B7:7C Logitech K810
[NEW] Device EF:D5:AA:9E:3F:5A MX Anywhere 2
[bluetooth]# info 00:1F:20:EA:B7:7C 
Device 00:1F:20:EA:B7:7C
	Name: Logitech K810
	Alias: Logitech K810
	Class: 0x002540
	Icon: input-keyboard
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v046DpB319d1202
[bluetooth]# connect 00:1F:20:EA:B7:7C 
Attempting to connect to 00:1F:20:EA:B7:7C
Failed to connect: org.bluez.Error.Failed
[bluetooth]# info EF:D5:AA:9E:3F:5A 
Device EF:D5:AA:9E:3F:5A
	Name: MX Anywhere 2
	Alias: MX Anywhere 2
	Appearance: 0x03c2
	Icon: input-mouse
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: yes
	LegacyPairing: no
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
	UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
	UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
	Modalias: usb:v046DpB013d0007


Facts are:
The Mouse is paired, trusted and connected, but doesnt work, the GUI device manager only knows it as "unknown device type"
The keyboard is paired, trusted and refuse the connection

Have u any ideas whats wrong ?

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

Re: Raspberry Pi 3 Bluetooth Setup

Fri Apr 08, 2016 2:32 pm

A useful debugging tool is hcidump.

Code: Select all

sudo apt-get install bluez-hcidump 
Run 'sudo hcidump' in a second terminal window while trying to connect, and see what it says.

danuselli
Posts: 3
Joined: Fri Apr 08, 2016 7:11 am

Re: Raspberry Pi 3 Bluetooth Setup

Mon Apr 11, 2016 7:07 am

When connect sucessfull to Anywhere MX2

Code: Select all

> HCI Event: LE Meta Event (0x3e) plen 38
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr EF:D5:AA:9E:3F:5A (Random)
      Flags: 0x05
      Unknown type 0x19 with 2 bytes data
      Complete service classes: 0x1812
      Complete local name: 'MX Anywhere 2'
      RSSI: -37
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x00 (scanning disabled)
    filter duplicates 0x00 (disabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
< HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr EF:D5:AA:9E:3F:5A type 1
    interval 96 window 48 initiator_filter 0
    own_bdaddr_type 0 min_interval 6 max_interval 9
    latency 44 supervision_to 216 min_ce 0 max_ce 0
> HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
> HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 64, role master
      bdaddr EF:D5:AA:9E:3F:5A (Random)
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2
> HCI Event: Command Status (0x0f) plen 4
    LE Read Remote Used Features (0x08|0x0016) status 0x00 ncmd 1
> HCI Event: LE Meta Event (0x3e) plen 12
    LE Read Remote Used Features Complete
      status 0x00 handle 64
      Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x000c, end 0x001a
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x000d, value 0x02 0x0e 0x00 0x29 0x2a 
        handle 0x000f, value 0x02 0x10 0x00 0x24 0x2a 
        handle 0x0011, value 0x02 0x12 0x00 0x25 0x2a 
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: MTU req (0x02)
      client rx mtu 672
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 7
    ATT: MTU resp (0x03)
      server rx mtu 23
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x001f, end 0x003e
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0020, value 0x02 0x21 0x00 0x4a 0x2a 
        handle 0x0022, value 0x12 0x23 0x00 0x22 0x2a 
        handle 0x0025, value 0x0e 0x26 0x00 0x32 0x2a 
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0012, end 0x001a
      type-uuid 0x2803
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0013, value 0x02 0x14 0x00 0x27 0x2a 
        handle 0x0015, value 0x02 0x16 0x00 0x26 0x2a 
        handle 0x0017, value 0x02 0x18 0x00 0x28 0x2a 
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0026, end 0x003e
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0027, value 0x12 0x28 0x00 0x33 0x2a 
        handle 0x002a, value 0x02 0x2b 0x00 0x4b 0x2a 
        handle 0x002c, value 0x12 0x2d 0x00 0x4d 0x2a 
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0018, end 0x001a
      type-uuid 0x2803
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 13
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0019, value 0x02 0x1a 0x00 0x50 0x2a 
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x002d, end 0x003e
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0030, value 0x12 0x31 0x00 0x4d 0x2a 
        handle 0x0034, value 0x12 0x35 0x00 0x4d 0x2a 
        handle 0x0038, value 0x0e 0x39 0x00 0x4d 0x2a 
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x001a
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 12
    ATT: Read resp (0x0b)
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0039, end 0x003e
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 20
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x003b, value 0x04 0x3c 0x00 0x4c 0x2a 
        handle 0x003d, value 0x06 0x3e 0x00 0x4e 0x2a 
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x002b
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x002b
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Find Information req (0x04)
      start 0x002e, end 0x002f
> ACL data: handle 64 flags 0x02 dlen 14
    ATT: Find Information resp (0x05)
      format: uuid-16
        handle 0x002e, uuid 0x2902 (GATT(desc) Client Characteristic Configuration)
        handle 0x002f, uuid 0x2908 (Unknown)
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Find Information req (0x04)
      start 0x0032, end 0x0033
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 14
    ATT: Find Information resp (0x05)
      format: uuid-16
        handle 0x0032, uuid 0x2902 (GATT(desc) Client Characteristic Configuration)
        handle 0x0033, uuid 0x2908 (Unknown)
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Find Information req (0x04)
      start 0x0036, end 0x0037
> ACL data: handle 64 flags 0x02 dlen 14
    ATT: Find Information resp (0x05)
      format: uuid-16
        handle 0x0036, uuid 0x2902 (GATT(desc) Client Characteristic Configuration)
        handle 0x0037, uuid 0x2908 (Unknown)
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Find Information req (0x04)
      start 0x003a, end 0x003a
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 10
    ATT: Find Information resp (0x05)
      format: uuid-16
        handle 0x003a, uuid 0x2908 (Unknown)
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x003e
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x003e
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x0021
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x0021
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Write req (0x12)
      handle 0x002e value  0x01 0x00
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Write req (0x12) on handle 0x002e
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x002f
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x002f
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Write req (0x12)
      handle 0x0032 value  0x01 0x00
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Write req (0x12) on handle 0x0032
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x0033
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x0033
< ACL data: handle 64 flags 0x00 dlen 9
    ATT: Write req (0x12)
      handle 0x0036 value  0x01 0x00
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Write req (0x12) on handle 0x0036
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x0037
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x0037
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x003a
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Insufficient authentication (5)
      Read req (0x0a) on handle 0x003a
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Group req (0x10)
      start 0x0001, end 0xffff
      type-uuid 0x2800
> ACL data: handle 64 flags 0x02 dlen 24
    ATT: Read By Group resp (0x11)
      attr handle 0x0001, end group handle 0x0007
      value 0x00 0x18
      attr handle 0x0008, end group handle 0x000b
      value 0x01 0x18
      attr handle 0x000c, end group handle 0x001a
      value 0x0a 0x18
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Group req (0x10)
      start 0x001b, end 0xffff
      type-uuid 0x2800
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 18
    ATT: Read By Group resp (0x11)
      attr handle 0x001b, end group handle 0x001e
      value 0x0f 0x18
      attr handle 0x001f, end group handle 0x003e
      value 0x12 0x18
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Group req (0x10)
      start 0x003f, end 0xffff
      type-uuid 0x2800
> ACL data: handle 64 flags 0x02 dlen 26
    ATT: Read By Group resp (0x11)
      attr handle 0x003f, end group handle 0xffff
      value 0x6d 0x04 0x00 0x20 0x1f 0x01 0x00 0x80 0x00 0x10 0x00 0x00 0x00 0x00 0x01 0x00
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0001, end 0x0007
      type-uuid 0x2802
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Attribute not found (10)
      Read By Type req (0x08) on handle 0x0001
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0008, end 0x000b
      type-uuid 0x2802
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Attribute not found (10)
      Read By Type req (0x08) on handle 0x0008
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x000c, end 0x001a
      type-uuid 0x2802
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Attribute not found (10)
      Read By Type req (0x08) on handle 0x000c
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x001b, end 0x001e
      type-uuid 0x2802
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Attribute not found (10)
      Read By Type req (0x08) on handle 0x001b
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x001f, end 0x003e
      type-uuid 0x2802
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Attribute not found (10)
      Read By Type req (0x08) on handle 0x001f
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x003f, end 0xffff
      type-uuid 0x2802
> ACL data: handle 64 flags 0x02 dlen 9
    ATT: Error (0x01)
      Error: Attribute not found (10)
      Read By Type req (0x08) on handle 0x003f
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
And that happens while try to connect to the Keyboard

Code: Select all

< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:1F:20:EA:B7:7C ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 
> HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x0f handle 12 bdaddr 00:1F:20:EA:B7:7C type ACL encrypt 0x00
    Error: Connection Rejected due to Unacceptable BD_ADDR

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

Re: Raspberry Pi 3 Bluetooth Setup

Mon Apr 11, 2016 4:15 pm

Error: Connection Rejected due to Unacceptable BD_ADDR
Looks like a bad bdaddr, to me. In bluetoothctl, what does the 'devices' command show?

danuselli
Posts: 3
Joined: Fri Apr 08, 2016 7:11 am

Re: Raspberry Pi 3 Bluetooth Setup

Wed Apr 13, 2016 7:44 am

Yes Douglas6, that is clear from the replay. Question is why the Keyboard has this bad bdaddress and why Anywhere MX2 Mouse is not working

devices displays:

Code: Select all

[bluetooth]# devices
Device 00:1F:20:EA:B7:7C Logitech K810
Device EF:D5:AA:9E:3F:5A MX Anywhere 2
So we get info about keyboard and try to connect and get the dump

Code: Select all

[bluetooth]# info 00:1F:20:EA:B7:7C 
Device 00:1F:20:EA:B7:7C
	Name: Logitech K810
	Alias: Logitech K810
	Class: 0x002540
	Icon: input-keyboard
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v046DpB319d1202

[bluetooth]# connect 00:1F:20:EA:B7:7C 
Attempting to connect to 00:1F:20:EA:B7:7C
[CHG] Device 00:1F:20:EA:B7:7C Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:1F:20:EA:B7:7C Connected: no


[email protected]:~ $ sudo hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:1F:20:EA:B7:7C ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 
> HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 12 bdaddr 00:1F:20:EA:B7:7C type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 12
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 12
    Features: 0xbc 0x04 0x82 0x78 0x00 0x06 0x59 0x83
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
    enable 0
> HCI Event: Command Complete (0x0e) plen 4
    Write Scan Enable (0x03|0x001a) ncmd 1
    status 0x00
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 12 page 1
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 12 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:1F:20:EA:B7:7C mode 2 clkoffset 0x0000
> HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:1F:20:EA:B7:7C name 'Logitech K810'
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 12
> HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:1F:20:EA:B7:7C
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:1F:20:EA:B7:7C key 20A6C3C47E43CB8C311C280D2614FCDD
> HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:1F:20:EA:B7:7C
< HCI Command: Read RSSI (0x05|0x0005) plen 2
    handle 12
> HCI Event: Command Complete (0x0e) plen 7
    Read RSSI (0x05|0x0005) ncmd 1
    status 0x00 handle 12 rssi 0
< HCI Command: Read Link Quality (0x05|0x0003) plen 2
    handle 12
> HCI Event: Command Complete (0x0e) plen 7
    Read Link Quality (0x05|0x0003) ncmd 1
    status 0x00 handle 12 lq 255
< HCI Command: Read Transmit Power Level (0x03|0x002d) plen 3
    handle 12 type 0 (current)
> HCI Event: Command Complete (0x0e) plen 7
    Read Transmit Power Level (0x03|0x002d) ncmd 1
    status 0x00 handle 12 level 4
> HCI Event: Auth Complete (0x06) plen 3
    status 0x06 handle 12
    Error: PIN or Key Missing
< HCI Command: Read Clock Offset (0x01|0x001f) plen 2
    handle 12
> HCI Event: Command Status (0x0f) plen 4
    Read Clock Offset (0x01|0x001f) status 0x00 ncmd 1
< HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 12 reason 0x13
    Reason: Remote User Terminated Connection
> HCI Event: Command Status (0x0f) plen 4
    Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 12 reason 0x16
    Reason: Connection Terminated by Local Host
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
    enable 2
> HCI Event: Command Complete (0x0e) plen 4
    Write Scan Enable (0x03|0x001a) ncmd 1
    status 0x00
And this is connect to Anywhere MX2 wich also is not recogniced:

Code: Select all

[bluetooth]# connect EF:D5:AA:9E:3F:5A 
Attempting to connect to EF:D5:AA:9E:3F:5A
Connection successful
This happens witout any dump,.... after pressing connect button on Mouse this happens & reading info :

Code: Select all

[CHG] Device EF:D5:AA:9E:3F:5A Connected: no
[CHG] Device EF:D5:AA:9E:3F:5A Connected: yes
[bluetooth]# info EF:D5:AA:9E:3F:5A 
Device EF:D5:AA:9E:3F:5A
	Name: MX Anywhere 2
	Alias: MX Anywhere 2
	Appearance: 0x03c2
	Icon: input-mouse
	Paired: no
	Trusted: yes
	Blocked: no
	Connected: yes
	LegacyPairing: no
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
	UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
	UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
	Modalias: usb:v046DpB013d0007
And dump replays:

Code: Select all

[email protected]:~ $ sudo hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 64 reason 0x13
    Reason: Remote User Terminated Connection
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
    type 0x00 (passive)
    interval 60.000ms window 30.000ms
    own address: 0x00 (Public) policy: white list only
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x01 (scanning enabled)
    filter duplicates 0x01 (enabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
> HCI Event: LE Meta Event (0x3e) plen 38
    LE Advertising Report
      ADV_IND - Connectable undirected advertising (0)
      bdaddr EF:D5:AA:9E:3F:5A (Random)
      Flags: 0x05
      Unknown type 0x19 with 2 bytes data
      Complete service classes: 0x1812
      Complete local name: 'MX Anywhere 2'
      RSSI: -58
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
    value 0x00 (scanning disabled)
    filter duplicates 0x00 (disabled)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
< HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr EF:D5:AA:9E:3F:5A type 1
    interval 96 window 48 initiator_filter 0
    own_bdaddr_type 0 min_interval 6 max_interval 9
    latency 44 supervision_to 216 min_ce 0 max_ce 0
> HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
> HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 64, role master
      bdaddr EF:D5:AA:9E:3F:5A (Random)
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2
> HCI Event: Command Status (0x0f) plen 4
    LE Read Remote Used Features (0x08|0x0016) status 0x00 ncmd 1
> HCI Event: LE Meta Event (0x3e) plen 12
    LE Read Remote Used Features Complete
      status 0x00 handle 64
      Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x000c, end 0x001a
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x000d, value 0x02 0x0e 0x00 0x29 0x2a 
        handle 0x000f, value 0x02 0x10 0x00 0x24 0x2a 
        handle 0x0011, value 0x02 0x12 0x00 0x25 0x2a 
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: MTU req (0x02)
      client rx mtu 672
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 7
    ATT: MTU resp (0x03)
      server rx mtu 23
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0012, end 0x001a
      type-uuid 0x2803
> ACL data: handle 64 flags 0x02 dlen 27
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0013, value 0x02 0x14 0x00 0x27 0x2a 
        handle 0x0015, value 0x02 0x16 0x00 0x26 0x2a 
        handle 0x0017, value 0x02 0x18 0x00 0x28 0x2a 
< ACL data: handle 64 flags 0x00 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0018, end 0x001a
      type-uuid 0x2803
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 2
> ACL data: handle 64 flags 0x02 dlen 13
    ATT: Read By Type resp (0x09)
      length: 7
        handle 0x0019, value 0x02 0x1a 0x00 0x50 0x2a 
< ACL data: handle 64 flags 0x00 dlen 7
    ATT: Read req (0x0a)
      handle 0x001a
> ACL data: handle 64 flags 0x02 dlen 12
    ATT: Read resp (0x0b)
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
so Mouse connects but is not useable, and keyboard has bad bdaddres

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

Re: Raspberry Pi 3 Bluetooth Setup

Wed Apr 13, 2016 2:18 pm

Well, the MX Anywhere 2 mouse is a BLE ('Bluetooth Smart') device. I suspect that won't work with the onboard adapter, or a regular 4.0 dongle. Have you tried it with the 'unifying receiver' plugged in to a USB port?
[EDIT: You COULD try running the Bluetooth daemon in 'experimental' mode. That adds some BLE services, I'm not sure if HID is one of them, or if it will work.]

I don't know about the keyboard. It get's a fair way into the connection process, before the Pi sends a disconnect:
< HCI Command: Disconnect (0x01|0x0006) plen 3
handle 12 reason 0x13
Reason: Remote User Terminated Connection
There's something about it that BlueZ doesn't like, I guess.

atomickarma
Posts: 6
Joined: Thu Apr 14, 2016 1:57 pm

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 2:01 pm

Hi - having endless problems with BT (and Wi-Fi, but that's another story!)

if i use sudo service bluetooth status I get loaded and active (running)

However, if I attempt anything in bluetoothctl I always run into "No default controller available". the GUI tool, meanwhile, doesn't detect any BT device on the RPi3.

Utterly confused. Any suggestions?

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

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 3:11 pm

Is it a Pi3? If not, do you have a USB Bluetooth dongle plugged in? Are you running the latest Raspbian? What does 'hciconfig -a' show?

mastermushi
Posts: 37
Joined: Thu Apr 07, 2016 8:47 am

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 6:35 pm

Picking up with the bluetooth issue

What I did:
sudo apt-get install bluetooth bluez blueman

What I have got.....
hcitool dev shows NO devices

dmesg | grep Blue results with

Code: Select all

[   31.700444] Bluetooth: Core ver 2.20
[   31.700508] Bluetooth: HCI device and connection manager initialized
[   31.700525] Bluetooth: HCI socket layer initialized
[   31.700536] Bluetooth: L2CAP socket layer initialized
[   31.700566] Bluetooth: SCO socket layer initialized
[   31.719583] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   31.719597] Bluetooth: BNEP filters: protocol multicast
[   31.719612] Bluetooth: BNEP socket layer initialized
[   32.576077] Bluetooth: RFCOMM TTY layer initialized
[   32.576107] Bluetooth: RFCOMM socket layer initialized
[   32.576124] Bluetooth: RFCOMM ver 1.11
systemctl status bluetooth results with

Code: Select all

 
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Thu 2016-04-14 20:14:37 CEST; 9min ago
     Docs: man:bluetoothd(8)
 Main PID: 969 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─969 /usr/lib/bluetooth/bluetoothd
What could be wrong?

P.S. I did not remap BT UART in config
But I used
force_turbo=1
core_freq=250

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

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 6:52 pm

Have you recently done

Code: Select all

sudo apt-get update
sudo apt-get upgrade

mastermushi
Posts: 37
Joined: Thu Apr 07, 2016 8:47 am

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 6:56 pm

Yes I did

atomickarma
Posts: 6
Joined: Thu Apr 14, 2016 1:57 pm

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 6:59 pm

Douglas6 wrote:Is it a Pi3? If not, do you have a USB Bluetooth dongle plugged in? Are you running the latest Raspbian? What does 'hciconfig -a' show?
Hi Douglas6.

Raspberry Pi3. Latest Raspbian. Have run through every update command (sudo apt-get update, sudo apt-get upgrade -y, sudo apt-get dist-upgrade -y, sudo rpi-update) on Raspbian Jessie.

hciconfig commands return no result, and hciconfig -a is no different.

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

Re: Raspberry Pi 3 Bluetooth Setup

Thu Apr 14, 2016 7:11 pm

If a new Raspbian install (don't rpi-update) on a Pi3 shows nothing for hciconfig, I can only assume a faulty Pi3. Is the onboard Wifi working?

Return to “Troubleshooting”