-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discovery ceasing to deliver results after short time #572
Comments
Additional research: the Start Discovery MGMT Command is repeated / refreshed every 16 seconds. If the scan ceases to deliver, also the refresh is outstanding (not executed) => search for an error condition where the command is not issued. The condition must pre pretty stochastic, some times it works for an hour, Regards dezi grep from btmon log: MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 745.832501 MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 761.831308 MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 777.828046 MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 793.830363 MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 809.830755 MGMT Command: Start Discovery (0x0023) plen 1 {0x0001} [hci0] 825.832062 |
I have observed something similar which is possibly related. I am using a Raspberry Pi Zero W, running Raspbian, on which I have compiled and installed Bluetooth 5.66. I am launching "bluetoothctl scan on > /tmp/btctl.txt" and "btcmon -w /tmp/btmon.log" from a cron job at startup. If I do only that, the bluetoothctl runs fine basically forever. However, if I add in a script which runs gatttool against observed BLE addresses, bluetoothctl will stop working relatively quickly. The process is still running, it just shows a bunch of [DEL] statements at the end of the log, and then never updates ever again. FWIW if I run a 2nd "bluetoothctl scan on" command, the results from that end up logging fo the first process' log, so I know it's still running, it's just the scanning has broken for some reason. I'd appreciate any guidance for what additional info I can provide to help debug this issue. Edit:
Which according to this is a Cypress CYW43438. I would note @dezi's log says they're using an Intel chip. And my btmon log ends with the following:
Perhaps something about connecting to that HP printer is causing a bluetoothctl crash? |
After some additional investigation I've found the following: Status codes:
Normal successful sequence
etc, continuing to discover devices Failing / final sequence:
etc tearing everything down, and never resuming again. Note: the 11:11:11:11:11:11 above was the last attempted-to-connect-to-via-GATT device, which included some characteristics that couldn't be read w/o auth (because I wasn't authed)
And the final btmon log looked like:
Note the "Device Disconnected" event. What I'm seeing right now is that on the Raspberry Pi Zero W, bluetoothd seems to not handle failures gracefully at all. The first time it gets a Is there some setting which perhaps controls whether bluetoothd handles failures gracefully or not? (Note: both the Raspberry Pi and Intel based system are running BlueZ 5.66 compiled from source and |
Can confirm this is 100% reproducible on Raspberry Pi Zero W w/ BlueZ 5.68 manually compiled and installed as well. And I can confirm that per #510, rolling back to an older Raspbian Buster distribution which has a "5.10.103+" kernel allowed my system to scan continuously without error like was happening upon failed connections in the latest Bullseye 6.1.X kernel. (e.g. with the older 5.50 BlueZ). So it seems this is a kernel issue of some sort. |
Looks like a duplicated of #510, try with the following change: bluez/bluetooth-next@52bf4fd |
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
I've also met a similar problem. When I run bluetoothctl scan on and try to connect to one found device in other desktop clients. (For example, add Bluetooth device in plasma's settings, just start pairing but never pair them, waiting for the process to timeout.) All devices are removed according to bluetoothctl's log except for the connecting one. I can only see the connecting one in |
JIRA: https://issues.redhat.com/browse/RHEL-30099 commit 78db544b5d276b70c6ea2c2909ffed96b10229a3 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Wed Sep 6 14:13:35 2023 -0700 Bluetooth: hci_core: Remove le_restart_scan work This removes le_restart_scan work and instead just disables controller duplicate filtering when discovery result_filtering is enabled and HCI_QUIRK_STRICT_DUPLICATE_FILTER is set. Link: bluez/bluez#573 Link: bluez/bluez#572 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: David Marlin <dmarlin@redhat.com>
Hi
bluetoothctl scan ceases to deliver results after a short time.
As You can see from the log, after deleting discovered devices
after the delete timeout period, no new advertisments are
discovered.
The controller is still in scan mode.
The full log, including a btmon dump at the same time:
scratch_108.txt
As You can see from the btmon log at end, the follwing command is issued:
< HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6 #150 [hci0] 58.165001
Extended scan: Disabled (0x00)
Filter duplicates: Disabled (0x00)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)
which finally terminates scanning...
See the following log:
=======================
gen8705:~$ hcitool
hcitool - HCI Tool ver 5.68
=======================
gen8705:~$ hciconfig -a
hci0: Type: Primary Bus: USB
BD Address: 84:1B:77:E2:ED:5B ACL MTU: 1021:4 SCO MTU: 96:6
UP RUNNING
RX bytes:51544278 acl:255 sco:0 events:1090421 errors:0
TX bytes:1215549 acl:242 sco:0 commands:36940 errors:0
Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: PERIPHERAL ACCEPT
Name: 'liesa-gen8705'
Class: 0x6c0104
Service Classes: Rendering, Capturing, Audio, Telephony
Device Class: Computer, Desktop workstation
HCI Version: 5.2 (0xb) Revision: 0x237e
LMP Version: 5.2 (0xb) Subversion: 0x237e
Manufacturer: Intel Corp. (2)
=======================
gen8705:~$ bluetoothctl
Agent registered
[CHG] Controller 84:1B:77:E2:ED:5B Pairable: yes
[bluetooth]# version
Version 5.68
[bluetooth]# scan on
Discovery started
[CHG] Controller 84:1B:77:E2:ED:5B Discovering: yes
[CHG] Device D8:0F:99:31:37:5C RSSI: 0xffffffb4 (-76)
[DEL] Device 76:04:8A:D4:AD:69 76-04-8A-D4-AD-69
[DEL] Device 90:98:77:93:24:F2 Susi's Schlafzimmer
[CHG] Device 08:BF:08:5F:59:93 RSSI: 0xffffffc0 (-64)
[CHG] Device D8:0F:99:31:37:5C RSSI: 0xffffffbf (-65)
[CHG] Device D8:0F:99:31:37:5C TxPower: 0x0007 (7)
[CHG] Device 5D:E1:24:8C:5A:D0 RSSI: 0xffffffc1 (-63)
[CHG] Device 5D:E1:24:8C:5A:D0 TxPower: 0x000c (12)
[CHG] Device 0C:96:E6:27:B7:AC RSSI: 0xffffffac (-84)
[NEW] Device 90:98:77:93:24:F2 Susi's Schlafzimmer
[CHG] Device 0C:96:E6:27:B7:AC TxPower: 0x000a (10)
[NEW] Device FE:F7:54:71:C4:F3 iBKS Plus
[NEW] Device 1C:D6:BE:E3:0B:2A TV
[CHG] Device 90:98:77:93:24:F2 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 90:98:77:93:24:F2 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 90:98:77:93:24:F2 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 90:98:77:93:24:F2 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 90:98:77:93:24:F2 UUIDs: 00000000-0000-0000-0000-000000000000
[NEW] Device 76:04:8A:D4:AD:69 76-04-8A-D4-AD-69
[DEL] Device E4:17:C6:E6:62:A7 iBKS Plus
[NEW] Device ED:EB:1D:74:C3:68 ED-EB-1D-74-C3-68
[NEW] Device E4:17:C6:E6:62:A7 iBKS Plus
[CHG] Device 5D:E1:24:8C:5A:D0 RSSI: 0xffffffb6 (-74)
[CHG] Device 08:BF:08:5F:59:93 RSSI: 0xffffffb6 (-74)
[NEW] Device 84:EB:18:5F:35:AA SANITAS SBF70
[CHG] Device 08:BF:08:5F:59:93 RSSI: 0xffffffae (-82)
[DEL] Device 1C:D6:BE:E3:0B:2A TV
[CHG] Device 5D:E1:24:8C:5A:D0 ManufacturerData Key: 0x004c (76)
[CHG] Device 5D:E1:24:8C:5A:D0 ManufacturerData Value:
10 05 4a 1c c3 1f 65 ..J...e
[CHG] Device FE:F7:54:71:C4:F3 UUIDs: 0000feaa-0000-1000-8000-00805f9b34fb
[CHG] Device FE:F7:54:71:C4:F3 ServiceData Key: 0000feaa-0000-1000-8000-00805f9b34fb
[CHG] Device FE:F7:54:71:C4:F3 ServiceData Value:
10 ef 03 61 63 63 65 6e 74 2d 73 79 73 74 65 6d ...accent-system
73 07 s.
[NEW] Device 1C:D6:BE:E3:0B:2A TV
[DEL] Device 84:EB:18:5F:35:AA SANITAS SBF70
[DEL] Device 08:BF:08:5F:59:93 08-BF-08-5F-59-93
[DEL] Device D8:0F:99:31:37:5C Dezi's Dominator-XL
[DEL] Device 76:04:8A:D4:AD:69 76-04-8A-D4-AD-69
[DEL] Device 5D:E1:24:8C:5A:D0 5D-E1-24-8C-5A-D0
[DEL] Device FE:F7:54:71:C4:F3 iBKS Plus
[DEL] Device 90:98:77:93:24:F2 Susi's Schlafzimmer
[DEL] Device 1C:D6:BE:E3:0B:2A TV
[DEL] Device 0C:96:E6:27:B7:AC Dezi's Gästezimmer groß
[DEL] Device E4:17:C6:E6:62:A7 iBKS Plus
[DEL] Device ED:EB:1D:74:C3:68 ED-EB-1D-74-C3-68
[bluetooth]# scan on
Failed to start discovery: org.bluez.Error.InProgress
[bluetooth]#
=================================
Last few lines from btmon dump:
The text was updated successfully, but these errors were encountered: