Bug 466988 - Trouble pairing with Apple Wireless Pro Keyboard (bluetooth)
Trouble pairing with Apple Wireless Pro Keyboard (bluetooth)
Product: Fedora
Classification: Fedora
Component: bluez-gnome (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bastien Nocera
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-10-14 17:47 EDT by Will Woods
Modified: 2008-10-28 07:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-10-28 07:24:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Will Woods 2008-10-14 17:47:06 EDT
I'm having a problem pairing with an Apple Wireless Keyboard. The wizard says "Connecting to $device now ..." and hangs there. 

If I press Return on the keyboard (or type a random PIN and press Return), the "
Please enter the following PIN code: 0000" prompt appears and then immediately is replaced by "Pairing with $device failed."

Now, if I type the PIN 0000 and press Return, the "Please enter the following PIN code: 0000" prompt appears again, but this time the wizard successfully pairs with the device.

This is vaguely similar to Bug 464446.

[root@kraid ~]# sdptool browse 00:0A:95:3E:67:79
Browsing 00:0A:95:3E:67:79 ...
Service Name: Apple Wireless Keyboard
Service Description: Apple Wireless Keyboard
Service Provider: Apple Computer, Inc.
Service RecHandle: 0x10000
Service Class ID List:
  "Human Interface Device" (0x1124)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 17
  "HIDP" (0x0011)
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Human Interface Device" (0x1124)
    Version: 0x0100

[root@kraid ~]# hcitool info 00:0A:95:3E:67:79
Requesting information ...
	BD Address:  00:0A:95:3E:67:79
	OUI Company: Apple Computer, Inc. (00-0A-95)
	Device Name: timp’s keyboard
	LMP Version: 1.1 (0x1) LMP Subversion: 0x7b00
	Manufacturer: Broadcom Corporation (15)
	Features: 0xbc 0x02 0x04 0x00 0x08 0x00 0x00 0x00
		<encryption> <slot offset> <timing accuracy> <role switch> 
		<sniff mode> <RSSI> <power control> <AFH cap. slave> 

[root@kraid ~]# sdptool search --bdaddr 00:0A:95:3E:67:79 SP
Searching for SP on 00:0A:95:3E:67:79 ...

[root@kraid ~]#
Comment 1 Bastien Nocera 2008-10-14 18:52:55 EDT
I believe the problem is that we set the PIN to be 0000 for that device, thinking it's an Apple mouse. If that's the case, this build should fix the problem:

If that doesn't work, I'm getting one such keyboard some time this week hopefully...
Comment 2 Will Woods 2008-10-17 01:09:24 EDT
We discussed on IRC, but for the record - That build doesn't help. The main problem is that the "Please enter the following PIN code: XXXX" prompt doesn't seem to happen until we can connect to the keyboard. 

Except it seems that bluetooth keyboards - unlike headsets or mice or phones - are not connectable until *after* you type a PIN on them. 

So with that new build, the Bluetooth Wizard generates a random PIN, but it doesn't show it until the keyboard is connectable - which happens *after* you've typed in a PIN on the keyboard. So unless you guess the PIN before it is shown, the authentication request will always fail.

I guess the sequence could go something like:

1) generate random PIN
2) tell user to type that PIN (and Return) on the keyboard, and click Forward when done
3) authenticate/pair with now-ready keyboard, using PIN from step 1

but maybe you can figure out something simpler once you've got some hardware to play with.
Comment 3 Bastien Nocera 2008-10-23 05:02:00 EDT
Received the hardware for it, should have something tomorrow.
Comment 4 Bastien Nocera 2008-10-23 19:01:20 EDT
It's testy, but there's no bugs in the wizard or anywhere on the Linux side. It's just that the device is so badly documented (it came without a single piece of documentation for me) that it doesn't surprise me you had trouble getting it working.

I had to remove the batteries for it to allow me to pair again. Leave the power button pressed until the LED was blinking, selected it in the wizard, entered the pin code as requested followed by enter (not sure that's needed?), and there it was paired. I closed the wizard using the newly paired keyboard...

The one thing I can do is add documentation for that keyboard...

Could you please retest?
Comment 5 Bastien Nocera 2008-10-24 06:29:07 EDT
The battery removal as well as pressing the Return key are definitely needed, this is what the Apple support docs mention:

I'll start putting together documentation on the Fedora wiki.

Removing from the F10 desktop target.
Comment 6 Bastien Nocera 2008-10-28 07:24:54 EDT

Note You need to log in before you can comment on or make changes to this bug.