From 3b25af35af09ccfa0937d952a0c7f37f5a23d6c2 Mon Sep 17 00:00:00 2001 From: James Smith Date: Sun, 21 Dec 2025 14:50:40 +0000 Subject: [PATCH] Switch default Bluetooth scan to bluetoothctl for BT 5.x support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change default scan mode from hcitool (deprecated) to bluetoothctl - Rename labels: bluetoothctl (Recommended), hcitool (Legacy) - Add power on command before scan for reliability - Add initialization delays for bluetoothctl startup hcitool is deprecated for Bluetooth 5.x adapters and causes "set scan parameters failed" errors on modern systems. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- intercept.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/intercept.py b/intercept.py index 36ba239..81a54ba 100755 --- a/intercept.py +++ b/intercept.py @@ -1636,8 +1636,8 @@ HTML_TEMPLATE = '''

Scan Mode

- - + +
@@ -5832,8 +5832,7 @@ def start_bt_scan(): ) elif scan_mode == 'bluetoothctl': - # Use bluetoothctl for scanning with stdbuf to unbuffer output - # Or use script command to provide a pty + # Use bluetoothctl for BLE scanning with pty for proper output import pty import os @@ -5850,7 +5849,12 @@ def start_bt_scan(): # Store master_fd for reading bt_process._master_fd = master_fd - # Send scan on command + # Wait for bluetoothctl to initialize + time.sleep(0.5) + + # Power on and start LE scan (compatible with Bluetooth 5.x) + os.write(master_fd, b'power on\n') + time.sleep(0.3) os.write(master_fd, b'scan on\n') elif scan_mode == 'ubertooth':