-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
BLE: announce heart rate service in ADV packet. #897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I can't tell if it's doing anything different - but I built and pushed this change, and nothing is broken. |
|
i have tested and don't seem to resolve the initial issue : |
|
@trman Thanks for testing! What I did: Disclaimer: Again lack of test device and I never used nimble and don't have local setup to compile Infinitime. |
|
Side note: I don't know if Android parses all service UUIDs from an ADV packet. |
|
It's usually not Android, it's the app - that can then reason about a device. Though instead of advertising more, OpenTracks could check for the service and use it if found. |
|
@Avamander About a year ago I thought exactly the same, but sadly that's not true. |
|
It is true, you can filter beacons for the devices you're looking for and then initiating a service discovery. Alternatively, let the user pick a device and then do it. Costly or not, it doesn't matter in that case. |
|
so , @dennisguse , @JF002 , here another test with the nightly of opentracks (add an toogle in order to not filter uuid of bluetooth device when searching hr devices) case infinitime is securely connected with gadgetbridge:
case infinitime is disconnected of gadgetbridge:
for what is see , it can show three things:
|
|
@trman That is expected - most devices do not send AVD when connected to some other application/ device. PS/ RunnerUp also filters by AVD UUID: https://github.com/jonasoreland/runnerup |
Hi , @dennisguse , @JF002 Since @dennisguse , said RunnerUp also filters by AVD UUID so here is the test with RunnerUp (from fdroid) : case infinitime is securely connected with gadgetbridge: case infinitime is disconnected of gadgetbridge: for what is see , it can show two things:
it's seem that RunnerUp do/may use another way (that complement/replace uuid) to connect to hr device , (and that way work without the need to disconnect of gadgetbridge) maybe opentracks dev should use a similar way it may be related to the CompanionDevice API ( that gadgetbridge use as well) that allow to share the fc to other apps |
|
I guess in the end this PR's behaviour is fine, but I have a few small concerns with how it'll behave in the future. The PR's behaviour would be nice to test with the encrypted+secured connection flag on the characteristic, because that is on the future roadmap to only allow secure methods of accessing the PT. It doesn't have to be done now, but it seems like it might break. |
|
@trman GB simply does service discovery for each interesting device, attaches itself to what it can understand. It doesn't care too much about only the adv. beacon like the other apps in question. |
|
well @Avamander as far this new uuid seem concerned , runnerup is more up to task for the secure connection than opentracks (at least for now ) with the new uuid the next version of opentrack may allow to search device device without filtering |
@Avamander it seem you are mistaken about the paring : as per this https://developer.android.com/guide/topics/connectivity/companion-device-pairing and https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Companion-Device-pairing it's not a pre requirement but it seem allow a faster connection with it than without.
i only written what i have see when gadgetbrigde is connected or not with opentrack and runnerup . And it seem that it have some impact on opentracks but not in runnerup when GB is connected. |
|
@trman Well in some ways CDM is "faster" and "more secure" but not in the ways you're thinking or we're talking. Stability wise, definitely not better, sucks major **** with dual-protocol devices. |
|
Gentlemen, please try to stay focus on the topic of this PR : add the HR service UUID in the advertising package so companion apps can detect the PineTime as a HR device without having to start the service discovery procedure. InfiniTime allows only 1 connection (that's why opentracks cannot see the PineTime once it's connected to Gadgetbridge), does the HR acquisition only when the display is ON and do not implement CDM. Those are known behaviors and out of the scope of this PR. Please open new issues or comment the existing ones if you want to talk about those topics. In my opinion, the only info we need here is to check that the UUID this PR adds to the advertising packet is the one expected by companion apps to detect a HR sensor. |
as far i'am concerned , @JF002 , i have done an exhaustive tests that allow to check if uid is read in opentracks (and as requested runnerup)
in order to not have misunderstanding , i'am testing with gadgetbridge and without because user might not understand why it's not working when gadgetbridge is activated. so what you think might be 'obvious' , can very well not be obvious to user.... the same can be said for the hr active only screen ON , because , at first when i tested with fitotrack i was astonished it didn't work when it was said that infinitme was a hr device.... |
|
in order to have a conclusives tests, i will add shortly a test with opentracks and runnerup without this pr (well it's more for runnerup actually ) in order to check if runnerup do retreive the adv beacon or not |
|
here is the test WITHOUT this pr @JF002 : so here is the test with RunnerUp (from fdroid) : case infinitime is securely connected with gadgetbridge: case infinitime is disconnected of gadgetbridge: |
|
@JF002 @dennisguse |
|
@trman this patch would just enable OpenTracks to search for the device for device selection; once the MAC address is stored, the ADV packages are not used anymore. Relevant code from RunnerUp: |
|
@trman I'll repeat for the last time : we know that InfiniTime accepts only 1 connection, we know InfiniTime acquires HR data only when the display is ON. This is confusing for you and other users, right. So let's talk about those topics in their respective issues and/or PR. This PR does not cover these points so please STOP mentionning them in each and every one of your comment. It only add noise and confusion in this simple "5 lines" PR. And I also repeat : the only thing that matters here is : are companion apps that only parse the ADV packet (like OpenTracks) able to detect InfiniTime as a HR device. Which means that RunnerUp is not covered by this PR as it checks for paired device. |
@JF002 id'nt know this : it was dennisguse that said that runnerup was using uuid , otherwise i would not have bothered do a test for it
|
|
my conclusion after all these test : |
|
How can we proceed from here? @trman Could you record an ADV package (e.g.g, using PS/ today I ordered a PineTime, but will take up to 6 weeks 🤷 |
|
@dennisguse Sorry for the delay, I got busy on other things and on releasing 1.8 :) So, I did some test, and I have to admit I'm a bit confused: Using your branch, the display would display nothing... I'm not sure why... Then I applied your changes on current develop, and InfiniTime ran correctly, but advertising did not seem right. And the same screenshot with your changes: As you can see, there UUIDs disappeared completely, which is obviously not what we expected. I also tried by adding only the HR UUID to check that it works correctly with OpenTracks : it works! And OpenTracks lists my PineTime even when "Only show Bluetooth devices that announce required services" is enabled 👍 |
|
@JF002 No worries; thanks for testing! |
|
I'll try to do more tests when I get the time. |
|
Side not: the heart rate service UUID is already defined in HeartRateService.h and should probably be taken from there. And I checked the nimble code and the relevant code that prepares the ADV is this function |
|
@JF002 I now got a sealed PineTime and could do some testing. |
|
@dennisguse We can of course continue to work on this PR. Unfortunately, I haven't had the opportunity to do more tests since my last comment :/ |
@dennisguse did you have tried to do , with your sealed pinetme , some test of your code? it would make recover the dfu much easier if the dfu installed go wrong |
|
@trman Sadly, no and time is at a premium the next 2-3 month. |
|
Anybody willing to pick this up again? I am happy to help in testing! |



Fixes #895.
Not tested due to lack of device.
Did not test compiling locally :)