jonasoreland / runnerup

A open source run tracker
GNU General Public License v3.0
735 stars 273 forks source link

Pebble integration seems to have stopped #1076

Open bhndrcks opened 2 years ago

bhndrcks commented 2 years ago

Since the 2.4.3.1 release, the integration with Pebble smartwatches has quit working. Tested on a OnePLus Nord N10 (android 11) and Motorola G7 (android 10) with Pebble Time Round and Pebble 2 HR.

Latent-Logic commented 2 years ago

Hitting the same issue with a Pixel 4a and Pebble Time Steel

gerhardol commented 2 years ago

There are no intentional changes to Pebble, this could be related to library updates etc for targeting Android 11 and to allow Android 12. That cannot be undone (Google only accepts Android 11 now.) Can you try the 2.4.1 release on GitHub to see if it is the targeting that is the issue? (That is a downgrade, you need to export the db, move it somewhere else before installing.) (I have no Pebble to test with.)

Latent-Logic commented 2 years ago

I downgraded to v2.4.1.0 from github and can confirm that the connection to my Pebble watch works again.

bhndrcks commented 2 years ago

Same, v2.4.1.0 version connects to Pebble (and I get that java error again)

gerhardol commented 2 years ago

I have added two releases to https://github.com/gerhardol/runnerup/releases They both have the same version as the current Play release (and are signed the same)

2.4.3.2 reverts a BLE change (it is not possible to find BLE pulse belts due to this). This change should be related to the find phase though.

2.4.3.3 targets Android 11. If this is the issue, the library providing support for Pebble cannot handle Android 11 The lib is open source, but has not been updated since 2016 so it could be broken. https://github.com/pebble/pebble-android-sdk/commits/master Unfortunately, targeting Android 11 may cannot be reverted (cannot be published on Play, Google requirement).

Latent-Logic commented 2 years ago

Can confirm that 2.4.3.3 works but 2.4.3.2 does not.

gerhardol commented 2 years ago

A 2.4.4.0 release is added, added to Play beta too (when Google approves). The support for Huami devices is disabled by default, so Pebble should work again - I cannot test.

Latent-Logic commented 2 years ago

Unfortunately the 2.4.4.0 version does not work with the Pebble watch. I have downgraded back to 2.4.3.3 and it still works.

gerhardol commented 2 years ago

Someone need to review the changes and debug to get this going...

sv2ramanan commented 2 years ago

I can confirm that the huami (Amzfit) Bip S works with the 2.4.4.0 release, if and only if the "Paired" in the menu is enabled. Unfortunately, I dont have a Pebble.

Latent-Logic commented 2 years ago

I'm not super familiar with Android development but I ran adb logcat for the org.runnerup process on two different versions and here are the logs from launching and then exiting the app: logcat_2.4.3.3.txt logcat_2.4.4.0.txt

Sadly I'm not sure that this will be helpful looking at the logs, but figured I'd share anyhow. Here are the additional lines:

E ActivityThread: Failed to find provider info for com.getpebble.android.provider.basalt
E ActivityThread: Failed to find provider info for com.getpebble.android.provider

And then the TrackerComponentCollection: PEBBLE onInit => RESULT_OK is instead RESULT_NOT_SUPPORTED

Let me know if there's any other debugging I can run that might be helpful

gerhardol commented 2 years ago

Please check that "Paired devices is not set in HR sensors option menu too.

While RU is extremely chatty in the log, it does (fortunately normally) not any information about not included devices. Trying to find a BLE HR sensor may have some input, but I cannot say right now what to search for.

Maybe someone can review the code changes I did and compare it with pre-Huami and 2.4.3.3 to see why Pebble is not working? The intention is that if not the option is set, that the behavior should be as before Huami. But me staring on these source lines again some more hours is not helping...

sv2ramanan commented 2 years ago

I'll review the code tomorrow, but may be out of my depth

sv2ramanan commented 2 years ago

Did a first pass review, cant locate the problem. Cant help feeling it has something to do with pairing - I presume the Pebble device is paired with the phone via bluetooth (Bluetooth or BLE?), and presumably transmits HR to the phone via Bluetooth/BLE broadcast. Somehow this differs from Huami devices, but cant discover why. I will look some more in the weekend

gerhardol commented 2 years ago

Did a first pass review, cant locate the problem. Cant help feeling it has something to do with pairing - I presume the Pebble device is paired with the phone via bluetooth (Bluetooth or BLE?), and presumably transmits HR to the phone via Bluetooth/BLE broadcast. Somehow this differs from Huami devices, but cant discover why. I will look some more in the weekend

I cannot see why the pre Huami behavior is not restored if Paired devices is not set. Pebble devices and these devices will not work at the same time.

wertarbyte commented 1 year ago

I stumbled over this issue while trying to resurrect the sports tracker functionality of my Pebble Time Steel - with the old apk of 2.4.1, the smartwatch (coupled with the latest release of Gadgetbridge) immediately switches to the 'sports' display once RunnerUp starts, any later version just does trigger this behaviour.

Is there anything I can do to help with this?

Where is this "Paired Devices" checkbox previous messages talk about, I guess it moved somewhere else during the last years?

This is what I find in logcat:

02-28 22:11:45.265  1819  2219 I Quality : LaunchTime2.0: org.runnerup.free/org.runnerup.view.MainLayout 1 494
02-28 22:11:45.266 21189 21189 E ActivityThread: Failed to find provider info for com.getpebble.android.provider.basalt
02-28 22:11:45.267 21189 21189 E ActivityThread: Failed to find provider info for com.getpebble.android.provider
02-28 22:11:45.267 21189 21189 E TrackerComponentCollection: PEBBLE onInit => RESULT_NOT_SUPPORTED
02-28 22:11:45.267 21189 21189 E TrackerComponentCollection: HRM onInit => RESULT_UNKNOWN
bhndrcks commented 1 year ago

I retired all my Pebbles over this issue - the newer versions of Android simply don't support the Pebble OS anymore, or maybe its vice-versa

On Tue, Feb 28, 2023 at 3:30 PM Stefan Tomanek @.***> wrote:

I stumbled over this issue while trying to resurrect the sports tracker functionality of my Pebble Time Steel - with the old apk of 2.4.1, the smartwatch (coupled with the latest release of Gadgetbridge) immediately switches to the 'sports' display once RunnerUp starts, any later version just does trigger this behaviour.

Is there anything I can do to help with this?

Where is this "Paired Devices" checkbox previous messages talk about, I guess it moved somewhere else during the last years?

— Reply to this email directly, view it on GitHub https://github.com/jonasoreland/runnerup/issues/1076#issuecomment-1448863224, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWSAYS3WCXJZTYGO6APFF5LWZZN5NANCNFSM5IKGYQIQ . You are receiving this because you authored the thread.Message ID: @.***>

wertarbyte commented 1 year ago

What confuses me is that it works fine with the older apk - so it doesn't seem to be a fundamental issue of the OS.

wertarbyte commented 1 year ago

It seems like the result fails somewhere here:

https://github.com/jonasoreland/runnerup/blob/7e9b24310a58d1b34349529a45f57e0e67966e5b/app/src/main/org/runnerup/tracker/component/TrackerPebble.java#L70

Maybe the next release could add some more debugging statements there to distinguish the cases caught be the condition?

gerhardol commented 1 year ago

The Huami changes are likely the reason. The upcoming 2.5 (join beta to try it) has some adaptions to newer Androids, I doubt it will make a change. Debugging with printouts in a release will be extremely slow progress. It is not that hard to setup Android Studio to add printouts.