ptx2 / gymnasticon

Make obsolete and/or proprietary exercise bikes work with popular cycling training apps like Zwift, TrainerRoad, Rouvy and more.
https://ptx2.net/posts/unbricking-a-bike-with-a-raspberry-pi
MIT License
297 stars 38 forks source link

Output speed/cadence on ANT+ too for IC4 #75

Open djfjeff opened 3 years ago

djfjeff commented 3 years ago

On my IC4 bike, gymnasticon seems to grab the power and cadence BLE data from my bike successfully. It also seems to output my power data on my Garmin ANT+ stick (connected to gymnasticon Rpi) correctly.

However, it seems it output my cadence over BLE only, I see nothing for cadence over ANT+.

I was under the impression that it would also output the cadence over ANT+ too so I could use it elsewhere.

Is that a misconfiguration on my end or is it the expected behaviour?

djfjeff commented 3 years ago

Also, it seems that while my bike output speed over BLE, gymnasticon take a hold of the BLE connection but does not retransmit speed at all (either over BLE or ANT+). So my speed data is not available anymore.

So ideally, it would look like this for the IC4 bike :

This way, the data could be used by multiple endpoint (watch, laptop and bike computer).

Thanks,

ptx2 commented 3 years ago

Hi!

Re: cadence not working.

Currently we output:

In theory, you should get cadence if you're getting power. Can you share details on your setup so we can investigate further? e.g. which app/device, versions, OS version, bike firmware versions, gymnasticon version, and any screenshots and logs or other info you think relevant.

Re: outputting speed.

The reason Gymnasticon does not output speed is because in most cases the app (e.g. Zwift) knows more (hill grade, weather, etc.) and can calculate a more accurate value. We could pretty easily pass it along if there is a need for it, though. Can you share a little more how you're using the speed value?

djfjeff commented 3 years ago

Hi,

The main reason for speed data is simple : I don't use Zwift or other apps right now, so I have no way of getting this data on my watch any other way.

I know this is not a perfect metric (power is not too as every spin bike "estimate" this number too) but I like having it to compare between run.

Also, my IC4 bike console display started to do weird stuff so I guess it might go out someday.

The reason why I also want everything broadcasted on ANT+ is I would like to link multiple display in the future (my watch and maybe a laptop screen to replace my bike console display).

Thanks for your work!

ptx2 commented 3 years ago

Ah ok, that makes sense. I think it shouldn't be too hard to capture speed and pass it along.

You also mentioned you were having problems getting cadence data via ANT+? Both power and cadence are broadcast over ANT+ in the Bike Power Profile. Can you share more details? e.g. which device are you using, does it just show 0 cadence or something else, etc.?

djfjeff commented 3 years ago

Thanks for taking the time to check for speed data.

For cadence, let me double check, it might be an error I made on my end. On my Garmin watch, the sensor is called Power so I assumed it was only power data, so I also linked the BLE cadence sensor to get cadence.

I will try with only the Power sensor to see if it will provide the cadence also.

djfjeff commented 3 years ago

Ok, you were right about the Power/Cadence stuff. I did a test and linking only the Power ANT+ sensor provide BOTH power and cadence, so no need to also link the Cadence BLE sensor.

So I would only miss the speed broadcasted on ANT+ to complete my setup!

djfjeff commented 3 years ago

I also think it would be great to broadcast a "normal" Speed/Cadence sensor over ANT+ also (in addition to the Bike Power profile) because many watches from Garmin does not support power profile and only support the "normal" Speed/Cadence sensor (namely the Vivoactive 3/4, Venu, low budget Forerunner, etc).

ptx2 commented 3 years ago

Some thoughts:

I plan to look at this but I have limited time right now. I'll of course accept a PR if anyone wants to jump on it sooner, and will offer any help/feedback needed!

nealjane commented 3 years ago

one of these may work, they State they provide ‘power’ to non power Garmin watches...

https://apps.garmin.com/de-DE/apps/c7a333a6-278b-47c6-b65b-205ec484150c (Image below) This you might need to turn off Bluetooth on watch to stop this one connecting to gymnastic on Bluetooth rather than ant+

Or

https://apps.garmin.com/en-US/apps/70f1aea3-f1d3-47f6-b7aa-23f029a75e3b#0

IMG_1541

djfjeff commented 3 years ago

@nealjane yes, they might work but the power field is outside the Garmin world, in a sense, it is not used by anything Garmin (training status, training load, etc). It is useful to show the power on non-power watch however.

bthaler1 commented 3 years ago

I'd just like to express my interest as well for adding speed data to the ANT+ and BLE outputs. I also use Gymnasticon without Zwift, connected to a Peloton. I'm not sure about the IC4, but for Peloton it looks like speed can be calculated as a function of power like this: Let r = sqrt(P). For P < 26, S = 0.057 - 0.172 r + 0.759 r^2 - 0.079 r^3 For P >= 26, S = -1.635 + 2.325 r - 0.064 r^2 + 0.001 r^3 (Copied from https://ihaque.org/posts/2020/12/25/pelomon-part-ib-computing-speed)

screetch82 commented 3 years ago

Hi thx for the great tool. I used this on an IC4 and also a Garmin watch to record all my stats. Now Garmin can connect to IC4 via BLE to get Speed, Distance, RPM i think. However Watts is only recorded in Garmin when it is provided via ANT+

So when I used gymnasticon I connected the IC4 to Gymnasticon instead of the garmin watch. and added the cadence and power as separate sensors in garmin. However speed is indeed now missing as a separate sensor.

It would be good to just output the value the IC4 actually transmits via Ant+
This can be added as a third separate sensor in Garmin for the people who need it. I dont think this needs calculating as normally the IC4 already outputs the speed via BLE. Its just needs to be passed through via Ant+

See screenshot that the Power output finally enables some cycling statistics in Garmin:

image

nealjane commented 2 years ago

@bthaler1 @screetch82 - guys, we could really do with you guys to be testing the speed function Chris has been working on over the past week?? Link above -

screetch82 commented 2 years ago

Hi will do. Didnt notice there is an update. I have been using an extra speed sensor. However I had to fake tune the wheel radius so the sensor output matches with what the spin bike display would say. .. not sure if that will be an issue if the fix assume a certain tire size. since the spin bike actually provides speed info the Gymnasticon and that just has to be passed on

screetch82 commented 2 years ago

HI, can confirm it works fine with Garmin . I used my Garmin edge to add power and speed/cadence sensor from Gymnasticon

image