2015-09-15 03:32:34

by Elliot Saba

[permalink] [raw]
Subject: Re: Understanding connecting to BLE keyboard

Hello all, thank you for your responses so far.

First off, I had not tried entering the PIN, because nothing had
prompted me to do so. I have intermittently managed to get a PIN
prompt to show up in bluetoothctl now that I am using "agent
KeyboardDisplay" instead of "agent KeyboardOnly", thanks to Szymon's
advice. However, although it now sometimes prompts me for a PIN code,
other times it doesn't, and I still get "authentication canceled"
errors extremely quickly (less than a second) after attempting to
pair. Here is an example session, with both bluetoothctl and btmon
output: https://gist.github.com/staticfloat/bbc016376ba5a8ab4451

Secondly, what manual do you refer to? I am having a difficult time
finding bluez documentation, so if there is a bluez manual somewhere,
I'd love to read it. If you refer to the manual for my keyboard,
sadly its manual says nothing about Linux. I can pair it on other
operating systems such as OSX without difficulty (and yes, it requires
entry of a PIN) so I am confident I know the proper method to pair it
with a device.

Thanks!
-E


2015-09-21 18:26:27

by Elliot Saba

[permalink] [raw]
Subject: Re: Understanding connecting to BLE keyboard

Hey guys, just wanted to follow up with this and state that I bought a
Kinivo BTD-400 adapter, and things are now working excellently. Thank
you all for your help.
-E

2015-09-15 08:05:09

by Szymon Janc

[permalink] [raw]
Subject: Re: Understanding connecting to BLE keyboard

Hi,

On Tuesday 15 of September 2015 00:37:04 Elliot Saba wrote:
> I cannot seem to make it prompt me for a PIN anymore; the only thing
> it does is fail immediately with the error code given above. I have
> successfully connected it and disconnected it from my OSX and Windows
> laptops, so I do not believe it is an issue of having another device
> paired with it; no matter what combination of agents or command
> sequences I use, I am always just getting AuthenticationCanceled
> errors immediately after my machine attempts to pair. I'm not sure
> how I got the PIN entry code earlier, I'm guessing it was some kind of
> race condition, especially considering that even though I managed to
> get a PIN code entry prompt I got an authentication failure less than
> a second after that prompt came up.
>
> Is there any other kind of debugging that I could perform for you guys?
> -E

This looks like Link Layer issue not host issue. From spec:
"2.59 CONNECTION FAILED TO BE ESTABLISHED (0x3E)
The Connection Failed to be Established error code indicates that the LL
initiated a connection but the connection has failed to be established."

Could you check if this issue exists with different BT adapter? You could also
check if there is updated firmware available for you BT chip.


> On Mon, Sep 14, 2015 at 11:49 PM, Luiz Augusto von Dentz
>
> <[email protected]> wrote:
> > Hi,
> >
> > On Tue, Sep 15, 2015 at 6:32 AM, Elliot Saba <[email protected]>
wrote:
> >> Hello all, thank you for your responses so far.
> >>
> >> First off, I had not tried entering the PIN, because nothing had
> >> prompted me to do so. I have intermittently managed to get a PIN
> >> prompt to show up in bluetoothctl now that I am using "agent
> >> KeyboardDisplay" instead of "agent KeyboardOnly", thanks to Szymon's
> >> advice. However, although it now sometimes prompts me for a PIN code,
> >> other times it doesn't, and I still get "authentication canceled"
> >> errors extremely quickly (less than a second) after attempting to
> >> pair. Here is an example session, with both bluetoothctl and btmon
> >> output: https://gist.github.com/staticfloat/bbc016376ba5a8ab4451
> >>
> >> Secondly, what manual do you refer to? I am having a difficult time
> >> finding bluez documentation, so if there is a bluez manual somewhere,
> >> I'd love to read it. If you refer to the manual for my keyboard,
> >> sadly its manual says nothing about Linux. I can pair it on other
> >> operating systems such as OSX without difficulty (and yes, it requires
> >> entry of a PIN) so I am confident I know the proper method to pair it
> >> with a device.
> >
> > Looks like the remote it disconnecting very early:
> >> HCI Event: Disconnect Complete (0x05) plen 4 [hci0]
> >> 30.737028>>
> > Status: Success (0x00)
> > Handle: 64
> > Reason: Connection Failed to be Established (0x3e)
> >
> > Btw, make sure it is not connecting to any other system since it start
> > advertising perhaps you have to remove any existing link key from
> > other system you have been testing, also you said sometimes it does
> > prompt a pin code but by the logs this was not one of these.
> >
> >
> >
> > --
> > Luiz Augusto von Dentz
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

--
BR
Szymon Janc

2015-09-15 08:00:55

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Understanding connecting to BLE keyboard

Hi Elliot,

On Tue, Sep 15, 2015 at 10:37 AM, Elliot Saba <[email protected]> wrote:
> I cannot seem to make it prompt me for a PIN anymore; the only thing
> it does is fail immediately with the error code given above. I have
> successfully connected it and disconnected it from my OSX and Windows
> laptops, so I do not believe it is an issue of having another device
> paired with it; no matter what combination of agents or command
> sequences I use, I am always just getting AuthenticationCanceled
> errors immediately after my machine attempts to pair. I'm not sure
> how I got the PIN entry code earlier, I'm guessing it was some kind of
> race condition, especially considering that even though I managed to
> get a PIN code entry prompt I got an authentication failure less than
> a second after that prompt came up.
>
> Is there any other kind of debugging that I could perform for you guys?
> -E

No top posting in the list please.

The error Connection Failed to be Established indicate that the
connection has never been completed, so perhaps there is something
wrong with your local adapter, have you tried plugging another
controller?

> On Mon, Sep 14, 2015 at 11:49 PM, Luiz Augusto von Dentz
> <[email protected]> wrote:
>> Hi,
>>
>> On Tue, Sep 15, 2015 at 6:32 AM, Elliot Saba <[email protected]> wrote:
>>> Hello all, thank you for your responses so far.
>>>
>>> First off, I had not tried entering the PIN, because nothing had
>>> prompted me to do so. I have intermittently managed to get a PIN
>>> prompt to show up in bluetoothctl now that I am using "agent
>>> KeyboardDisplay" instead of "agent KeyboardOnly", thanks to Szymon's
>>> advice. However, although it now sometimes prompts me for a PIN code,
>>> other times it doesn't, and I still get "authentication canceled"
>>> errors extremely quickly (less than a second) after attempting to
>>> pair. Here is an example session, with both bluetoothctl and btmon
>>> output: https://gist.github.com/staticfloat/bbc016376ba5a8ab4451
>>>
>>> Secondly, what manual do you refer to? I am having a difficult time
>>> finding bluez documentation, so if there is a bluez manual somewhere,
>>> I'd love to read it. If you refer to the manual for my keyboard,
>>> sadly its manual says nothing about Linux. I can pair it on other
>>> operating systems such as OSX without difficulty (and yes, it requires
>>> entry of a PIN) so I am confident I know the proper method to pair it
>>> with a device.
>>
>>
>> Looks like the remote it disconnecting very early:
>>
>>> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 30.737028
>> Status: Success (0x00)
>> Handle: 64
>> Reason: Connection Failed to be Established (0x3e)
>>
>> Btw, make sure it is not connecting to any other system since it start
>> advertising perhaps you have to remove any existing link key from
>> other system you have been testing, also you said sometimes it does
>> prompt a pin code but by the logs this was not one of these.
>>
>>
>>
>> --
>> Luiz Augusto von Dentz



--
Luiz Augusto von Dentz

2015-09-15 07:37:04

by Elliot Saba

[permalink] [raw]
Subject: Re: Understanding connecting to BLE keyboard

I cannot seem to make it prompt me for a PIN anymore; the only thing
it does is fail immediately with the error code given above. I have
successfully connected it and disconnected it from my OSX and Windows
laptops, so I do not believe it is an issue of having another device
paired with it; no matter what combination of agents or command
sequences I use, I am always just getting AuthenticationCanceled
errors immediately after my machine attempts to pair. I'm not sure
how I got the PIN entry code earlier, I'm guessing it was some kind of
race condition, especially considering that even though I managed to
get a PIN code entry prompt I got an authentication failure less than
a second after that prompt came up.

Is there any other kind of debugging that I could perform for you guys?
-E

On Mon, Sep 14, 2015 at 11:49 PM, Luiz Augusto von Dentz
<[email protected]> wrote:
> Hi,
>
> On Tue, Sep 15, 2015 at 6:32 AM, Elliot Saba <[email protected]> wrote:
>> Hello all, thank you for your responses so far.
>>
>> First off, I had not tried entering the PIN, because nothing had
>> prompted me to do so. I have intermittently managed to get a PIN
>> prompt to show up in bluetoothctl now that I am using "agent
>> KeyboardDisplay" instead of "agent KeyboardOnly", thanks to Szymon's
>> advice. However, although it now sometimes prompts me for a PIN code,
>> other times it doesn't, and I still get "authentication canceled"
>> errors extremely quickly (less than a second) after attempting to
>> pair. Here is an example session, with both bluetoothctl and btmon
>> output: https://gist.github.com/staticfloat/bbc016376ba5a8ab4451
>>
>> Secondly, what manual do you refer to? I am having a difficult time
>> finding bluez documentation, so if there is a bluez manual somewhere,
>> I'd love to read it. If you refer to the manual for my keyboard,
>> sadly its manual says nothing about Linux. I can pair it on other
>> operating systems such as OSX without difficulty (and yes, it requires
>> entry of a PIN) so I am confident I know the proper method to pair it
>> with a device.
>
>
> Looks like the remote it disconnecting very early:
>
>> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 30.737028
> Status: Success (0x00)
> Handle: 64
> Reason: Connection Failed to be Established (0x3e)
>
> Btw, make sure it is not connecting to any other system since it start
> advertising perhaps you have to remove any existing link key from
> other system you have been testing, also you said sometimes it does
> prompt a pin code but by the logs this was not one of these.
>
>
>
> --
> Luiz Augusto von Dentz

2015-09-15 06:49:44

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Understanding connecting to BLE keyboard

Hi,

On Tue, Sep 15, 2015 at 6:32 AM, Elliot Saba <[email protected]> wrote:
> Hello all, thank you for your responses so far.
>
> First off, I had not tried entering the PIN, because nothing had
> prompted me to do so. I have intermittently managed to get a PIN
> prompt to show up in bluetoothctl now that I am using "agent
> KeyboardDisplay" instead of "agent KeyboardOnly", thanks to Szymon's
> advice. However, although it now sometimes prompts me for a PIN code,
> other times it doesn't, and I still get "authentication canceled"
> errors extremely quickly (less than a second) after attempting to
> pair. Here is an example session, with both bluetoothctl and btmon
> output: https://gist.github.com/staticfloat/bbc016376ba5a8ab4451
>
> Secondly, what manual do you refer to? I am having a difficult time
> finding bluez documentation, so if there is a bluez manual somewhere,
> I'd love to read it. If you refer to the manual for my keyboard,
> sadly its manual says nothing about Linux. I can pair it on other
> operating systems such as OSX without difficulty (and yes, it requires
> entry of a PIN) so I am confident I know the proper method to pair it
> with a device.


Looks like the remote it disconnecting very early:

> HCI Event: Disconnect Complete (0x05) plen 4 [hci0] 30.737028
Status: Success (0x00)
Handle: 64
Reason: Connection Failed to be Established (0x3e)

Btw, make sure it is not connecting to any other system since it start
advertising perhaps you have to remove any existing link key from
other system you have been testing, also you said sometimes it does
prompt a pin code but by the logs this was not one of these.



--
Luiz Augusto von Dentz