Background
I'm trying to pair my RasPi with the new Microsoft Universal Foldable Keyboard, which requires BT 4.0 LE HCI connectivity from the host. On my Pi it is provided by CSR based Bluetooth 4.0 dongle. Scanning works, but pairing and connecting don't. What goes wrong?
How things stand currently
I'm running Raspbian on a Pi 2, with the latest raspberrypi-bootloader/kernel allowed by my Adafruit PiTFT (1.20150904-1) and BlueZ 5.34 stack.
hcitool lescan
recognizes the keyboard when it's set in pairing mode.
C4:E0:1E:08:DC:D3 UniversalFoldableKb
C4:E0:1E:08:DC:D3 (unknown)
but when I try the pairing command bluez-simple-agent hci0 C4:E0:1E:08:DC:D3
, while having plain bluez-simple-agent
running in another session on the Pi, it merely states:
Creating device failed: org.bluez.Error.ConnectionAttemptFailed: Page Timeout
At the same time hcidump
gives:
2015-09-19 02:02:31.779409 > HCI Event: Command Status (0x0f) plen 4 Create Connection (0x01|0x0005) status 0x00 ncmd 1
2015-09-19 02:02:36.902080 > HCI Event: Connect Complete (0x03) plen 11
status 0x04 handle 0 bdaddr C4:E0:1E:08:DC:D3 type ACL encrypt 0x00
Error: Page Timeout
My understanding is the bluez-simple-agent
doesn't know that it's supposed to use the HID-over-GATT (LE HID) profile. There might be other factors too, see Other experiments below for secondary indications.
There was a curious message while checking dmesg
Bluetooth: SMP security requested but not available
which might indicate a separate problem with BT devices after updating raspberrypi-bootloader
and kernel from 3.18 to whatever's in the 1.20150904-1 package. I don't know if these things are related.
Other experiments
After a precautionary hcitool hci0 down; hcitool hci0 up
, hcitool leinfo
states Could not create connection: Connection timed out
. hcidump
shows:
2015-09-19 02:14:03.593773 > HCI Event: Command Status (0x0f) plen 4
LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
And apparently something hangs, because now I have to cycle the interface to have anything work again. Same with hcitool lecc
, the connection just times out without any extra information and the interface must be cycled to recover it.
Notes
Please let me know if I've overlooked some log or some other such resource - I will then update my question with the relevant bits.