Open jsmif opened 1 year ago
Same answer as your other issues - it is not really possible to determine what is going on without seeing Bluetooth packet logs.
I think I know part of what is the problem. I think you're trying to establish a connection, when that's not actually necessary for GATT in many cases.
If I open bluetoothctl
and try to connect to the same device (an AppleTV), I get this:
[bluetooth]# connect 6C:CENSORED
Attempting to connect to 6C:CENSORED
Request confirmation
[agent] Confirm passkey 474903 (yes/no): yes
Failed to connect: org.bluez.Error.Failed br-connection-unknown
Note the same br-connection-unknown
error. (And there's two attempts to get me to confirm a pin, which I say yes to both times, but it still never connects.)
Basically the AppleTV is probably rejecting the connection attempt, because I'm not also going over to it and hitting OK to the pairing request on the screen. But connecting is entirely unnecessary to get basic GATT info! E.g. here's one example of a command with gatttool that is capable of inspecting the same device.
gatttool --char-desc -b 6C:CENSORED
handle = 0x0001, uuid = 00002800-0000-1000-8000-00805f9b34fb
handle = 0x0002, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x0003, uuid = 00002a00-0000-1000-8000-00805f9b34fb
handle = 0x0004, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x0005, uuid = 00002a01-0000-1000-8000-00805f9b34fb
handle = 0x0006, uuid = 00002800-0000-1000-8000-00805f9b34fb
handle = 0x0007, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x0008, uuid = 00002a05-0000-1000-8000-00805f9b34fb
handle = 0x0009, uuid = 00002902-0000-1000-8000-00805f9b34fb
handle = 0x000a, uuid = 00002800-0000-1000-8000-00805f9b34fb
handle = 0x000b, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x000c, uuid = 00002a29-0000-1000-8000-00805f9b34fb
handle = 0x000d, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x000e, uuid = 00002a24-0000-1000-8000-00805f9b34fb
handle = 0x000f, uuid = 00002800-0000-1000-8000-00805f9b34fb
handle = 0x0010, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x0011, uuid = 8667556c-9a37-4c91-84ed-54ee27d90049
handle = 0x0012, uuid = 00002900-0000-1000-8000-00805f9b34fb
handle = 0x0013, uuid = 00002902-0000-1000-8000-00805f9b34fb
handle = 0x0014, uuid = 00002800-0000-1000-8000-00805f9b34fb
handle = 0x0015, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x0016, uuid = af0badb1-5b99-43cd-917a-a77bc549e3cc
handle = 0x0017, uuid = 00002900-0000-1000-8000-00805f9b34fb
handle = 0x0018, uuid = 00002902-0000-1000-8000-00805f9b34fb
handle = 0x0019, uuid = 00002800-0000-1000-8000-00805f9b34fb
handle = 0x001a, uuid = 00002803-0000-1000-8000-00805f9b34fb
handle = 0x001b, uuid = 6c251515-f290-4f91-808c-5123a0cd02e9
handle = 0x001c, uuid = 00002900-0000-1000-8000-00805f9b34fb
handle = 0x001d, uuid = 00002902-0000-1000-8000-00805f9b34fb
(And other commands such as reading specific handles work fine too.)
But of course gatttool is deprecated, which is why I'm looking for an alternative solution. Is it possible to query without connecting through bleak?
Is it possible to query without connecting through bleak?
No, it is not. This is a limitation of BlueZ (bluetoothd
) and the D-Bus API as you have seen with bluetoothctl
.
bluetoothctl -v
) in case of Linux: bluetoothctl: 5.64 (both systems)Description
Trying to scan GATT and see available characteristics.
Installed with
What I Did
Logs
Unfortunately I can't provide logs as that would provide my exact physical location... Please just see if this replicates for you on Ubuntu 22.04