Repository navigation
Description
My application is a gateway that scans continuously for medical devices. When it sees one, it stops the scan and connects. When the connect succeeds it continues scanning again. This works fine normally.
However, after running for some days and connecting many times to devices, it hangs. Below you see the last lines of the log. Here you see how I found an A&D scale, get the measurement and disconnect. After the disconnect the regular 10s timeout of the discovery occurs but starting the discovery does not succeed and the whole thing hangs. "sending MGMT_OP_START_SERVICE_DISCOVERY" is the last line I see in the log....
Any idea what could be going on?
Jul 13 07:59:40 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() sending MGMT_OP_START_SERVICE_DISCOVERY -100, 6, 7
Jul 13 07:59:40 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_complete() status 0x00
Jul 13 07:59:40 ubuntu bluetoothd[848]: src/adapter.c:discovering_callback() hci0 type 6 discovering 1 method 1
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:discovering_callback() hci0 type 6 discovering 0 method 1
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:trigger_start_discovery()
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:cancel_passive_scanning()
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout()
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() adapter->current_discovery_filter == 1
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() sending MGMT_OP_START_SERVICE_DISCOVERY -100, 6, 7
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_complete() status 0x00
Jul 13 07:59:51 ubuntu bluetoothd[848]: src/adapter.c:discovering_callback() hci0 type 6 discovering 1 method 1
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:device_found_callback() hci0 addr 2C:AB:33:21:BC:D8, rssi -74 flags 0x0000 eir_len 13
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/device.c:device_set_legacy() legacy 0
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/device.c:device_set_rssi_with_delta() rssi -74
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/device.c:device_set_flags() flags 4
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:stop_discovery() sender :1.20
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:stop_discovery_complete() status 0x00
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:discovery_remove() owner :1.20
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/device.c:device_set_rssi_with_delta() rssi 0
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:trigger_passive_scanning()
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:discovering_callback() hci0 type 6 discovering 0 method 0
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/device.c:device_connect_le() Connection attempt to: 2C:AB:33:21:BC:D8
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:connected_callback() hci0 device 2C:AB:33:21:BC:D8 connected eir_len 13
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:start_discovery() sender :1.20
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:update_discovery_filter()
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:discovery_filter_to_mgmt_cp()
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:trigger_start_discovery()
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:cancel_passive_scanning()
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout()
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() adapter->current_discovery_filter == 1
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() sending MGMT_OP_START_SERVICE_DISCOVERY -100, 6, 7
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_complete() status 0x00
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/adapter.c:discovering_callback() hci0 type 6 discovering 1 method 1
Jul 13 07:59:54 ubuntu bluetoothd[848]: attrib/gattrib.c:g_attrib_ref() 0x165b4d0: g_attrib_ref=1
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/battery/battery.c:batt_accept() BATT profile accept (2C:AB:33:21:BC:D8)
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/service.c:change_state() 0x157c170: device 2C:AB:33:21:BC:D8 profile batt-profile state changed: disconnected -> connected (0)
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:deviceinfo_accept() deviceinfo profile accept (2C:AB:33:21:BC:D8)
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a29-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a24-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a25-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a27-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a26-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a28-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a23-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/deviceinfo/deviceinfo.c:handle_characteristic() Unsupported characteristic: 00002a2a-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/service.c:change_state() 0x157b658: device 2C:AB:33:21:BC:D8 profile deviceinfo state changed: disconnected -> connected (0)
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/gap/gas.c:gap_accept() GAP profile accept (2C:AB:33:21:BC:D8)
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/gap/gas.c:handle_characteristic() Unsupported characteristic: 00002a02-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/gap/gas.c:handle_characteristic() Unsupported characteristic: 00002a03-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/gap/gas.c:handle_characteristic() Unsupported characteristic: 00002a04-0000-1000-8000-00805f9b34fb
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/service.c:change_state() 0x156f568: device 2C:AB:33:21:BC:D8 profile gap-profile state changed: disconnected -> connected (0)
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/gatt-client.c:btd_gatt_client_connected() Device connected.
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/gatt-client.c:register_notify() Re-register subscribed notification client
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/device.c:gatt_debug() MTU exchange complete, with MTU: 23
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/battery.c:btd_battery_register() path = /org/bluez/hci0/dev_2C_AB_33_21_BC_D8
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/battery.c:btd_battery_register() registered Battery object: /org/bluez/hci0/dev_2C_AB_33_21_BC_D8
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/battery/battery.c:parse_battery_level() Battery Level updated: 100%
Jul 13 07:59:54 ubuntu bluetoothd[848]: src/battery.c:btd_battery_update() path = /org/bluez/hci0/dev_2C_AB_33_21_BC_D8
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/battery/battery.c:batt_io_ccc_written_cb() Battery Level: notification enabled
Jul 13 07:59:54 ubuntu bluetoothd[848]: profiles/gap/gas.c:read_device_name_cb() GAP Device Name: A&D_UC-352BLE_21BCD8
Jul 13 07:59:55 ubuntu bluetoothd[848]: profiles/gap/gas.c:read_appearance_cb() GAP Appearance: 0x0000
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() (chan 0x16524f8) ATT PDU received: 0x1d
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() Primary services found: 6
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() start: 0x0001, end: 0x000b, uuid: 00001800-0000-1000-8000-00805f9b34fb
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() start: 0x000c, end: 0x000f, uuid: 00001801-0000-1000-8000-00805f9b34fb
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() start: 0x0010, end: 0x0017, uuid: 0000181d-0000-1000-8000-00805f9b34fb
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() start: 0x0018, end: 0x0028, uuid: 0000180a-0000-1000-8000-00805f9b34fb
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() start: 0x0029, end: 0x002b, uuid: 0000180f-0000-1000-8000-00805f9b34fb
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() start: 0x002c, end: 0xffff, uuid: 233bf000-5a34-1b6d-975c-000d5690abe4
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_client_ready_cb() status: success, error: 0
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/gatt-client.c:btd_gatt_client_ready() GATT client ready
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/gatt-client.c:create_services() Exporting objects for GATT services: 2C:AB:33:21:BC:D8
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/gatt-client.c:btd_gatt_client_ready() Features 0x00
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/gatt-client.c:btd_gatt_client_ready() Update Features 0x00
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:device_svc_resolved() /org/bluez/hci0/dev_2C_AB_33_21_BC_D8 err 0
Jul 13 07:59:55 ubuntu bluetoothd[848]: src/device.c:gatt_debug() Registered handler for "Service Changed": 1
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/service.c:change_state() 0x157c170: device 2C:AB:33:21:BC:D8 profile batt-profile state changed: connected -> disconnecting (0)
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/battery.c:btd_battery_unregister() path = /org/bluez/hci0/dev_2C_AB_33_21_BC_D8
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/service.c:change_state() 0x157c170: device 2C:AB:33:21:BC:D8 profile batt-profile state changed: disconnecting -> disconnected (0)
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/service.c:change_state() 0x157b658: device 2C:AB:33:21:BC:D8 profile deviceinfo state changed: connected -> disconnecting (0)
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/service.c:change_state() 0x157b658: device 2C:AB:33:21:BC:D8 profile deviceinfo state changed: disconnecting -> disconnected (0)
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/service.c:change_state() 0x156f568: device 2C:AB:33:21:BC:D8 profile gap-profile state changed: connected -> disconnecting (0)
Jul 13 07:59:57 ubuntu bluetoothd[848]: src/service.c:change_state() 0x156f568: device 2C:AB:33:21:BC:D8 profile gap-profile state changed: disconnecting -> disconnected (0)
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/adapter.c:dev_disconnected() Device 2C:AB:33:21:BC:D8 disconnected, reason 2
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/adapter.c:adapter_remove_connection()
Jul 13 07:59:59 ubuntu bluetoothd[848]: plugins/policy.c:disconnect_cb() reason 2
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 2C:AB:33:21:BC:D8 type 1 status 0xe
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/device.c:device_bonding_failed() status 14
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/adapter.c:resume_discovery()
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/adapter.c:trigger_start_discovery()
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/adapter.c:cancel_passive_scanning()
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/device.c:gatt_debug() Channel 0x16524f8 disconnected: Software caused connection abort
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/device.c:att_disconnected_cb()
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/device.c:att_disconnected_cb() Software caused connection abort (103)
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/gatt-client.c:btd_gatt_client_disconnected() Device disconnected. Cleaning up.
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/device.c:att_disconnected_cb() Automatic connection disabled
Jul 13 07:59:59 ubuntu bluetoothd[848]: src/gatt-database.c:btd_gatt_database_att_disconnected()
Jul 13 07:59:59 ubuntu bluetoothd[848]: attrib/gattrib.c:g_attrib_unref() 0x165b4d0: g_attrib_unref=0
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout()
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() adapter->current_discovery_filter == 1
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:discovering_callback() hci0 type 6 discovering 0 method 1
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:trigger_start_discovery()
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:cancel_passive_scanning()
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout()
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() adapter->current_discovery_filter == 1
Jul 13 08:00:04 ubuntu bluetoothd[848]: src/adapter.c:start_discovery_timeout() sending MGMT_OP_START_SERVICE_DISCOVERY -100, 6, 7
Activity
weliem commentedon Jul 13, 2022
...running Bluez 5.64 on Ubuntu Server 22.04 on a Raspberry CM4
github-actions commentedon Jun 14, 2025
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.