Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth Device offline #8

Closed
ITCMD opened this issue Mar 8, 2020 · 12 comments
Closed

Bluetooth Device offline #8

ITCMD opened this issue Mar 8, 2020 · 12 comments

Comments

@ITCMD
Copy link

ITCMD commented Mar 8, 2020

OS: Lubuntu with latest updates
Bluetooth device: iHome speaker

When I run your script it gives the following output:

$lucas:~$ ./bl_battery.py FC:58:FA:EA:74:FC
FC:58:FA:EA:74:FC is offline

However the device is certainly online, I'm playing music from it now. Here it is on here:
Blueman Wiz

Any ideas why this is happening?

@TheWeirdDev
Copy link
Owner

Disconnect the device then run the script again. Does it show the same error?

@ITCMD
Copy link
Author

ITCMD commented Mar 12, 2020

No. When I disconnect it waits for a while and tells me it cannot connect, or something. I can give you the exact message if you would like. I would also like to note that when it tells me that the device is offline it does so instantly after I run the command.

@dorianneto
Copy link

OS: Debian 10.3
Bluetooth device: PaMu Slide (Bluetooth Earphone)

I'm facing the same problem here :/

Disconnect the device then run the script again. Does it show the same error?

I did this but still doesn't work.

@TheWeirdDev
Copy link
Owner

This fork of the project prints the debug logs: https://github.com/clst/Bluetooth_Headset_Battery_Level

You can try it and send me the output.

@ITCMD
Copy link
Author

ITCMD commented Mar 15, 2020

will do thanks @TheWeirdDev

@dorianneto
Copy link

The output:

Traceback (most recent call last):
  File "bl_battery.py", line 64, in <module>
    main()
  File "bl_battery.py", line 58, in main
    s.connect((BT_ADDRESS, 3))
ConnectionRefusedError: [Errno 111] Connection refused

@TheWeirdDev
Copy link
Owner

The output:

Traceback (most recent call last):
  File "bl_battery.py", line 64, in <module>
    main()
  File "bl_battery.py", line 58, in main
    s.connect((BT_ADDRESS, 3))
ConnectionRefusedError: [Errno 111] Connection refused

You can try changing the port number in line s.connect((BT_ADDRESS, 3)) from 3 to other numbers (0 to 9) and check if that works. Because it is device specific and varies from device to device.
If that didn't work either, your device is unsupported.

@QkiZMR
Copy link

QkiZMR commented Apr 11, 2020

I checked numbers from 0 to 9. Nothing worked.

@TheWeirdDev
Copy link
Owner

I checked numbers from 0 to 9. Nothing worked.

Your device does not support this protocol.

@QkiZMR
Copy link

QkiZMR commented Apr 12, 2020

Which protocol? Showing battery status? I'm using JBL E45BT. When I connect it to Android phone I see percentage of power in headphones battery.

@TheWeirdDev
Copy link
Owner

Which protocol? Showing battery status? I'm using JBL E45BT. When I connect it to Android phone I see percentage of power in headphones battery.

This script uses AT commands to communicate with Bluetooth devices. Some devices support this commands, some don't.
If your headset uses a different way to communicate, you have to find another way to check battery status. I can't help you with that.

@TheWeirdDev
Copy link
Owner

Closed due to the inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants