* [Bluez-devel] Problem with link keys
@ 2005-08-06 3:01 John Gruenenfelder
2005-08-06 4:10 ` Marcel Holtmann
0 siblings, 1 reply; 6+ messages in thread
From: John Gruenenfelder @ 2005-08-06 3:01 UTC (permalink / raw)
To: bluez-devel
My previous problems getting my headset to work were due to stale link keys.
After deleting the old one, I could make a new pairing. The problem is that
the *new* link key becomes useless as soon as I turn off the headset.
The procedure is something like this:
1) Turn on headset
2) Pair with PC
3) Enter PIN when asked
4) headset works fine
5) shut off headset
6) turn headset back on
7) hcitool commands targeted at the headset all fail with "input/output error"
now.
8) Delete existing link key
9) Go back to step 2
Why does the link key go bad as soon as I power cycle the headset? The
hcidump output from step 6 is:
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> 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: Role Change (0x12) plen 8
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: Connect Complete (0x03) plen 11
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> 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: Role Change (0x12) plen 8
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: Connect Complete (0x03) plen 11
I do not see any "reply negative" messages in any of the hcidump output yet it
doesn't work until I make a new key.
Am I doing something wrong or in the wrong order? This is with the current
bluez packages from Debian unstable (amd64 port).
--
--John Gruenenfelder Research Assistant, Steward Observatory, U of Arizona
johng@as.arizona.edu
Try Weasel Reader for PalmOS -- http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Problem with link keys
2005-08-06 3:01 [Bluez-devel] Problem with link keys John Gruenenfelder
@ 2005-08-06 4:10 ` Marcel Holtmann
2005-08-06 5:01 ` John Gruenenfelder
0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2005-08-06 4:10 UTC (permalink / raw)
To: bluez-devel
Hi John,
> My previous problems getting my headset to work were due to stale link keys.
> After deleting the old one, I could make a new pairing. The problem is that
> the *new* link key becomes useless as soon as I turn off the headset.
>
> The procedure is something like this:
> 1) Turn on headset
> 2) Pair with PC
> 3) Enter PIN when asked
> 4) headset works fine
> 5) shut off headset
> 6) turn headset back on
> 7) hcitool commands targeted at the headset all fail with "input/output error"
> now.
> 8) Delete existing link key
> 9) Go back to step 2
>
> Why does the link key go bad as soon as I power cycle the headset? The
> hcidump output from step 6 is:
>
> > HCI Event: Connect Request (0x04) plen 10
> < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> > 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: Role Change (0x12) plen 8
> > HCI Event: Command Complete (0x0e) plen 10
> > HCI Event: Connect Complete (0x03) plen 11
> > HCI Event: Connect Request (0x04) plen 10
> < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
> > 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: Role Change (0x12) plen 8
> > HCI Event: Command Complete (0x0e) plen 10
> > HCI Event: Connect Complete (0x03) plen 11
>
> I do not see any "reply negative" messages in any of the hcidump output yet it
> doesn't work until I make a new key.
use "hcidump -X -V".
> Am I doing something wrong or in the wrong order? This is with the current
> bluez packages from Debian unstable (amd64 port).
Is the link key valid if you don't power cycle your headset, but
disconnect and then reconnect? If yes, then your headset is maybe
broken.
Regards
Marcel
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Problem with link keys
2005-08-06 4:10 ` Marcel Holtmann
@ 2005-08-06 5:01 ` John Gruenenfelder
2005-08-06 5:07 ` Marcel Holtmann
0 siblings, 1 reply; 6+ messages in thread
From: John Gruenenfelder @ 2005-08-06 5:01 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
On Sat, Aug 06, 2005 at 06:10:55AM +0200, Marcel Holtmann wrote:
>>
>> I do not see any "reply negative" messages in any of the hcidump output yet it
>> doesn't work until I make a new key.
>
>use "hcidump -X -V".
The -V helps a lot. I have attached a short hcidump listing from when I power
on the headset and it attempts to make a connection and fails.
>> Am I doing something wrong or in the wrong order? This is with the current
>> bluez packages from Debian unstable (amd64 port).
>
>Is the link key valid if you don't power cycle your headset, but
>disconnect and then reconnect? If yes, then your headset is maybe
>broken.
Yes. I was able to do the following:
hcitool cc bdaddr
hcitool dc bdaddr
hcitool cc bdaddr
hcitool info bdaddr
And it is working just fine. It only seems to misbehave when I power it off.
Are any other people on this list using a Plantronics M2500 headset and, if
so, are you experiencing anything similar?
--
--John Gruenenfelder Research Assistant, Steward Observatory, U of Arizona
johng@as.arizona.edu
Try Weasel Reader for PalmOS -- http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max
[-- Attachment #2: connect_attempt.log --]
[-- Type: text/plain, Size: 3752 bytes --]
HCI sniffer - Bluetooth packet analyzer ver 1.23
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
> HCI Event: Connect Request (0x04) plen 10
bdaddr 00:03:89:6E:C9:11 class 0x20040c type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Status (0x0f) plen 4
Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
bdaddr 00:03:89:6E:C9:11
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
bdaddr 00:03:89:6E:C9:11 key EB66D91F1F03B1531043A4E00E5F0199
> HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Complete (0x0e) plen 10
Link Key Request Reply (0x01|0x000b) ncmd 1
status 0x00 bdaddr 00:03:89:6E:C9:11
> HCI Event: Connect Complete (0x03) plen 11
status 0x05 handle 41 bdaddr 00:03:89:6E:C9:11 type ACL encrypt 0x00
Error: Authentication Failure
> HCI Event: Connect Request (0x04) plen 10
bdaddr 00:03:89:6E:C9:11 class 0x20040c type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Status (0x0f) plen 4
Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
bdaddr 00:03:89:6E:C9:11
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
bdaddr 00:03:89:6E:C9:11 key EB66D91F1F03B1531043A4E00E5F0199
> HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Complete (0x0e) plen 10
Link Key Request Reply (0x01|0x000b) ncmd 1
status 0x00 bdaddr 00:03:89:6E:C9:11
> HCI Event: Connect Complete (0x03) plen 11
status 0x05 handle 42 bdaddr 00:03:89:6E:C9:11 type ACL encrypt 0x00
Error: Authentication Failure
> HCI Event: Connect Request (0x04) plen 10
bdaddr 00:03:89:6E:C9:11 class 0x20040c type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Status (0x0f) plen 4
Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
bdaddr 00:03:89:6E:C9:11
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
bdaddr 00:03:89:6E:C9:11 key EB66D91F1F03B1531043A4E00E5F0199
> HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Complete (0x0e) plen 10
Link Key Request Reply (0x01|0x000b) ncmd 1
status 0x00 bdaddr 00:03:89:6E:C9:11
> HCI Event: Connect Complete (0x03) plen 11
status 0x05 handle 43 bdaddr 00:03:89:6E:C9:11 type ACL encrypt 0x00
Error: Authentication Failure
> HCI Event: Connect Request (0x04) plen 10
bdaddr 00:03:89:6E:C9:11 class 0x20040c type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Status (0x0f) plen 4
Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
bdaddr 00:03:89:6E:C9:11
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
bdaddr 00:03:89:6E:C9:11 key EB66D91F1F03B1531043A4E00E5F0199
> HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 00:03:89:6E:C9:11 role 0x00
Role: Master
> HCI Event: Command Complete (0x0e) plen 10
Link Key Request Reply (0x01|0x000b) ncmd 1
status 0x00 bdaddr 00:03:89:6E:C9:11
> HCI Event: Connect Complete (0x03) plen 11
status 0x05 handle 44 bdaddr 00:03:89:6E:C9:11 type ACL encrypt 0x00
Error: Authentication Failure
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Problem with link keys
2005-08-06 5:01 ` John Gruenenfelder
@ 2005-08-06 5:07 ` Marcel Holtmann
2005-08-06 9:07 ` John Gruenenfelder
0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2005-08-06 5:07 UTC (permalink / raw)
To: bluez-devel
Hi John,
> >> I do not see any "reply negative" messages in any of the hcidump output yet it
> >> doesn't work until I make a new key.
> >
> >use "hcidump -X -V".
>
> The -V helps a lot. I have attached a short hcidump listing from when I power
> on the headset and it attempts to make a connection and fails.
>
> >> Am I doing something wrong or in the wrong order? This is with the current
> >> bluez packages from Debian unstable (amd64 port).
> >
> >Is the link key valid if you don't power cycle your headset, but
> >disconnect and then reconnect? If yes, then your headset is maybe
> >broken.
>
> Yes. I was able to do the following:
>
> hcitool cc bdaddr
> hcitool dc bdaddr
> hcitool cc bdaddr
> hcitool info bdaddr
>
> And it is working just fine. It only seems to misbehave when I power it off.
> Are any other people on this list using a Plantronics M2500 headset and, if
> so, are you experiencing anything similar?
I see always a authentication failure in your log. This means you never
succeeded with your command or you send the wrong log. However the usage
of "hcitool cc ..." doesn't qualifies for a correct headset/handsfree
profile setup and thus your headset may forget your link key. Use tools
like hstest of btsco and try again.
Regards
Marcel
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Problem with link keys
2005-08-06 5:07 ` Marcel Holtmann
@ 2005-08-06 9:07 ` John Gruenenfelder
2005-08-10 14:14 ` Alexandros Vellis
0 siblings, 1 reply; 6+ messages in thread
From: John Gruenenfelder @ 2005-08-06 9:07 UTC (permalink / raw)
To: bluez-devel
On Sat, Aug 06, 2005 at 07:07:53AM +0200, Marcel Holtmann wrote:
>> And it is working just fine. It only seems to misbehave when I power it off.
>> Are any other people on this list using a Plantronics M2500 headset and, if
>> so, are you experiencing anything similar?
>
>I see always a authentication failure in your log. This means you never
>succeeded with your command or you send the wrong log. However the usage
>of "hcitool cc ..." doesn't qualifies for a correct headset/handsfree
>profile setup and thus your headset may forget your link key. Use tools
>like hstest of btsco and try again.
>
>Regards
>
>Marcel
Ah yes, that was it exactly. It's now working very well, even after powering
on and off.
Now that it is working reliably, I just have two more minor questions about
btsco:
1) Is there any way to have btsco started when I turn on the headset? hcid
sees this event, but I did not see anything in the hcid.conf manpage for
launching processes.
2) btsco allows for creating a .btsco file with regex in it so that you can
make it do something on a button press. How do I learn what those regex
should be for my particular headset? Is it part of one of the packets
dumped by hcidump?
Thanks again for all the help!
--
--John Gruenenfelder Research Assistant, Steward Observatory, U of Arizona
johng@as.arizona.edu
Try Weasel Reader for PalmOS -- http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Problem with link keys
2005-08-06 9:07 ` John Gruenenfelder
@ 2005-08-10 14:14 ` Alexandros Vellis
0 siblings, 0 replies; 6+ messages in thread
From: Alexandros Vellis @ 2005-08-10 14:14 UTC (permalink / raw)
To: bluez-devel
John Gruenenfelder wrote:
> 2) btsco allows for creating a .btsco file with regex in it so that you can
> make it do something on a button press. How do I learn what those regex
> should be for my particular headset? Is it part of one of the packets
> dumped by hcidump?
If I'm not mistaken, you can watch what is communicated with the headset
with 'btsco -v'.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-08-10 14:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-06 3:01 [Bluez-devel] Problem with link keys John Gruenenfelder
2005-08-06 4:10 ` Marcel Holtmann
2005-08-06 5:01 ` John Gruenenfelder
2005-08-06 5:07 ` Marcel Holtmann
2005-08-06 9:07 ` John Gruenenfelder
2005-08-10 14:14 ` Alexandros Vellis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox