Closed agherzan closed 3 years ago
Please use an nRF sniffer to capture the air traffic, and attach the logs for analysis.
I've ordered one now but I think @idlethread might be able to provide some logs in the meanwhile. Thanks, @cvinayak.
@agherzan if you have a spare nRF51DK, nRF51 Dongle, nRF52DK, nRF52840DK, or nRF52840 Dongle, you can use them as nRF sniffer.
Sadly I don't at this point but I'll get one shipped soon. I've ordered it yesterday. That being said, I think we have one in the team so we might be able to provide logs soon. We will update as soon as we have something.
Setup is as follows:
nRF52832-DK
(sniffer)
|
Nitrogen (v1.1) ------------------------- Linux Laptop
(peripheral_hr) (bluetoothctl,
scan on,
connect <mac>)
Nitrogen zephyr log shows:
*** Booting Zephyr OS build v2.5.0-rc4 ***
Bluetooth initialized
Advertising successfully started
[00:00:00.394,897] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.394,927] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.394,927] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.5 Build 0
[00:00:00.395,538] <inf> bt_hci_core: Identity: C5:AE:65:1D:0B:45 (random)
[00:00:00.395,568] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
[00:00:00.395,568] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
Connected
Disconnected (reason 0x08)
btmon logs from the Linux Central are as follows:
@ MGMT Event: Device Connected (0x000b) plen 24 {0x0001} [hci0] 22.163996
LE Address: C5:AE:65:1D:0B:45 (Static)
Flags: 0x00000000
Data length: 11
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported
16-bit Service UUIDs (complete): 3 entries
Heart Rate (0x180d)
Battery Service (0x180f)
Device Information (0x180a)
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 #30 [hci0] 22.164216
Handle: 3585
> HCI Event: Command Status (0x0f) plen 4 #31 [hci0] 22.164812
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12 #32 [hci0] 22.581889
LE Read Remote Used Features (0x04)
Status: Connection Timeout (0x08)
Handle: 3585
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> HCI Event: Disconnect Complete (0x05) plen 4 #33 [hci0] 22.582808
Status: Success (0x00)
Handle: 3585
Reason: Connection Timeout (0x08)
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0002} [hci0] 22.600792
LE Address: C5:AE:65:1D:0B:45 (Static)
Reason: Connection timeout (0x01)
@ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 22.600792
LE Address: C5:AE:65:1D:0B:45 (Static)
Reason: Connection timeout (0x01)
@ MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 27.575266
Address type: 0x07
BR/EDR
LE Public
LE Random
< HCI Command: LE Set Random Address (0x08|0x0005) plen 6 #34 [hci0] 27.575362
Address: 31:C7:22:EE:87:EC (Non-Resolvable)
> HCI Event: Command Complete (0x0e) plen 4 #35 [hci0] 27.689754
LE Set Random Address (0x08|0x0005) ncmd 1
Status: Success (0x00)
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7 #36 [hci0] 27.689848
Type: Active (0x01)
Interval: 22.500 msec (0x0024)
Window: 11.250 msec (0x0012)
Own address type: Random (0x01)
Filter policy: Accept all advertisement (0x00)
Another piece of information: All the laptops that had problems connecting to Nitrogen peripheral were running Intel chipsets.
nRF sniffer logs are here (just remove .zip extension): v1.1-board-zephyr-2.5-rc4-samsung-laptop.pcapng.zip
The supervision timeout happens at the central as it thinks it is not receiving responses from the peripheral. Clearly, the sniffer can see the responses.
@agherzan and @idlethread any updates ? is this still a zephyr issue?
Closing this due to reporter inactivity. Feel free to reopen if this is still an issue.
We tracked this down to intel bluetooth controllers (and firmware) on the host PC as being the common reason for failures. We haven't yet spent time trying to run the latest bluetooth stack on those hosts to see if it made the problem go away. That is still pending on us.
We saw no issues with a different controller.
Describe the bug
Connection often fails when running samples/bluetooth/peripheral_hr on Nitrogen96 (nRF52) and trying to connect to it from another device.
To Reproduce
Steps to reproduce the behaviour:
peripheral_hr
for Nitrogen96 (I used the Yocto build system for this but it was reproducible using the west build system too)bluez5
(bluetoothctl
)Expected behaviour
The application should always connect logging:
Impact
Product instability.
Logs and console output
Failing while connecting with bluez5 (5.55) from a Linux machine:
Failing when connecting from an Android (10) device:
On IOS (14) it always connects and the expected behaviour is consistent:
I also tried bumping the supervisor timeout configuration to 20s on the Linux host:
Environment (please complete the following information):
Additional context
Capturing the transfer with Wireshark, I could see that it always fails on Sub Event: LE Read Remote Features Complete (0x04) with one of the following reasons:
Even if the supervisor time is bumped to 20s (on the Linux side), there are situations where it fails with a timeout after 20s.
Every time it succeeds connecting, it does in 300-400ms. See an example of a successful connection above (iOS).