-
Notifications
You must be signed in to change notification settings - Fork 304
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
Characteristic with UUID could not be found #1493
Comments
Bleak is meant to be run as a normal user, not root. If you run the service explorer example, is the 2A24 characteristic listed? |
I can't see it, here is the output : root@einstein:~# python3 service_explorer.py --address 3C:A5:50:81:D7:C6
2024-01-09 17:19:12,083 __main__ INFO: starting scan...
2024-01-09 17:19:13,569 __main__ INFO: connecting to device...
2024-01-09 17:19:14,768 __main__ INFO: connected
2024-01-09 17:19:14,770 __main__ INFO: [Service] 0000ffe0-0000-1000-8000-00805f9b34fb (Handle: 8): Vendor specific
2024-01-09 17:19:14,772 __main__ INFO: [Characteristic] 0000ffe3-0000-1000-8000-00805f9b34fb (Handle: 15): Vendor specific (write-without-response,write)
2024-01-09 17:19:14,806 __main__ INFO: [Descriptor] 00002902-0000-1000-8000-00805f9b34fb (Handle: 17): Client Characteristic Configuration, Value: bytearray(b'\x00\x00')
2024-01-09 17:19:14,807 __main__ INFO: [Characteristic] 0000ffe1-0000-1000-8000-00805f9b34fb (Handle: 9): Vendor specific (write-without-response,write,notify)
2024-01-09 17:19:14,836 __main__ INFO: [Descriptor] 00002902-0000-1000-8000-00805f9b34fb (Handle: 11): Client Characteristic Configuration, Value: bytearray(b'\x00\x00')
2024-01-09 17:19:14,837 __main__ INFO: [Characteristic] 0000ffe2-0000-1000-8000-00805f9b34fb (Handle: 12): Vendor specific (write-without-response,write,notify)
2024-01-09 17:19:14,866 __main__ INFO: [Descriptor] 00002902-0000-1000-8000-00805f9b34fb (Handle: 14): Client Characteristic Configuration, Value: bytearray(b'\x00\x00')
2024-01-09 17:19:14,868 __main__ INFO: disconnecting...
2024-01-09 17:19:17,257 __main__ INFO: disconnected |
Then either the device doesn't have that characteristic or BlueZ is hiding it. You could log Bluetooth packets to see if the device actually provides this characteristic. |
This is the VendorString right ? Does it mean that if this device do not have this characteristic prevent from using it in Bleak ? I used btmon, is this log usefull ? Bluetooth monitor ver 5.55
|
Hello, |
@Honusnap if you can proceed with this others would be very thankful! |
Here some data from the BlueZ (version 5.55) dbus from a JKBMS where "00002a24-0000-1000-8000-00805f9b34fb" is not found. This indicates that the data is already missing in BlueZ right? manuel@raspberrypi2:~# dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0/dev_20_22_08_25_17_41 org.freedesktop.DBus.Properties.GetAll string:"org.bluez.Device1"
method return time=1708694825.738213 sender=:1.225 -> destination=:1.284 serial=102 reply_serial=2
array [
dict entry(
string "Address"
variant string "20:22:08:25:17:41"
)
dict entry(
string "AddressType"
variant string "public"
)
dict entry(
string "Name"
variant string "JK_BD4A24S04"
)
dict entry(
string "Alias"
variant string "JK_BD4A24S04"
)
dict entry(
string "Paired"
variant boolean false
)
dict entry(
string "Trusted"
variant boolean true
)
dict entry(
string "Blocked"
variant boolean false
)
dict entry(
string "LegacyPairing"
variant boolean false
)
dict entry(
string "Connected"
variant boolean true
)
dict entry(
string "UUIDs"
variant array [
string "0000ffe0-0000-1000-8000-00805f9b34fb"
]
)
dict entry(
string "Adapter"
variant object path "/org/bluez/hci0"
)
dict entry(
string "ManufacturerData"
variant array [
dict entry(
uint16 19274
variant array of bytes [
00 01
]
)
]
)
dict entry(
string "ServicesResolved"
variant boolean true
)
dict entry(
string "AdvertisingFlags"
variant array of bytes [
06
]
)
]
manuel@raspberrypi2:~# bluetoothctl info 20:22:08:25:17:41
Device 20:22:08:25:17:41 (public)
Name: JK_BD4A24S04
Alias: JK_BD4A24S04
Paired: no
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Unknown (0000ffe0-0000-1000-8000-00805f9b34fb)
ManufacturerData Key: 0x4b4a
ManufacturerData Value:
00 01 ..
AdvertisingFlags:
06 . |
bluetoothctl -v
) in case of Linux: 5.55Description
I'm using an other project called dbus-serialbattery, it use Bleak API to connect to bluetooth devices. I've narrowed the error at this command
client = BleakClient(3C:A5:50:81:D7:C6)
Error => Characteristic with UUID 00002a24-0000-1000-8000-00805f9b34fb could not be found!
Using "bluetoothctl connect 3C:A5:50:81:D7:C6" work and return a "connected" message
There is a PIN code for this device and it has been paired succesfully in bluetoothctl
Logs
I then created 2 test scripts ( BleakTest1.py and BleakTest2.py) with your 2 examples here : https://bleak.readthedocs.io/en/latest/usage.html and have included my own address for the "address" constant.
The text was updated successfully, but these errors were encountered: