Bluetooth_Headset_Battery_Level icon indicating copy to clipboard operation
Bluetooth_Headset_Battery_Level copied to clipboard

disconnected/connected messsages

Open bhepple opened this issue 5 years ago • 2 comments

Every time the script is run, the headset is connected and then disconnected - and this model (Audeara A-10) - tells you so via the cans! It's a bit disconcerting when listening to music and it prevents the use of the script in a monitor eg "check every 30s and pop up a warning when <10%"

@chaoscreator mentioned this in #33 I think, but I thought I'd raise this as a separate issue.

I thought I'd try and remove some of the bluetooth dialog and see if affected the outcome, hoping that it would eliminate the annoying 'connected/disconnected' messages. This was the minimal dialog that works for me:

R: b'AT+BRSF=959\r'
S: b'+BRSF: 1024'
S: b'OK'
R: b'AT+CIND=?\r'
S: b'OK'
R: b'AT+CIND?\r'
S: b'OK'
R: b'AT+CMER=3, 0, 0, 1\r'
S: b'OK'
R: b'AT+BIND=2\r'
S: b'OK'
R: b'AT+BIND=?\r'
S: b'OK'
R: b'AT+BIND?\r'
S: b'OK'
R: b'AT+VGS=10\r'
S: b'OK'
R: b'AT+BTRH?\r'
S: b'OK'
R: b'AT+XAPL=0000-0000-0100,7\r'
S: b'OK'
R: b'AT+IPHONEACCEV=2,1,7,2,0\r'
Battery level for F0:23:B9:50:CA:54 is 80%

... but it doesn't remove the connection messages!

bhepple avatar Aug 05 '20 22:08 bhepple

Thinking about it, it's more likely it's the

s.connect((device, port))

causing the messages - I doubt we can eliminate that, unless we somehow re-use the existing PulseAudio connection, which is probably out of scope.

bhepple avatar Aug 06 '20 00:08 bhepple

Found this discussion so it looks like PA may end up with battery after all. Eventually!

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/722

bhepple avatar Aug 06 '20 00:08 bhepple