qdomyos-zwift icon indicating copy to clipboard operation
qdomyos-zwift copied to clipboard

[REQ] Improve ANT+ support

Open jwatral opened this issue 2 years ago • 5 comments

Current implementation uses outdated library and has hard to resolve bugs (like #167). As discussed with @cagnulein on Facebook Group, we could improve the ANT+ feature using other library from Garmin. More details to be provided by @cagnulein.

jwatral avatar Sep 25 '22 19:09 jwatral

@jwatral This is our starting page https://www.thisisant.com/developer/ant/ant-in-android

My idea is porting this library inside qz. So for starting you can create a simple Java app that, for example, send fake power and speed to your watch.

Also will be good to read hr by ant+

If it works we can add it to qz quite easily

cagnulein avatar Sep 25 '22 19:09 cagnulein

@cagnulein I did some digging and here are the results:

  • the ANT+ SDK - is only for reading sensor data via multiple ANT+ profiles
  • the ANT SDK does supports custom communications, allows sending data via ANT (but without ANT+ profiles)
  • there are some paid membership options as well, like this:

Note that ANT+ Members can also download the member early release Android ANT+ SDK version P.B2. MO1, which also contains support for FE-C.

FE-C would be extremely useful for us, but I'm not sure if this will cover the server side or only the client one.

Your current implementation is based on ANT SDK (android_antlib_4-14-0.jar), which to my current understanding, is the only one we can really use, without buying membership. What's even more interesting - in the official download page, there seems to be an older version (4-12-0) so really no point in changing the lib.

I've contacted their support and requested an account - let see if they will able to help.

But maybe I missed smth? Btw, are you already ANT member?

jwatral avatar Sep 28 '22 18:09 jwatral

Thanks @jwatral a lot of information that I didn't know!

But maybe I missed smth?

Mmm not really, I guess I were just misinformed

Btw, are you already ANT member?

Nope unfortunately

So our best hope is to fix the current implementation? Maybe it's an easy task: if you want you can easily take my Java file to use in a single project to play with it.

What do you think?

cagnulein avatar Sep 28 '22 18:09 cagnulein

So our best hope is to fix the current implementation?

I think so, yes. But because the power and cadence are working fine, I have high hopes on this ;-)

Maybe it's an easy task: if you want you can easily take my Java file to use in a single project to play with it.

Sure, will do that. Is there an easy way to build the android apk locally? I could then install it on the galaxy S7 and test it right away.

jwatral avatar Sep 28 '22 18:09 jwatral

I think so, yes. But because the power and cadence are working fine, I have high hopes on this ;-)

Yes me too!

Sure, will do that. Is there an easy way to build the android apk locally? I could then install it on the galaxy S7 and test it right away.

You mean the full qz? I don't know if this will be the easiest and quickest thing to do. In my opinion you can just take the Java files and the library and create an android project from scratch on android studio

Anyway if you want to build qz instead, you have to download qt 5.15.2 and build it from qt creator

Let me know if you need help

cagnulein avatar Sep 28 '22 18:09 cagnulein

@jwatral a lot of people point me to https://github.com/starryalley/CSC_BLE_Bridge

cagnulein avatar Oct 09 '22 13:10 cagnulein

@cagnulein afaik, they're using plugin lib, which can only read ant signal from multiple ant+ enabled sensors. I've searched for a bridge from FTMS to FE-C but it doesn't seem to exist.

jwatral avatar Oct 09 '22 13:10 jwatral

@jwatral it seems that this project could solve the hr reading from some garmin ant watches

cagnulein avatar Oct 09 '22 13:10 cagnulein

@nzbrian maybe could you be interested on this too?

cagnulein avatar Oct 10 '22 08:10 cagnulein

closing this, since we already did what it's possible. Thanks @jwatral

cagnulein avatar Oct 20 '22 06:10 cagnulein

Any chance that ANT+ could be further implemented for QZ to allow full bike control (full Smart Trainer functionality through ANT+). There are a few virtual riding platforms that only use ANT+ (for whatever reason).
https://bikethe.world/ https://www.bigringvr.com/

mgarcea avatar Oct 24 '22 20:10 mgarcea

Any chance that ANT+ could be further implemented for QZ to allow full bike control (full Smart Trainer functionality through ANT+). There are a few virtual riding platforms that only use ANT+ (for whatever reason).

https://bikethe.world/

https://www.bigringvr.com/

@jwatral Do you think it could also possible? With a new Java module?

cagnulein avatar Oct 25 '22 04:10 cagnulein

@jwatral I was thinking about the problem that you mentioned yesterday in the email and it can't be a collision because the power is ok over ant+, so it must be something else.

I'm opening this again. Since @mgarcea is also interested it's better to talk here

cagnulein avatar Oct 25 '22 04:10 cagnulein

it can't be a collision because the power is ok over ant+, so it must be something else.

Yeah - but it's still hard to debug. I've already profiled the QZ android app and nothing suspicious there in regards to mem / cpu consumption. Threads seems to be fine as well at the first glance. I had a chance to test it on yet another samsung device with ANT+ and Android 8 (Galaxy A5). The behavior there is different - speed sensor doesn't disconnect every 20 seconds as on Galaxy S7. Instead, the speed reading fluctuates each second between 0.0 and the correct value. And there I can see "chocking" in the logs - I just haven't figure out the cause yet. The power and cadence reading might be more resilient to such drops, because it's not timestamp based and just send current cadence value, cumulativePower, current power and eventCount. Speed sends a timestamp and number of wheel revolutions, which together with wheel circumference gives you a speed. The other things that are different is time period of TX events - 4.04Hz vs 4Hz and number of pages. The ACKNOWLEDGED_DATA message type handling is also missing in SpeedChannelController, haven't found relevant part of profile specification on that yet.

Nonetheless, I think we should separate speed related issues from this ticket and here focus on the improvement suggested.

Do you think it could also possible? With a new Java module?

Do you mean the antpluginlib? It's just for receiver's end. We could try to implement the FE-C profile using current lib, but that will take a while. FE-C profile has a lot of channel pages and obviously requires bi-directional communication with the receiver. I can have a look and try to tinker with FE-C during my attempts to fix speed sensor integration. But there will be a lot of work required to go from PoC to smth you could reliably use during training sessions.

Overall ANT+ seems to be dying slowly, giving way to BLE and DIRCON (especially on mobile devices). The android libs weren't updated since 2015, Samsung abandoned ANT+ support in S22 and Android 11+ has some unresolved issues with ANT HAL. Not sure if it's reasonable to spend that much time on smth no longer supported.

jwatral avatar Oct 26 '22 15:10 jwatral

The power and cadence reading might be more resilient to such drops, because it's not timestamp based and just send current cadence value, cumulativePower, current power and eventCount. Speed sends a timestamp and number of wheel revolutions, which together with wheel circumference gives you a speed.

what if you fix the value in the java code? we should see a fixed value?

Nonetheless, I think we should separate speed related issues from this ticket and here focus on the improvement suggested.

yes go ahead, open a new ticket for this

Overall ANT+ seems to be dying slowly, giving way to BLE and DIRCON (especially on mobile devices). The android libs weren't updated since 2015, Samsung abandoned ANT+ support in S22 and Android 11+ has some unresolved issues with ANT HAL. Not sure if it's reasonable to spend that much time on smth no longer supported.

yeah it's my same feeling

Do you mean the antpluginlib? It's just for receiver's end.

nope of course i mean something else, something to find out :) but I guess this will remain a dream in the @mgarcea mind :D

cagnulein avatar Oct 26 '22 15:10 cagnulein

Yup I get it. Definitely doesn’t seem like it’s worth it. I would think that if those developers want their products to be able to be used in the iOS ecosystem at some point, they will eventually have to implement Bluetooth connectivity for their products.

From: Roberto Viola @.> Sent: Wednesday, October 26, 2022 9:44 AM To: cagnulein/qdomyos-zwift @.> Cc: Garcea, Michele @.>; Mention @.> Subject: Re: [cagnulein/qdomyos-zwift] [REQ] Improve ANT+ support (Issue #953)

The power and cadence reading might be more resilient to such drops, because it's not timestamp based and just send current cadence value, cumulativePower, current power and eventCount. Speed sends a timestamp and number of wheel revolutions, which together with wheel circumference gives you a speed.

what if you fix the value in the java code? we should see a fixed value?

Nonetheless, I think we should separate speed related issues from this ticket and here focus on the improvement suggested.

yes go ahead, open a new ticket for this

Overall ANT+ seems to be dying slowly, giving way to BLE and DIRCON (especially on mobile devices). The android libs weren't updated since 2015, Samsung abandoned ANT+ support in S22 and Android 11+ has some unresolved issues with ANT HAL. Not sure if it's reasonable to spend that much time on smth no longer supported.

yeah it's my same feeling

Do you mean the antpluginlib? It's just for receiver's end.

nope of course i mean something else, something to find out :) but I guess this will remain a dream in the @mgarceahttps://github.com/mgarcea mind :D

— Reply to this email directly, view it on GitHubhttps://github.com/cagnulein/qdomyos-zwift/issues/953#issuecomment-1292246546, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUD5MRBODPSBG4AKTRGCXBTWFFGVZANCNFSM6AAAAAAQVGZWSU. You are receiving this because you were mentioned.Message ID: @.@.>>

mgarcea avatar Oct 26 '22 17:10 mgarcea

@mgarcea i checked the project that you sent and they are already usable with qz! I mean you can download their video from YouTube and use the video feature builtin in qz! Isn't it @Bepo7012 :)

cagnulein avatar Oct 26 '22 17:10 cagnulein

#838 @mgarcea

cagnulein avatar Oct 26 '22 17:10 cagnulein

Ok this is a feature that I have heard about, but not tested myself. I will check it out! I am assuming you mean without a GPX file though?

From: Roberto Viola @.> Sent: Wednesday, October 26, 2022 11:30 AM To: cagnulein/qdomyos-zwift @.> Cc: Garcea, Michele @.>; Mention @.> Subject: Re: [cagnulein/qdomyos-zwift] [REQ] Improve ANT+ support (Issue #953)

@mgarceahttps://github.com/mgarcea i checked the project that you sent and they are already usable with qz! I mean you can download their video from YouTube and use the video feature builtin in qz! Isn't it @Bepo7012https://github.com/Bepo7012 :)

— Reply to this email directly, view it on GitHubhttps://github.com/cagnulein/qdomyos-zwift/issues/953#issuecomment-1292376182, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUD5MRGCJK3GD4NH3AOAY5LWFFTARANCNFSM6AAAAAAQVGZWSU. You are receiving this because you were mentioned.Message ID: @.@.>>

mgarcea avatar Oct 26 '22 17:10 mgarcea

@mgarcea no, with the gpx! I saw in their YouTube channel that he also added the segments so I guess there is also their gpx track

cagnulein avatar Oct 26 '22 17:10 cagnulein

@mgarcea i checked the project that you sent and they are already usable with qz! I mean you can download their video from YouTube and use the video feature builtin in qz! Isn't it @Bepo7012 :)

If gpx and Video is available i see no reason why it should not work. But i have seen no possibility to get the gpx?

Bepo7012 avatar Oct 26 '22 19:10 Bepo7012

Yes, I see a link to a segment on Strava, but I don’t think GPX is available for that specific video.

From: Bepo7012 @.> Sent: Wednesday, October 26, 2022 1:07 PM To: cagnulein/qdomyos-zwift @.> Cc: Garcea, Michele @.>; Mention @.> Subject: Re: [cagnulein/qdomyos-zwift] [REQ] Improve ANT+ support (Issue #953)

@mgarceahttps://github.com/mgarcea i checked the project that you sent and they are already usable with qz! I mean you can download their video from YouTube and use the video feature builtin in qz! Isn't it @Bepo7012https://github.com/Bepo7012 :)

If gpx and Video is available i see no reason why it should not work. But i have seen no possibility to get the gpx?

— Reply to this email directly, view it on GitHubhttps://github.com/cagnulein/qdomyos-zwift/issues/953#issuecomment-1292492470, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUD5MREB5VBFNWFEKYMKEBLWFF6NDANCNFSM6AAAAAAQVGZWSU. You are receiving this because you were mentioned.Message ID: @.@.>>

mgarcea avatar Oct 26 '22 19:10 mgarcea

Yes, I see a link to a segment on Strava, but I don’t think GPX is available for that specific video.

We just need to find the attempt in the segment history :)

cagnulein avatar Oct 26 '22 19:10 cagnulein

Yes, I see a link to a segment on Strava, but I don’t think GPX is available for that specific video.

We just need to find the attempt in the segment history :)

If there is a public one you get the gpx, BUT: gpx and video must match and the attempt is definitely different in speed and therefore in length. So the synchronization between gpx and video Position would be impossible 👎

Bepo7012 avatar Oct 26 '22 19:10 Bepo7012

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 10 '22 19:11 stale[bot]

any news @jwatral ?

cagnulein avatar Nov 11 '22 05:11 cagnulein

@jwatral we have good news for bluetooth sensor to garmin https://github.com/cagnulein/qdomyos-zwift/issues/1044

cagnulein avatar Nov 21 '22 07:11 cagnulein

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 06 '22 11:12 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 21 '22 13:12 stale[bot]