bleak icon indicating copy to clipboard operation
bleak copied to clipboard

Unable to scan for BLE 5.x extended advertisements

Open Nilon123456789 opened this issue 2 years ago • 10 comments

  • bleak version: 0.20.2
  • Python version: 3.9.2
  • Operating System: Raspbian GNU/Linux 11 (bullseye) armv7l | Raspberry Pi 4 Model B Rev 1.4
  • BlueZ version (bluetoothctl -v) in case of Linux: 5.66

Description

I'm trying to listen for extended advertising from an nrf52833. But I can't see the packets on my pi nor on my windows desktop.

What I Did

I tried running the https://github.com/hbldh/bleak/blob/develop/examples/discover.py script on my pc and pi. But I'm only seeing regular advertising message and not extended one. I know that my nrf is broadcasting since I can see the packets on my pc using https://github.com/microsoft/BluetoothLEExplorer from microsoft.

Nilon123456789 avatar Jun 22 '23 14:06 Nilon123456789

With BlueZ (Linux) and CoreBluetooth (Mac), we only get updates when RSSI or the value of a advertisement data type changes. There isn't a way to tell the difference between different types of advertisements on these OSes. Windows does provide this information, but to make Bleak consistent cross-platform, we don't expose that.

dlech avatar Jun 22 '23 16:06 dlech

So I can not read/receive extended advertisement packet using bleak?

Nilon123456789 avatar Jun 22 '23 17:06 Nilon123456789

I'm not entirely sure since I don't have any devices that use extended advertisements to see exactly how all of the different OSes handle it.

dlech avatar Jun 22 '23 17:06 dlech

On Windows (10+) it should be possible to enable support for extended advertisements: https://learn.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.advertisement.bluetoothleadvertisementwatcher.allowextendedadvertisements?view=winrt-19041. However, the underlying BT controller needs to support these, which is not the case for every BT5.0 specified controller, since extended advertisements are an optional feature of BT5.0 spec.

eriklins avatar Sep 05 '23 15:09 eriklins

I'm not entirely sure since I don't have any devices that use extended advertisements to see exactly how all of the different OSes handle it.

If you have an ESP32S3 you can test extended advertising capabilities with the NimBLE Multi Advertiser Demo in the supplied Examples

philrittenhouse avatar Jan 25 '24 17:01 philrittenhouse