Git Product home page Git Product logo

Comments (6)

TheWeirdDev avatar TheWeirdDev commented on June 2, 2024

What Bluetooth device do you have?
Did you try the workarounds mentioned in the readme?

from bluetooth_headset_battery_level.

ishmeet1995 avatar ishmeet1995 commented on June 2, 2024

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.

Kr3shnik avatar Kr3shnik commented on June 2, 2024

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.

AkechiShiro avatar AkechiShiro commented on June 2, 2024

@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.

AkechiShiro avatar AkechiShiro commented on June 2, 2024

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.

AkechiShiro avatar AkechiShiro commented on June 2, 2024

Okay so I confirmed the battery level can be reported :
image

from bluetooth_headset_battery_level.

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.