New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 629773 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

bluetooth: Can't connect to BBC micro:bit BLE device

Project Member Reported by fbeaufort@chromium.org, Jul 20 2016

Issue description

Google Chrome	53.0.2785.13 (Official Build) dev (64-bit)
Revision	f88481b907e2fff8fd02eaf4043e66d86ff7bfb9-refs/branch-heads/2785@{#70}
Platform	8530.11.0 (Official Build) dev-channel link

What steps will reproduce the problem?
(1) Go to Chrome OS Settings / Bluetooth
(2) Click "Add a device" button, search for your BBC micro:bit BLE device waiting to be paired
(3) Select it and click "Connect" button

What is the expected output?
Pairing process for BBC micro:bit BLE device should start.

What do you see instead?
An error. See screenshots below.

Here are helpful btmon logs:

@ Discovering: 0x00 (7)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7                            [hci0] 311.882239
        Type: Passive (0x00)
        Interval: 60.000 msec (0x0060)
        Window: 30.000 msec (0x0030)
        Own address type: Public (0x00)
        Filter policy: Ignore not in white list (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                           [hci0] 311.882737
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                [hci0] 311.882796
        Scanning: Enabled (0x01)
        Filter duplicates: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                                           [hci0] 311.883740
      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 38                                             [hci0] 312.507822
      LE Advertising Report (0x02)
        Num reports: 1
        Event type: Connectable undirected - ADV_IND (0x00)
        Address type: Random (0x01)
        Address: DA:01:DB:0B:60:C6 (Static)
        Data length: 26
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        Name (complete): BBC micro:bit [vagap]
        RSSI: -85 dBm (0xab)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2                                [hci0] 312.507937
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4                                           [hci0] 312.508778
      LE Set Scan Enable (0x08|0x000c) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Create Connection (0x08|0x000d) plen 25                             [hci0] 312.508873
        Scan interval: 60.000 msec (0x0060)
        Scan window: 60.000 msec (0x0060)
        Filter policy: White list is not used (0x00)
        Peer address type: Random (0x01)
        Peer address: DA:01:DB:0B:60:C6 (Static)
        Own address type: Public (0x00)
        Min connection interval: 50.00 msec (0x0028)
        Max connection interval: 70.00 msec (0x0038)
        Connection latency: 0x0000
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                                             [hci0] 312.509746
      LE Create Connection (0x08|0x000d) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19                                             [hci0] 313.540725
      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 32
        Role: Master (0x00)
        Peer address type: Random (0x01)
        Peer address: DA:01:DB:0B:60:C6 (Static)
        Connection interval: 67.50 msec (0x0036)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Master clock accuracy: 0x00
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2                      [hci0] 313.540881
        Handle: 32
@ Device Connected: DA:01:DB:0B:60:C6 (2) flags 0x0000
        02 01 06 16 09 42 42 43 20 6d 69 63 72 6f 3a 62  .....BBC micro:b
        69 74 20 5b 76 61 67 61 70 5d                    it [vagap]      
> HCI Event: Command Status (0x0f) plen 4                                             [hci0] 313.541727
      LE Read Remote Used Features (0x08|0x0016) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                                             [hci0] 313.889786
      LE Read Remote Used Features (0x04)
        Status: Success (0x00)
        Handle: 32
        Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
< ACL Data TX: Handle 32 flags 0x00 dlen 11                                           [hci0] 313.889864
      SMP: Pairing Request (0x01) len 6
        IO capability: KeyboardDisplay (0x04)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d)
        Max encryption key size: 16
        Initiator key distribution: EncKey Sign LinkKey (0x0d)
        Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
= bluetoothd: No cache for DA:01:DB:0B:60:C6                                                 313.900219
< ACL Data TX: Handle 32 flags 0x00 dlen 7                                            [hci0] 313.900180
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517
> ACL Data RX: Handle 32 flags 0x02 dlen 11                                           [hci0] 314.293776
      SMP: Pairing Response (0x02) len 6
        IO capability: DisplayOnly (0x00)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, MITM, Legacy, No Keypresses (0x05)
        Max encryption key size: 16
        Initiator key distribution: <none> (0x00)
        Responder key distribution: EncKey IdKey (0x03)
> HCI Event: Number of Completed Packets (0x13) plen 5                                [hci0] 314.293810
        Num handles: 1
        Handle: 32
        Count: 1
@ User Passkey Request: DA:01:DB:0B:60:C6 (2)
> HCI Event: Number of Completed Packets (0x13) plen 5                                [hci0] 314.294734
        Num handles: 1
        Handle: 32
        Count: 1
> ACL Data RX: Handle 32 flags 0x02 dlen 7                                            [hci0] 314.698140
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 23
< ACL Data TX: Handle 32 flags 0x00 dlen 11                                           [hci0] 314.698530
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                [hci0] 314.833763
        Num handles: 1
        Handle: 32
        Count: 1
> ACL Data RX: Handle 32 flags 0x02 dlen 18                                           [hci0] 315.103264
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0007
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0008-0x000b
        UUID: Generic Attribute Profile (0x1801)
< ACL Data TX: Handle 32 flags 0x00 dlen 11                                           [hci0] 315.103561
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000c-0xffff
        Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 32 flags 0x02 dlen 26                                           [hci0] 315.508821
      ATT: Read By Group Type Response (0x11) len 21
        Attribute data length: 20
        Attribute group list: 1 entry
        Handle range: 0x000c-0x000e
        UUID: Unknown (e95d93b0-251d-470a-a062-fa1922dfa9a8)
> HCI Event: Number of Completed Packets (0x13) plen 5                                [hci0] 315.508854
        Num handles: 1
        Handle: 32
        Count: 1
< ACL Data TX: Handle 32 flags 0x00 dlen 11                                           [hci0] 315.509226
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000f-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Vendor (0xff) plen 7                                                     [hci0] 315.981812
        82 12 95 40 10 36 59                             ...@.6Y         
> HCI Event: Disconnect Complete (0x05) plen 4                                        [hci0] 315.982749
        Status: Success (0x00)
        Handle: 32
        Reason: Connection Timeout (0x08)
@ Device Disconnected: DA:01:DB:0B:60:C6 (2) reason 1
 
Screenshot 2016-07-20 at 11.19.55 AM.png
110 KB View Download
Screenshot 2016-07-20 at 11.19.59 AM.png
89.2 KB View Download
Screenshot 2016-07-20 at 11.20.05 AM.png
85.0 KB View Download
For info, it works great on Android. See screenshot attached.
Screenshot_20160720-103913.png
116 KB View Download

Comment 2 by mcchou@chromium.org, Jul 20 2016

Cc: josephsih@chromium.org
Weirdly enough, sometimes, I do get the passkey prompt as shown attached but it simply disappears before I can actually enter a passkey. I'm not sure why...
Screenshot 2016-07-20 at 11.48.36 AM.png
69.0 KB View Download
For info, here's what says https://github.com/lancaster-university/microbit-docs/blob/82a2aca45ce3317e7f901903e8fac7667e208987/docs/ble/profile.md#bluetooth-security:


micro:bit uses standard Bluetooth security. Bluetooth defines a series of optional security features of which the following are used for micro:bit:

1. Pairing with passkey and MITM protection

2. White Listing

3. Encrypted link for operations involving most characteristics

Comment 5 by mcchou@chromium.org, Jul 20 2016

After having a discussion with josephsih@, we find the suspicion in the last part btmon logs in issue summary,

> HCI Event: Number of Completed Packets (0x13) plen 5                                [hci0] 315.508854
        Num handles: 1
        Handle: 32
        Count: 1
< ACL Data TX: Handle 32 flags 0x00 dlen 11                                           [hci0] 315.509226
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000f-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Vendor (0xff) plen 7                                                     [hci0] 315.981812
        82 12 95 40 10 36 59                             ...@.6Y         
> HCI Event: Disconnect Complete (0x05) plen 4                                        [hci0] 315.982749
        Status: Success (0x00)
        Handle: 32
        Reason: Connection Timeout (0x08)

The time difference between the outgoing packet and the disconnection packet is 472.586 ms, which is greater than the agreed supervision timeout(420 ms), so it's likely that host decided to disconnect from the peripheral which is considered out-of-range. And we saw the similar issue on PocketLab(http://www.thepocketlab.com/). To see if this is the cause, I will upload a test patch to change the supervision timeout to 2 seconds where pairing should be more stable.

Note that we recently find that the failure rate of pairing is about 3~5% which comes from 1000 tests in the isolated chamber, and we will have further investigation to improve the pairing. 
Do you want a trace of Android?

Comment 7 by mcchou@google.com, Jul 21 2016

Android supervision timeout can be a clue of our assumption.
Project Member

Comment 8 by sheriffbot@chromium.org, Jul 21 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Assigned (was: Untriaged)
Status: Fixed (was: Assigned)
The supervision timeout has been changed to 2 seconds (https://chromium-review.googlesource.com/441506).
Status: Verified (was: Fixed)

Sign in to add a comment