bleak icon indicating copy to clipboard operation
bleak copied to clipboard

Blank UUIDs list while using BlueZ in a Raspberry Pi 4

Open AVAM16 opened this issue 2 years ago • 6 comments

  • bleak version: 0.20.2
  • Python version: 3.11.4 32-bit
  • Operating System: Linux (Debian)
  • BlueZ version (bluetoothctl -v) in case of Linux: 5.50

Description

The list of UUIDs in the device.details is blank even tough the UUID for a service exists. A few days ago it was working. I am using a raspberry pi4. It is reading data from an ESP32.

What I Did

devices = await bleak.BleakScanner.discover(timeout=5) for d in devices: print(d.details)

AVAM16 avatar Aug 07 '23 16:08 AVAM16

Tip: details is an internal OS-specific implementation and may change without notice. Use BleakScanner.discover(..., return_adv=True) instead.

Without logs, we can't see if the device is just not sending the UUID in the advertising data or if this is actually a problem with Bleak.

dlech avatar Aug 07 '23 17:08 dlech

uuids I used return_adv = True and no service_uuids appeared. Just the local_name and the rssi.

AVAM16 avatar Aug 08 '23 09:08 AVAM16

Right, BleakScanner only received advertisement data which may or may not include any services UUIDs depending on how the device is configured. You have to actually connect to the device with BleakClient to get all of the services.

dlech avatar Aug 08 '23 14:08 dlech

try: async with bleak.BleakClient(address) as client: svr = client.services for sv in svr: print(sv)

The output is null.

AVAM16 avatar Aug 08 '23 15:08 AVAM16

Again, without logs, we cannot know what is actually happening.

dlech avatar Aug 08 '23 15:08 dlech

{'path': '/org/bluez/hci0/dev_78_21_84_9A_BA_F2', 'props': {'Address': '78:21:84:9A:BA:F2', 'AddressType': 'public', 'Name': 'NimBLE-Server', 'Alias': 'NimBLE-Server', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -45, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False}}

AVAM16 avatar Aug 09 '23 09:08 AVAM16