From c0b91e9b0bc8c19cca157cd480c87f444014dd05 Mon Sep 17 00:00:00 2001 From: Cobra Date: Fri, 10 Apr 2026 06:37:30 -0400 Subject: [PATCH] =?UTF-8?q?Switch=20BLE=20scanner=20to=20active=20mode=20?= =?UTF-8?q?=E2=80=94=20bleak=200.20=20passive=20requires=20or=5Fpatterns?= =?UTF-8?q?=20on=20BlueZ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passive mode fails on Debian bookworm bleak 0.20.2 without or_patterns filter. Active mode is functionally equivalent for building-level presence detection and actually yields more complete advertisement data including device names. --- net_alerter/ble_alerter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net_alerter/ble_alerter.py b/net_alerter/ble_alerter.py index 52442f7..9e0612c 100755 --- a/net_alerter/ble_alerter.py +++ b/net_alerter/ble_alerter.py @@ -256,8 +256,8 @@ async def scan_loop(): await on_arrival(name, mac, rssi) - # Passive scanner — no SCAN_REQ packets sent - async with BleakScanner(detection_callback=detection_callback, scanning_mode="passive") as scanner: + # Active scanner — sends SCAN_REQ to get full advertisement data including device names + async with BleakScanner(detection_callback=detection_callback) as scanner: try: while not shutdown_event.is_set(): await asyncio.sleep(1)