theironrobin / siglo

GTK app to sync InfiniTime watch with PinePhone
Mozilla Public License 2.0
154 stars 21 forks source link

Getting persistant pairing working #64

Closed kq98 closed 3 years ago

kq98 commented 3 years ago

Changes:

theironrobin commented 3 years ago

thanks, i can focus on this more now that we have siglo on flathub.

Undef-a commented 3 years ago

I just tested this patch, but get the following output:

[mac] Connected
[mac] Connection failed: Disconnected early

The watch never seems to connect at all. The Bluetooth indicator doesn't show and the firmware/battery level never appear in the app.

kq98 commented 3 years ago

Does this error appear as well when you don't set the 'keep paired' switch?

Undef-a commented 3 years ago

Turns out between me raising the bug and now, it's stopped being an issue. Not sure why, but it's now remaining connected and reconnecting if it does disconnect.

When the issue was happening, the keep paired switch made no difference. The same error/output for either setting.

kq98 commented 3 years ago

Ok thanks for your notice anyway. Since I have not encountered this myself before, and unless someone can figure out what triggers it, I can only guess but I didn't change the way a connection is established therefor this should be intrinsic to Siglo or Infinitime but not my changes in particular.

okennedy commented 3 years ago

I just tested this patch, but get the following output:

[mac] Connected
[mac] Connection failed: Disconnected early

The watch never seems to connect at all. The Bluetooth indicator doesn't show and the firmware/battery level never appear in the app.

I was just experiencing a similar issue. Not sure if it's the same, but it looks like de-pairing the pinetime leaves the watch in a state that doesn't permit new connections (at least not from the same pinephone) until the watch is rebooted.

kq98 commented 3 years ago

How did you de-pair the watch? Did you quit Siglo, crash Siglo, walk out of range or used bluetoothctl? Because I tested all of these with my Pinephone as well as my working machine but could not reproduce the mentioned behavior. I'm using a braveheart Pinephone with Mobian nightly.

Secondly am I understanding this correctly that this occurs reliably every time you de-pair the watch? Or only occasionally?

okennedy commented 3 years ago

I removed the pairing under bluetooth settings in the process of trying to debug some other things. Every attempt to re-pair the watch (both with this patch and the main branch and the current flatpak release) caused a "Disconnected early" error until I rebooted the watch. (I was able to reproduce this bug at least once)

For reference, this is with a recently updated mobian/phosh and InfiniTime 1.3.

theironrobin commented 3 years ago

I removed the pairing under bluetooth settings in the process of trying to debug some other things. Every attempt to re-pair the watch (both with this patch and the main branch and the current flatpak release) caused a "Disconnected early" error until I rebooted the watch. (I was able to reproduce this bug at least once)

For reference, this is with a recently updated mobian/phosh and InfiniTime 1.3.

Do we think this is an Infinitime issue or a siglo issue?

Undef-a commented 3 years ago

I've got nothing to confirm this, but my feeling is Infinitime. There is a known BLE bug they are working on which matches this and the solution every time for this is to reset my watch and re-pair in Siglo. I don't even need to restart the app most times.

theironrobin commented 3 years ago

I think users do expect connection to persist on app close but this PR is a step in the right direction! THANKS!