TheWeirdDev / Bluetooth_Headset_Battery_Level

A python script to get battery level from Bluetooth headsets
GNU General Public License v3.0
766 stars 80 forks source link

Couldn't find the RFCOMM port number in F35 #70

Open dmaglio opened 2 years ago

dmaglio commented 2 years ago

The device is connected and working. i tried with disconnect and reconnect but the result is the same

 davidemaglio  ~  bluetoothctl info
Device E0:EB:40:CF:00:FB (public)
    Name: Tastiera di Davide
    Alias: Tastiera di Davide
    Class: 0x00000540
    Icon: input-keyboard
    Paired: yes
    Trusted: yes
    Blocked: no
    Connected: yes
    WakeAllowed: yes
    LegacyPairing: no
    UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    Modalias: bluetooth:v004Cp0267d0160
 davidemaglio  ~  bluetooth_battery E0:EB:40:CF:00:FB
Traceback (most recent call last):
  File "/home/davidemaglio/.local/bin/bluetooth_battery", line 33, in <module>
    sys.exit(load_entry_point('bluetooth-battery==1.3.2', 'console_scripts', 'bluetooth_battery')())
  File "/home/davidemaglio/.local/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 162, in main
    query = BatteryStateQuerier(*device.split("."))
  File "/home/davidemaglio/.local/lib/python3.10/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/davidemaglio/.local/lib/python3.10/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?