azymohliad / watchmate

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

Watch did not get Time Updated #13

Open kop316 opened 1 year ago

kop316 commented 1 year ago

Hello!

When I used the Android Pinetime sync program, it was able to sync the time to the Pinetime automatically. It would be nice if Watchmate could do the same.

EDIT: Sorry, it looks like it is a feature, but for some reason it did not happen for me. I am using PureOS Byzantium.

azymohliad commented 1 year ago

Hm.. It is a feature, yes. It's hard to say why it didn't work, I haven't seen it before. Could you try to run it from the terminal, and see if there's any error in the output?

kop316 commented 1 year ago

This is what I see

purism@pureos:~$ flatpak run io.gitlab.azymohliad.WatchMate

(watchmate:2): GVFS-WARNING **: 20:48:21.516: The peer-to-peer connection failed: Error when getting information for file “/run/user/1000/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(watchmate:2): GVFS-WARNING **: 20:48:21.520: The peer-to-peer connection failed: Error when getting information for file “/run/user/1000/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(watchmate:2): GVFS-WARNING **: 20:48:28.252: The peer-to-peer connection failed: Error when getting information for file “/run/user/1000/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.
[INFO  watchmate::ui::devices] InfiniTime (XXXXXX) is already connected
[INFO  watchmate::ui] Device connected: XXXXXX
[INFO  watchmate::ui] PineTime recognized

(watchmate:2): Gtk-WARNING **: 20:48:53.252: Failed to fetch network locations: Timeout was reached

(watchmate:2): Gtk-WARNING **: 20:48:53.252: Failed to fetch network locations: Timeout was reached

(watchmate:2): Gtk-WARNING **: 20:48:53.255: Failed to fetch network locations: Timeout was reached
azymohliad commented 1 year ago

Hm.. I don't see any errors coming from the WatchMate directly, so guess it might be related to the GVFS warning (UPD: it's not, disregard the rest of this comment). Did you try if suggested permission helps?

flatpak run --filesystem=xdg-run/gvfsd io.gitlab.azymohliad.WatchMate

I don't yet know which dependency uses GVFS, and I'm confused why I don't get these warnings on my system then. Will investigate

azymohliad commented 1 year ago

It seems there are more people experiencing this issue. If anybody can reproduce it, could you please try running it with RUST_LOG=infinitime=debug environment variable, and see if you have the line starting from the following in the output:

[DEBUG infinitime::bluetooth::services] CharacteristicReadRequest

This would indicate that the watch is requesting the time from the companion app.

For flatpak package the full command is:

flatpak run --env=RUST_LOG=infinitime=debug io.gitlab.azymohliad.WatchMate
stusmall commented 1 month ago

I was able to reproduce it. The logs didn't seem to have anything interesting:

[nix-shell:~]$ RUST_LOG=infinitime=debug watchmate
[ERROR watchmate::ui::devices] Failed to start GATT server: Bluetooth operation failed: Failed to create entry in database
[INFO  watchmate::ui::devices] Trying to connect to InfiniTime (DE:B2:CE:63:F2:93)
[INFO  watchmate::ui] Device connected: DE:B2:CE:63:F2:93
[DEBUG infinitime::bluetooth::device] Characteristics: [
        00002a46-0000-1000-8000-00805f9b34fb,
        00002a26-0000-1000-8000-00805f9b34fb,
        00030002-78fc-48fe-8e23-433b3a1942d0,
        00002a0f-0000-1000-8000-00805f9b34fb,
        00002a25-0000-1000-8000-00805f9b34fb,
        00030001-78fc-48fe-8e23-433b3a1942d0,
        00001531-1212-efde-1523-785feabcd123,
        00000002-78fc-48fe-8e23-433b3a1942d0,
        00001534-1212-efde-1523-785feabcd123,
        00002a24-0000-1000-8000-00805f9b34fb,
        00002a06-0000-1000-8000-00805f9b34fb,
        00000009-78fc-48fe-8e23-433b3a1942d0,
        00002a28-0000-1000-8000-00805f9b34fb,
        0000000b-78fc-48fe-8e23-433b3a1942d0,
        00010001-78fc-48fe-8e23-433b3a1942d0,
        00002a27-0000-1000-8000-00805f9b34fb,
        adaf0100-4669-6c65-5472-616e73666572,
        00000001-78fc-48fe-8e23-433b3a1942d0,
        00010002-78fc-48fe-8e23-433b3a1942d0,
        00002a05-0000-1000-8000-00805f9b34fb,
        00002a29-0000-1000-8000-00805f9b34fb,
        00000008-78fc-48fe-8e23-433b3a1942d0,
        00010004-78fc-48fe-8e23-433b3a1942d0,
        00020001-78fc-48fe-8e23-433b3a1942d0,
        00002a2b-0000-1000-8000-00805f9b34fb,
        00002a19-0000-1000-8000-00805f9b34fb,
        00000005-78fc-48fe-8e23-433b3a1942d0,
        00001532-1212-efde-1523-785feabcd123,
        adaf0200-4669-6c65-5472-616e73666572,
        00002a37-0000-1000-8000-00805f9b34fb,
        00000007-78fc-48fe-8e23-433b3a1942d0,
        00000003-78fc-48fe-8e23-433b3a1942d0,
        00050001-78fc-48fe-8e23-433b3a1942d0,
        00000006-78fc-48fe-8e23-433b3a1942d0,
        0000000a-78fc-48fe-8e23-433b3a1942d0,
        00000004-78fc-48fe-8e23-433b3a1942d0,
        00010003-78fc-48fe-8e23-433b3a1942d0,
        0000000c-78fc-48fe-8e23-433b3a1942d0,
    ]
[INFO  watchmate::ui] PineTime recognized
[INFO  watchmate::ui::devices] Discovery started
[INFO  watchmate::ui] PineTime disconnected
[INFO  watchmate::ui::devices] Discovery stopped
[INFO  watchmate::ui] Device connected: DE:B2:CE:63:F2:93
[DEBUG infinitime::bluetooth::device] Characteristics: [
        00002a37-0000-1000-8000-00805f9b34fb,
        00000004-78fc-48fe-8e23-433b3a1942d0,
        00001534-1212-efde-1523-785feabcd123,
        00002a06-0000-1000-8000-00805f9b34fb,
        00002a28-0000-1000-8000-00805f9b34fb,
        00000001-78fc-48fe-8e23-433b3a1942d0,
        00000006-78fc-48fe-8e23-433b3a1942d0,
        00010002-78fc-48fe-8e23-433b3a1942d0,
        00002a2b-0000-1000-8000-00805f9b34fb,
        00000002-78fc-48fe-8e23-433b3a1942d0,
        00050001-78fc-48fe-8e23-433b3a1942d0,
        0000000c-78fc-48fe-8e23-433b3a1942d0,
        adaf0200-4669-6c65-5472-616e73666572,
        00030001-78fc-48fe-8e23-433b3a1942d0,
        00002a19-0000-1000-8000-00805f9b34fb,
        00002a05-0000-1000-8000-00805f9b34fb,
        00000009-78fc-48fe-8e23-433b3a1942d0,
        00002a26-0000-1000-8000-00805f9b34fb,
        00020001-78fc-48fe-8e23-433b3a1942d0,
        00000005-78fc-48fe-8e23-433b3a1942d0,
        00002a27-0000-1000-8000-00805f9b34fb,
        00001531-1212-efde-1523-785feabcd123,
        0000000a-78fc-48fe-8e23-433b3a1942d0,
        00010001-78fc-48fe-8e23-433b3a1942d0,
        00002a0f-0000-1000-8000-00805f9b34fb,
        00010004-78fc-48fe-8e23-433b3a1942d0,
        00030002-78fc-48fe-8e23-433b3a1942d0,
        00002a25-0000-1000-8000-00805f9b34fb,
        00002a24-0000-1000-8000-00805f9b34fb,
        00002a46-0000-1000-8000-00805f9b34fb,
        00002a29-0000-1000-8000-00805f9b34fb,
        adaf0100-4669-6c65-5472-616e73666572,
        00000007-78fc-48fe-8e23-433b3a1942d0,
        00000008-78fc-48fe-8e23-433b3a1942d0,
        0000000b-78fc-48fe-8e23-433b3a1942d0,
        00010003-78fc-48fe-8e23-433b3a1942d0,
        00001532-1212-efde-1523-785feabcd123,
        00000003-78fc-48fe-8e23-433b3a1942d0,
    ]
[INFO  watchmate::ui] PineTime recognized
[INFO  watchmate::ui::notifications] Notification session started
[INFO  watchmate::ui::notifications] Notification session stopped
azymohliad commented 1 month ago

Thanks @stusmall! In your case this line is the key:

[ERROR watchmate::ui::devices] Failed to start GATT server: Bluetooth operation failed: Failed to create entry in database

So Current Time Service didn't start at all, and it looks like this issue with Bluez 5.74 and 5.75, which should be fixed in 5.76. Could you please check which version of Bluez you are running?

The original issue that @kop316 had is different though. There's no GATT server failure there, so that is something else.