Giter Site home page Giter Site logo

Comments (27)

alex8819 avatar alex8819 commented on August 23, 2024 5

On raspberry Pi 5 with ubuntu server i solved with this:

Restart the bluetooth
sudo systemctl restart bluetooth

Start the process:
bluetoothctl

execute command:

power on
agent on
default-agent
scan on

Exit from bluetoothctl
exit

after that:
sudo python3 BlueDucky.py will start.

from blueducky.

Flynnlin avatar Flynnlin commented on August 23, 2024

same

from blueducky.

DG1FI avatar DG1FI commented on August 23, 2024

Same - with internal RPI4 BT Device and an Cambridge Stick.

from blueducky.

YKTV8 avatar YKTV8 commented on August 23, 2024

Confirmed. Same issue. RPI4 Asus BT adapter.

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

I don’t think it’s the adaptor problem . The developer modified the script some days before and probably he broke something . He needs to fix it asap

from blueducky.

Lamentomori avatar Lamentomori commented on August 23, 2024

I don’t think it’s the adaptor problem . The developer modified the script some days before and probably he broke something . He needs to fix it asap

Its a problem with your adapter. If you check BlueDucky.py, on Line: 640 We have a new Function Called "troubleshoot_bluetooth". The purpose of this function is to troubleshoot the adapters capability with bluetoothctl, if the adapter is not capatible with Bluetoothctl, or Bluetoothctl has been installed incorrectly you will be notified of whats preventing you from accessing the application. It is designed to keep people who are not capable of accessing the application later from accessing it initially..

Please Reference the code found in this function

 # Check if bluetoothctl is available
    try:
        subprocess.run(['bluetoothctl', '--version'], check=True, stdout=subprocess.PIPE)
    except subprocess.CalledProcessError:
        print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: {blue}bluetoothctl {reset}is not installed or not working properly.")
        return False

    # Check for Bluetooth adapters
    result = subprocess.run(['bluetoothctl', 'list'], capture_output=True, text=True)
    if "Controller" not in result.stdout:
        print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No {blue}Bluetooth adapters{reset} have been detected.")
        return False

    # 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

    # if no issues are found then continue
    return True

from blueducky.

Lamentomori avatar Lamentomori commented on August 23, 2024

If you think this may be a mistake, please contact me via discord with anything that may help your problem if it does NOT concern your Bluetooth Adapter, If your Bluetooth adapter is not supported, Then it is NOT supported. You will need to use another device or purchase a new Adapter, and I will work with you to fix the problem | I apologize for any inconvenience. @youjsgotpwned

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Well my Bluetooth adaptor is Asus USB-BT500 USB Bluetooth 5.0 . Do you know if I should install any drivers or something ? Because it recognised by Kali and I can scan for Bluetooth devices using the hcitool. Do you have any adaptor to suggest ?

from blueducky.

Lamentomori avatar Lamentomori commented on August 23, 2024

Screenshot from 2024-05-18 10-53-19 Screenshot from 2024-05-18 10-53-57 Screenshot from 2024-05-18 10-55-13 Screenshot from 2024-05-18 10-55-41

I do apologise, I did not see the screenshot.

from blueducky.

Lamentomori avatar Lamentomori commented on August 23, 2024

Well my Bluetooth adaptor is Asus USB-BT500 USB Bluetooth 5.0 . Do you know if I should install any drivers or something ? Because it recognised by Kali and I can scan for Bluetooth devices using the hcitool. Do you have any adaptor to suggest ?

within BlueDucky.py the original developer Hardcoded Hci0 causing issues. I added this to make debugging easier, I will make a modification to check for another Bluetooth adapter as it defaults to hci0. For now Please open BlueDucky.py and 'Control + F' and find hci0 and replace it with hci1.

from blueducky.

Lamentomori avatar Lamentomori commented on August 23, 2024

Well my Bluetooth adaptor is Asus USB-BT500 USB Bluetooth 5.0 . Do you know if I should install any drivers or something ? Because it recognised by Kali and I can scan for Bluetooth devices using the hcitool. Do you have any adaptor to suggest ?

within BlueDucky.py the original developer Hardcoded Hci0 causing issues. I added this to make debugging easier, I will make a modification to check for another Bluetooth adapter as it defaults to hci0. For now Please open BlueDucky.py and 'Control + F' and find hci0 and replace it with hci1.

Doing what I described above, should resolve your issues. As right now its defaulting to an adapter that is DOWN or currently Not Available. Feel free to contact me via discord: @youjsgotpwned

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Yes but as you can see in the screenshot I sent I already replaced hci0 with hci1 in the line 674 I think where it says default=… . Should I replace it to other points as well ?

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Also can you check if my adaptor is supported pls or not ? Because as I told you it can scan for Bluetooth devices using the the hcitool which I think it’s a sign that it should work

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Do I need to do this every time I wanna use it or only once ?

from blueducky.

alex8819 avatar alex8819 commented on August 23, 2024

After BlueDucky.py crash, every time i need to make this command 2 times, after that BlueDucky.py start, but when it will crash i need to do it again. i mada a small script to speed up:
sudo nano reset.sh

#!/bin/bash
# Script per ripristinare il Bluetooth dopo un crash di BlueDucky.py

echo "Ripristino del Bluetooth in corso..."
sudo systemctl restart bluetooth
bluetoothctl power on
bluetoothctl agent on
bluetoothctl default-agent
bluetoothctl scan on

Add permission:
sudo chmod +x reset.sh

execute the script:
./reset.sh

Stop the script
CTRL + C

Execute agin,stop again and start:
sudo python3 BlueDucky.py

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Which chipset does your wireless adaptor have ?

from blueducky.

DG1FI avatar DG1FI commented on August 23, 2024

the commands are working. with "bluetoothctl scan on" it found many bluetooth devices, like mobile phones and bluetooth speatker. the blueducky script found only my lge tv. i've tried it many times and with different adapters...

without the commands above, the adapters are not working -> no compatible adapters found

from blueducky.

DG1FI avatar DG1FI commented on August 23, 2024

# 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

i've try it out... the command "bluetoothctl devices" is here empty at startup... the command "scan on" initiates the scan and add devices to the list, like this:

Device 48:E1:5C:76:34:B2 48-E1-5C-76-34-B2 Device 3E:55:13:F2:A9:72 3E-55-13-F2-A9-72 Device 74:FF:8F:4C:5E:76 74-FF-8F-4C-5E-76 Device 61:76:CB:39:FD:7F 61-76-CB-39-FD-7F Device 18:58:80:51:30:89 [LG] webOS TV UQ70006LB Device C4:35:34:37:12:75 Govee_H6072_1275 Device C4:42:25:D7:3B:34 T-Echo DG1FI-11 [bluetooth]#

but if i run blueducky, only my lge tv is listed- the other devices not.

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Same for me …
I also contacted the developer on Discoed but he does not respond as he has said ..

from blueducky.

Flynnlin avatar Flynnlin commented on August 23, 2024

在带有 ubuntu 服务器的树莓派 5 上,我解决了这个问题:

重新启动蓝牙 sudo systemctl restart bluetooth

启动进程: bluetoothctl

执行命令:

power on
agent on
default-agent
scan on

退出bluetoothctl exit

之后: sudo python3 BlueDucky.py将开始。

worked. my device is Pi ZERO 2W

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

It worked for me once but I need to repeat this process each time I want to run the script . Also most times it does not work ( does not find Bluetooth devices )

from blueducky.

Christiancoding avatar Christiancoding commented on August 23, 2024

I had the same issue:
{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.

I fixed it by connecting it to a Bluetooth device. After that, it worked just fine.

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

And how exactly did you do that ?

from blueducky.

mohamedmajid91 avatar mohamedmajid91 commented on August 23, 2024

#!/bin/bash
Script to unblock and restore Bluetooth after a crash of BlueDucky.py

echo "Restoring Bluetooth..."
Unblock the Bluetooth device

if ! sudo rfkill unblock bluetooth; then
echo "Failed to unblock Bluetooth device."
exit 1
fi
Bring up the Bluetooth interface

if ! sudo hciconfig hci1 up; then
echo "Failed to bring up Bluetooth interface."
exit 1
fi
Restart the Bluetooth service

if ! sudo systemctl restart bluetooth; then
echo "Failed to restart Bluetooth service."
exit 1
fi
Wait for the service to restart

sleep 5
Use bluetoothctl to configure Bluetooth

{
echo "power on"
sleep 1
echo "agent off"
sleep 1
echo "agent on"
sleep 1
echo "default-agent"
sleep 1
echo "scan on"
sleep 5
} | bluetoothctl

echo "Bluetooth restored successfully."
Delay before running the Python script

sleep 5
Run the Python script

if ! sudo python3 BlueDucky.py; then
echo "Failed to run BlueDucky.py."
exit 1
fi

exit 0

sudo nano restore_bluetooth.sh

sudo chmod +x restore_bluetooth.sh

from blueducky.

ABC00012345 avatar ABC00012345 commented on August 23, 2024

or just remove the return False in the script, it is working for me

from blueducky.

Aggelos11 avatar Aggelos11 commented on August 23, 2024

Can you explain it a bit more please ? Exactly what I need to do in which line etc?

or just remove the return False in the script, it is working for me

from blueducky.

ABC00012345 avatar ABC00012345 commented on August 23, 2024

Can you explain it a bit more please ? Exactly what I need to do in which line etc?

or just remove the return False in the script, it is working for me

Here, I think it's near to line 640, the last return False, where it says before no compltatible bluetooth devices connected. Or you can also remove the complete if condition:

Check if bluetoothctl is available
try:
subprocess.run(['bluetoothctl', '--version'], check=True, stdout=subprocess.PIPE)
except subprocess.CalledProcessError:
print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: {blue}bluetoothctl {reset}is not installed or not working properly.")
return False

# Check for Bluetooth adapters
result = subprocess.run(['bluetoothctl', 'list'], capture_output=True, text=True)
if "Controller" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No {blue}Bluetooth adapters{reset} have been detected.")
    return False

# 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 # HERE ....................... Remove this

# if no issues are found then continue
return True

from blueducky.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.