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':