Skip to content

BlueDucky No Compatible Devices Connected #108

@customguy918

Description

@customguy918

BlueDucky currently contains a logic error around line ~662.
The script checks for paired Bluetooth devices instead of checking whether a Bluetooth adapter (hci0) exists and is running.
This causes the script to incorrectly print:

CRITICAL: No Compatible Bluetooth devices are connected.

even when your adapter is working normally.

This guide shows how to fix the bug.


✔️ What’s Wrong

The original code runs:

result = subprocess.run(['bluetoothctl', 'devices'], capture_output=True, text=True)
if "Device" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.")
    return False

bluetoothctl devices only lists paired devices.
If you have no paired devices, it falsely thinks you have no Bluetooth adapter.


✔️ Correct Fix

Replace the above block with:

# Check if hci0 exists and is up
result = subprocess.run(['hciconfig'], capture_output=True, text=True)

if "hci0:" not in result.stdout or "UP RUNNING" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Bluetooth adapter detected or not running.")
    return False

This checks for the actual adapter (hci0) being present and active.


📌 Step-by-Step Tutorial

1. Go to your BlueDucky directory

cd ~/BlueDucky

2. Make a backup

cp BlueDucky.py BlueDucky.py.bak

3. Open the file

nano BlueDucky.py

4. Find the faulty block

Scroll to the section near line ~662.
You’ll see something like:

# List devices to see if any are connected
result = subprocess.run(['bluetoothctl', 'devices'], capture_output=True, text=True)
if "Device" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.")
    return False

5. Replace it with the corrected logic

Paste this in its place:

# Check if hci0 exists and is up
result = subprocess.run(['hciconfig'], capture_output=True, text=True)

if "hci0:" not in result.stdout or "UP RUNNING" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Bluetooth adapter detected or not running.")
    return False

6. Save and exit

  • Press Ctrl + O, then Enter
  • Press Ctrl + X

7. Test

Check that your adapter exists:

hciconfig

Then run BlueDucky again:

sudo python3 BlueDucky.py

You should no longer get the misleading “No Compatible Bluetooth devices” error.


📌 Summary

Before: Script checks for paired devices → false error.
After: Script checks for actual adapter state → correct behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions