# Permission problems, Bluetooth Headset

## conchyliferous

Hi,

got a problem when trying to connect my Bluetooth headset (it's a Plantronics 2500) with Linux.

I followed the guide in this thread when pairing the device to the computer:

https://forums.gentoo.org/viewtopic-t-194183.html

I follow this guide but with the PIN set to '0000' since that the PIN of the headset. (according to the manual)

```
echo "0000" > /etc/bluetooth/pin
```

With 'hcitool scan' I get:

```
Scanning ...

        00:03:89:B7:E5:F7       M2500 by Plantronics
```

And with 'hcitool inq' I get:

```
Inquiring ...

        00:03:89:B7:E5:F7       clock offset: 0x623f    class: 0x200404
```

So far so good. But now I get problems.

'l2ping 00:03:89:B7:E5:F7' returns this:

```
Can't connect: Permission denied
```

  :Shocked: 

That ain't too good. I saved a hcidump for the l2ping and here it comes:

```
< HCI Command: Create Connection (0x01|0x0005) plen 13

> HCI Event: Command Status (0x0f) plen 4

> HCI Event: Link Key Request (0x17) plen 6

< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22

> HCI Event: Command Complete (0x0e) plen 10

> HCI Event: Connect Complete (0x03) plen 11
```

Another thing I noticed was this. In the guide the 'hciconfig -a' command returned the following output:

```
hci0:   Type: USB

        BD Address: 00:10:60:A3:CB:41 ACL MTU: 192:8 SCO MTU: 64:8

        UP RUNNING PSCAN ISCAN AUTH ENCRYPT

        RX bytes:125 acl:0 sco:0 events:17 errors:0

        TX bytes:565 acl:0 sco:0 commands:17 errors:0

        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: RSWITCH HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

        Name: 'BlueZ at bluehat (0)'

        Class: 0x3e0100

        Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio

        Device Class: Computer, Uncategorized

        HCI Ver: 1.1 (0x1) HCI Rev: 0x1e7 LMP Ver: 1.1 (0x1) LMP Subver: 0x1e7

        Manufacturer: Cambridge Silicon Radio (10) 
```

Mine returned this:

```
hci0:   Type: USB

        BD Address: 00:0A:3A:51:BF:D7 ACL MTU: 192:8 SCO MTU: 64:8

        UP RUNNING AUTH ENCRYPT 

        RX bytes:9060 acl:271 sco:0 events:332 errors:0

        TX bytes:5093 acl:235 sco:0 commands:51 errors:0

        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 

        Link policy: RSWITCH HOLD SNIFF PARK 

        Link mode: SLAVE ACCEPT 

        Name: 'BlueZ at turtlepond (0)'

        Class: 0x3e0100

        Service Classes: Networking, Rendering, Capturing

        Device Class: Computer, Uncategorized

        HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d

        Manufacturer: Cambridge Silicon Radio (10)
```

There are some differences here. I'm thinking about PSCAN ISCAN and the service classes (mainly 'audio' since I got a headset). First I thought there was problems reading the hcid.conf file. But then I noticed that the 'Name' output was the one I set in that file. But still, might this be a problem?

This problem is really annoying and I would be happy if I got some help! Not even google can save me here...

----------

## conchyliferous

I posted this a while back but never got any help. I later made a total reinstall of my system and forgot about Bluetooth. But now I was about to setup my headset again but got exactly the same problem while pairing the devices.

Since I got more understanding now when it comes to Bluetooth I made this in a more simple way this time.  :Cool:   Thats why I was able to rewrite the problem in a much more simple way.

Hope that makes it easier for people to help me out.

----------

## nirax

having the same problem and cant find any help in forums etc.

there was in another thread the hint to delete the link_key

in /etc/bluetooth but this will have no effect for me.

----------

## nirax

ok i got it. 

because the link key changed for whatever reason i had to delete the device under

/var/lib/bluetooth

than it was pairing correctly and works again.

other ppl sugested to delete link_key in /etc/bluetooth, but that tip didnt worked for me.

ADD:

actually i notice that for some reason i always have to re-pair the devices.

my work-around is to delete at "btstart" script (which bases on hotheads script, see his bluetooth headset guide) with rm -r /var/lib/bluetooth/     the linkkey headset and usbbluetooth adapter agreed on.

in /etc/bluetooth/hcid.conf i than use

pin_helper /etc/bluetooth/pin-helper;

instead of kbluepin, because pin-helper will send my default pin for the headset automatically to the headset without user-intraction.

the file /etc/bluetooth/pin 

has to contain in my case "0000" (without the: ")

----------

