Initially I had a number of problems, just getting the GUI to launch. I've made some changes, but I'm sure this is not a fix, just suggestions on what needs to be fixed.
Device is registered:
~/SoundcoreDesktop$ bluetoothctl
Agent registered
[bluetooth]# devices
Device 98:47:44:A4:E4:DC soundcore Life Q30
But application does not find it:
~/SoundcoreDesktop$ python3 SoundcoreDesktop.py
[]
Traceback (most recent call last):
File "/home/bartold/SoundcoreDesktop/SoundcoreDesktop.py", line 62, in
Headphone = Soundcore(macaddress, onHeadphoneEvent)
^^^^^^^^^^
NameError: name 'macaddress' is not defined
If I change line 62 to match "soudcore" instead of "Soundcore" it's still not finding it later:
~/SoundcoreDesktop$ python3 SoundcoreDesktop.py
[]
98:47:44:A4:E4:DC
Traceback (most recent call last):
File "/home/bartold/SoundcoreDesktop/SoundcoreDesktop.py", line 70, in
Headphone.connect()
File "/home/bartold/SoundcoreDesktop/SoundcoreAPI.py", line 196, in connect
raise ConnectionError(f"Cannot connect to {self.macaddress}")
ConnectionError: Cannot connect to 98:47:44:A4:E4:DC
If I now change line 67 in the API to "soundcore" (lowercase) I now get another problem:
~/SoundcoreDesktop$ python3 SoundcoreDesktop.py
98:47:44:A4:E4:DC
Traceback (most recent call last):
File "/home/bartold/SoundcoreDesktop/SoundcoreDesktop.py", line 70, in
Headphone.connect()
File "/home/bartold/SoundcoreDesktop/SoundcoreAPI.py", line 192, in connect
self.client.connect((self.macaddress, self.Port))
OSError: [Errno 16] Device or resource busy
I found that by adding a pause before trying to reconnect works, i.e. time.sleep(1) added before the return in getPort. I can now see the GUI, but it's not useful.
I don't know what to do next, but I think I might be bypassing something by forcing the macaddress?
Initially I had a number of problems, just getting the GUI to launch. I've made some changes, but I'm sure this is not a fix, just suggestions on what needs to be fixed.
Device is registered:
~/SoundcoreDesktop$ bluetoothctl
Agent registered
[bluetooth]# devices
Device 98:47:44:A4:E4:DC soundcore Life Q30
But application does not find it:
~/SoundcoreDesktop$ python3 SoundcoreDesktop.py
[]
Traceback (most recent call last):
File "/home/bartold/SoundcoreDesktop/SoundcoreDesktop.py", line 62, in
Headphone = Soundcore(macaddress, onHeadphoneEvent)
^^^^^^^^^^
NameError: name 'macaddress' is not defined
If I change line 62 to match "soudcore" instead of "Soundcore" it's still not finding it later:
~/SoundcoreDesktop$ python3 SoundcoreDesktop.py
[]
98:47:44:A4:E4:DC
Traceback (most recent call last):
File "/home/bartold/SoundcoreDesktop/SoundcoreDesktop.py", line 70, in
Headphone.connect()
File "/home/bartold/SoundcoreDesktop/SoundcoreAPI.py", line 196, in connect
raise ConnectionError(f"Cannot connect to {self.macaddress}")
ConnectionError: Cannot connect to 98:47:44:A4:E4:DC
If I now change line 67 in the API to "soundcore" (lowercase) I now get another problem:
~/SoundcoreDesktop$ python3 SoundcoreDesktop.py
98:47:44:A4:E4:DC
Traceback (most recent call last):
File "/home/bartold/SoundcoreDesktop/SoundcoreDesktop.py", line 70, in
Headphone.connect()
File "/home/bartold/SoundcoreDesktop/SoundcoreAPI.py", line 192, in connect
self.client.connect((self.macaddress, self.Port))
OSError: [Errno 16] Device or resource busy
I found that by adding a pause before trying to reconnect works, i.e. time.sleep(1) added before the return in getPort. I can now see the GUI, but it's not useful.
I don't know what to do next, but I think I might be bypassing something by forcing the macaddress?