azymohliad / watchmate

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

Device is rejected by the app #32

Closed jmevel closed 10 months ago

jmevel commented 10 months ago

Hi !

Today I wanted to flash the newest InfiniTime firmware on my PineTime so I opened WatchMate but it couldn't connect to my existing device. I get the error message Device is rejected by the app.

It seems there's no way delete the device using the app and start again like a fresh new install. I tried to uninstall the app through Discover (I'm under KDE), click on Delete settings and user data then reinstall the app but the device is still listed when I reopen the app !

How can I manually delete my device from WatchMate or maybe fix this issue? I'm not yet very familiar with Linux and Flatpak in general, I can't find where WatchMate's config files are located.

Thanks

azymohliad commented 10 months ago

Hey,

Regarding removing the device, WatchMate itself doesn't store it, bluez manages pairings on a system level. You can remove it via your system Bluetooth Manager.

Regarding the error, before v0.4.4 this could happen if the watch didn't expose necessary BLE characteristics (for example due to older InfiniTime), but if you just reinstalled it from Flathub then it should definitely be the latest, and it doesn't reject the device in app logic anymore. So this error could only occur there because of underlying bluez error. If removing the device won't help, detailed trace logs from bluer might shed some more light:

flatpak run --env=RUST_LOG=infinitime=debug,bluer=trace io.gitlab.azymohliad.WatchMate

(append something like 2>&1 | tee logs.txt to the command to collect logs directly to the file, sorry if that's obvious)

jmevel commented 10 months ago

Thanks a lot for your answer.

I completely forgot the connection should be made at the device level first before being able to interact with the PineTime through Watchmate. Forgetting the watch from the devices list in my OS and adding it again fixed this issue.

Also I don't know why my watch was still under InfiniTime 1.4.0 (from 2021 !)even though I take care of installing almost every new release. Weird...

I'm closing this issue. Thanks again for your help (and I appreciate the extra command to collect logs, I'm a Linux beginner and I didn't know such thing)

azymohliad commented 10 months ago

Awesome! It's good to know that forgetting the bluetooth device fixed the issue. It would make sense to add a shortcut for that to WatchMate, but it doesn't look like bluer (the bluez library I use) exposes an API for that.

I completely forgot the connection should be made at the device level first before being able to interact with the PineTime through Watchmate

You mean like pairing it in via the system Bluetooth Manager? That shouldn't be necessary, I think forgetting it from there, and then adding again directly via WatchMate would work the same way.

Also I don't know why my watch was still under InfiniTime 1.4.0 (from 2021 !)even though I take care of installing almost every new release. Weird...

It looks like you might have missed to validate the firmware from the PineTime settings, see more details here.

jmevel commented 10 months ago

You mean like pairing it in via the system Bluetooth Manager? That shouldn't be necessary, I think forgetting it from there, and then adding again directly via WatchMate would work the same way.

Yes, sorry that's what I mean, I did that using the Bluetooth Manager in the KDE Settings. I think with earlier versions of WatchMate it wasn't possible to add the device directly through the app. At least I remember it wasn't working for me and the first time I used it, it took me a while to figure out I have to add the device using KDE Bluetooth Manager first (I completely forgot about this when I created this issue ticket). I haven't tried adding the device directly in WatchMate again, maybe it's actually working now...

It looks like you might have missed to validate the firmware from the PineTime settings, see more details here.

Thanks, it's exactly what happened, I didn't know the firmware validation feature was automatically resetting the firmware when the device turns off but actually I think I stumbled on a small bug. My firmware definitely reset to 1.4.0 because the watch was off for a while. But in that case it shouldn't show me buttons to validate or reset since it's already reset. Maybe that was just a bug in the old 1.4.0 version that doesn't exist anymore.

Thanks again mate and thanks for all your work on WatchMate 🙏 Keep going, this is a simple but awesome application !

azymohliad commented 10 months ago

Thanks for your kind and encouraging words!