Comments (6)
What Bluetooth device do you have?
Did you try the workarounds mentioned in the readme?
from bluetooth_headset_battery_level.
Getting same error, @TheWeirdDev I am using Bluetooth Headset
Command -
bluetooth_battery B4:0E:DE:95:7C:9C
Response -
Traceback (most recent call last): File "/home/ishmeet1995/anaconda3/bin/bluetooth_battery", line 8, in <module> sys.exit(main()) File "/home/ishmeet1995/anaconda3/lib/python3.9/site-packages/bluetooth_battery/bluetooth_battery.py", line 162, in main query = BatteryStateQuerier(*device.split(".")) File "/home/ishmeet1995/anaconda3/lib/python3.9/site-packages/bluetooth_battery/bluetooth_battery.py", line 81, in __init__ self._bt_settings = bluetooth_mac, int(bluetooth_port or RFCOMMSocket.find_rfcomm_port(bluetooth_mac)) File "/home/ishmeet1995/anaconda3/lib/python3.9/site-packages/bluetooth_battery/bluetooth_battery.py", line 60, in find_rfcomm_port raise bluetooth.BluetoothError("Couldn't find the RFCOMM port number. Perhaps the device is offline?") bluetooth.btcommon.BluetoothError: Couldn't find the RFCOMM port number. Perhaps the device is offline?
from bluetooth_headset_battery_level.
it also happened to me. Im not entierly sure if this repo supports HCI
bluetooth devices (another connection method similar to rfcomm).
To check you can run hcitool dev
. Note that this command doesnt always work.
You can also use udevadm monitor
and during this command dissconnect and reconnect the device.
In my case it was:
/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:256
from bluetooth_headset_battery_level.
@TheWeirdDev I'm running on this issue using a bluetooth keyboard Keychron K7, can you please help me, understand what I can do to fix either the script or find the out the battery level ?
from bluetooth_headset_battery_level.
Here is what I found out by using hcitool :
Requesting information ...
BD Address: DC:2C:26:3A:64:00
OUI Company: Iton Technology Limited (DC-2C-26)
Device Name: Keychron K7
LMP Version: 5.1 (0xa) LMP Subversion: 0x2304
Manufacturer: Cypress Semiconductor (305)
Features page 0: 0xbf 0x06 0x86 0x78 0x18 0x1e 0x59 0x87
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <sniff mode> <RSSI>
<channel quality> <paging scheme> <power control>
<broadcast encrypt> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. perip.>
<AFH cls. perip.> <sniff subrating> <pause encryption>
<AFH cap. central> <AFH cls. central> <extended inquiry>
<simple pairing> <encapsulated PDU> <non-flush flag> <LSTO>
<inquiry TX power> <EPC> <extended features>
Features page 1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
- Inquiry TX power, I don't think that's what I need, it's probably the power needed to send a bluetooth packet or something like that ??
- power control must mean that there could be a way to control the bluetooth device power from the host, I guess
from bluetooth_headset_battery_level.
Okay so I confirmed the battery level can be reported :
from bluetooth_headset_battery_level.
Related Issues (20)
- Apple Magic Keyboard is offline on each port HOT 1
- Container does seems not to work HOT 5
- unclear exception on usage attempt HOT 2
- Couldn't find the RFCOMM port number in F35
- SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats HOT 2
- Apple Air Pods Pro HOT 1
- Systemerror using Python 3.10 HOT 1
- bluetooth.btcommon.BluetoothError: [Errno 111] Connection refused HOT 5
- It works on Raspberry Pi 3B/Raspberry OS(Buster) with Anker soundcore a3102 BT speakers
- bluetooth.btcommon.BluetoothError: [Errno 111] Connection refused HOT 22
- Device or resource busy HOT 16
- PY_SSIZE_T_CLEAN macro must be defined for '#' formats HOT 4
- support for Google Pixel Buds HOT 1
- error in PyBluez setup command: use_2to3 is invalid. HOT 2
- error: command '/usr/bin/gcc' failed with exit code 1 HOT 2
- after a one commit broken on some devices
- SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats HOT 2
- Why BatteryStateQuerier send messaged to sock? HOT 1
- bluetooth.btcommon.BluetoothError: [Errno 16] Device or resource busy HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluetooth_headset_battery_level.