Bluetooth_Headset_Battery_Level icon indicating copy to clipboard operation
Bluetooth_Headset_Battery_Level copied to clipboard

Connection refused for BLE_ATH-M50xBT

Open Vrizkag opened this issue 4 years ago • 7 comments

bluetooth_battery 00:0A:45:0B:5C:5C 00:0A:45:0B:5C:5C is offline [Errno 111] Connection refused

Then i tried this:

bluetooth_battery 00:0A:45:0B:5C:5C.1 00:0A:45:0B:5C:5C is offline [Errno 16] Device or resource busy

Before that, I went into bluetoothctl to get the correct address

[BLE_ATH-M50xBT]# info
Device 00:0A:45:0B:5C:5C (public)
	Name: BLE_ATH-M50xBT
	Alias: BLE_ATH-M50xBT
	Class: 0x00240418
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: yes
	LegacyPairing: no

Vrizkag avatar Jan 19 '21 12:01 Vrizkag

I'm not sure what's the reason. Disconnect your device first, then run the script again while disconnected. This works for some devices.

TheWeirdDev avatar Jan 19 '21 12:01 TheWeirdDev

did you try to rerun the script @Vrizkag? like in executing the same command twice? i.e.

$ bluetooth_battery 00:0A:45:XX:XX:XX
00:0A:45:XX:XX:XX is offline [Errno 111] Connection refused

$ bluetooth_battery 00:0A:45:XX:XX:XX
Battery level for 00:0A:45:XX:XX:XX is 80%

cheriimoya avatar Jan 25 '21 06:01 cheriimoya

Got the same problem using different device, let me know if you rather have a separate issue for this 876964 headset.

( 876964 is this headset model name :shrug: )

[876964]# info E9:08:EF:93:XX:XX
Device E9:08:EF:93:XX:XX (public)
        Name: 876964
        Alias: 876964
        Class: 0x00240404
        Icon: audio-card
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)

With the headset connected (script exits in less than 1s, it returns this error every time I run it):

╰─ bluetooth_battery E9:08:EF:93:XX:XX
E9:08:EF:93:XX:XX is offline [Errno 111] Connection refused

With the headset disconnected

╰─ bluetooth_battery E9:08:EF:93:XX:XX
Couldn't find the RFCOMM port number
E9:08:EF:93:XX:XX is offline [Errno 112] Host is down

isalgueiro avatar May 05 '21 09:05 isalgueiro

+1 Same error with a Bose quietcomfort 35.

The command journalctl -f -o cat /usr/bin/gnome-shell prints out:

Bluetooth battery indicator: 28:11:XXXXXX is offline (16, 'Device or resource busy') Bluetooth` battery indicator: 28:11:XXXXXXis offline (111, 'Connection refused')

oesst avatar May 12 '21 08:05 oesst

I have the same issue with my headset, I'm on Ubuntu 20.04.2

eqaderi avatar Jun 13 '21 08:06 eqaderi

I have the same issue on Ubuntu (5.4.0-89-generic #100-Ubuntu SMP) with a Bowers & Wilkins headphone. Battery level is reported correctly after a reboot, but after the first suspend I get the same behaviour ("Errno 111") as described above.

Oh, and I found these lines repeated over and over in /var/log/syslog: Oct 12 20:37:01 XXX gnome-shell[6989]: Usage of object.actor is deprecated for Indicator#012get@resource:///org/gnome/shell/ui/environment.js:287:29#012_refresh@/home/axel/.local/share/gnome-shell/extensions/[email protected]/extension.js:80:13#012_runLoop@/home/pipapu/.local/share/gnome-shell/extensions/[email protected]/extension.js:47:14 Oct 12 20:37:02 XXX gnome-shell[6989]: Bluetooth battery indicator: Battery level for B0:67:2F:1B:A9:6D is 100%

So, actually the battery level is correctly reported by the device. Perhaps the deprecate warning is not correctly interpreted by bluetooth_battery?

pipapu avatar Oct 12 '21 19:10 pipapu

I can confirm that after a restart, battery status is reported correctly

talhajunaidd avatar Dec 09 '21 18:12 talhajunaidd