azymohliad / watchmate

PineTime smart watch companion app for Linux phone and desktop
GNU General Public License v3.0
136 stars 4 forks source link

Auto reconnect is not aggressive enough #59

Open TheKrafter opened 4 months ago

TheKrafter commented 4 months ago

After about 30 minutes to an hour of normal usage, the Watchmate eventually disconnects from the pinetime and does not reconnect, until I reopen the app and manually reacan.

This might be fixed by the intermittent scanning mechanism you referenced in #58.

Device: OnePlus 6 Host OS: postmarketOS edge InfiniTime Version: 1.14.0 Watchmate Version: v0.5.1 (native package)

azymohliad commented 4 months ago

Roger that. All the more reason to look into intermittent scanning soon

azymohliad commented 4 months ago

Hi! I've pushed some bluetooth-related fixes in #62, and I think it might be related to this issue too.

I want to include some more fixes and additions into the next release and test it more, so I'm not sure when I'm gonna release it. But if you'd like to try it earlier, you can install this test build from Flathub CI:

flatpak install --user https://dl.flathub.org/build-repo/87429/io.gitlab.azymohliad.WatchMate.flatpakref

UPD: Those fixes are now released as 0.5.2, but auto-reconnection is still not very reliable, and the plan is to implement secure pairing first, and then try another way of reconnection.

magic-ian commented 2 months ago

Sometimes it connects for awhile, other times it disconnects within minutes. All while sitting beside the host device. One time I saw it gave some pre-determined error about rejecting the device or something. I tried to collect logs with flatpak run io.gitlab.azymohliad.WatchMate > watchmate-app.log 2>&1 however there was no output in the file

azymohliad commented 2 months ago

I tried to collect logs with flatpak run io.gitlab.azymohliad.WatchMate > watchmate-app.log 2>&1 however there was no output in the file

Hi! My guess is that WatchMate was already running in the background, so this command merely brought it to foreground. If you click "Quit" from the menu or press Ctrl+Q, then this command should collect the logs properly

magic-ian commented 2 months ago

Right on, that was it. Here are the logs.

Line 1 is when the app first starts. Disconnect occurs with the unresolved GATT services, then it goes into device discovery mode, staying there until intervention. Clicking the device in the UI causes the device discovery to stop and successfully connect. So the first GATT service instance I manually reconnect, and the second time I don't manually reconnect. Second failure occurred within a few minutes of the first.

watchmate.log