InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.75k stars 941 forks source link

Expose the HeartRate service UUID in BLE ADV packet #895

Closed JF002 closed 2 months ago

JF002 commented 2 years ago

Verification

Pitch us your idea!

Expose the HR service UUID in ADV so that 3rd party application detects the PineTime as a HR device

Description

OpenTracks reported that a PineTime running InfiniTime is not detected as a HR device because the UUID of the HR service is not exposed in the ADV packet.

See https://github.com/OpenTracksApp/OpenTracks/issues/1063 and https://github.com/OpenTracksApp/OpenTracks/pull/1069.

Adding this UUID in ADV would allow companion apps to detect the PineTime as a HR device without needed to connect and discover the services running on the PineTime.

Basically, we would need to add the specific UUID here : https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/src/components/ble/NimbleController.cpp#L162

dennisguse commented 2 years ago

Providing multiple service UUIDs in the ADV packet increases the package size and thus consumes more energy.

trman commented 2 years ago

i don't thinks @JF002 , that not the only things to do (add the UUID ) in order to make infintime a proper HR device :

even if you add the packet ,the heart rate task must be able to function , by taking measure of hr data and sending it , even when the screen is off (it's not the case right now)

Otherwise this change will be misleading since infinitime would say it's a HR device but it would not show proper hr data (most of time it would be 0 ) and the hr data above 0 would be only for the sporadic case when the screen is on (and for maybe only 3 fc too , since the measurement take nearly 20 sec and the screen up time is at most 30 sec)

by the way , since the waspos main dev didn't have received issue about the fact that putting the gain to 8 is bad , maybe it's time for infinitime to put the HR gain to 8 as well (in order to have better and faster measurement)i

vdmkenny commented 2 years ago

@trman the latest infinitime firmware addresses this HR gain issue. https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/1.9.0

trman commented 2 years ago

hi @vdmkenny

that's true at very least , the easiest part have been addressed (the hr gain) and that's good !

Now it would be great if the main part would be adressed as well (add the UUI and the heart rate task function all time , even screen off)

jmaris commented 10 months ago

No movement on this issue? Also is there anywhere we can submit bug bounties for this project?

dennisguse commented 10 months ago

From OpenTracks perspective, the problem is resolved as it now supports to search for any BLE device as heartrate sensor (i.e., not filtering using the advertised services). Kind of inconvenient for the user, but works :)

florisre commented 4 months ago

@jones139 maybe this could help resolve connectivity issues as in https://github.com/OpenSeizureDetector/PineTimeSD/issues/15?

jones139 commented 4 months ago

@jones139 maybe this could help resolve connectivity issues as in https://github.com/OpenSeizureDetector/PineTimeSD/issues/15?

Thank you for thinking about our issue :). I think ours is resolved - we find the HR service ok. Now as long as the watch is not out of range for long enough for the Bluetooth on the watch to shut down, the android app reconnects to it ok. Using a phone with Bluetooth 5 really helps the connection reliability too.