Skip to content

bluetooth.btcommon.BluetoothError: [Errno 111] Connection refusedΒ #76

@HarshalRathore

Description

@HarshalRathore

Installation is done with yay -S python-bluetooth-battery

command run
bluetooth_battery $(bluetoothctl info | awk '/^Device/ {print $2}')
and
sudo bluetooth_battery $(bluetoothctl info | awk '/^Device/ {print $2}')

Error received

Traceback (most recent call last):
  File "<string>", line 3, in connect
_bluetooth.error: (111, 'Connection refused')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/bluetooth_battery", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 163, in main
    print("Battery level for {} is {}".format(device, str(query)))
  File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 93, in __str__
    return "{:.0%}".format(self._perform_query() / 100)
  File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 101, in _perform_query
    sock.connect(self._bt_settings)
  File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: [Errno 111] Connection refused

---- Update ----

Tried Manual installation, returned with the same error

Also tried to run with docker, returned with the same error.

---- Conculsion ----

Problem lies in the project/script not in the underlying or user's OS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions