dvmarinoff / Flux

Indoor Cycling App for Structured Training
https://flux-web.vercel.app
GNU Affero General Public License v3.0
505 stars 86 forks source link

Heart rate not working with Zwift hub #187

Open koenigderorangen opened 5 months ago

koenigderorangen commented 5 months ago

Currently trying to use the heart rate monitor with my zwift hub, which has the heart rate sensor coupled directly through the hub. Before the update this worked. Since the update, when trying to connect, every sensor is connect through the controllable (which is nice) but the heart rate stays at 0 and when I try to connect it individually with HRM it also shows "0". I've attached the log files. https://flux-dev.vercel.app/ flux-dev.vercel.app-1710957863646.log

dvmarinoff commented 5 months ago

@koenigderorangen Thanks for the report! Will investigate and get in touch tomorrow morning.

The odd thing is that my Polar H10 works connected as an hrm, and the test cases for heart rate data via the trainer also pass.

On a quick look over the logs it seems you are enabling the heart rate readings to come from trainer or device?

koenigderorangen commented 5 months ago

Thanks for the fast reply and effort! Im currently using a Wahoo TICKR through the trainer. When I decouple the HRM from my Hub and directly connect it as a HRM it works! But due to technical limitation on my side the connection is unstable and it would be great to use the coupling through the hub again. Yeah in my test i switched between the HRM from the controllable to the individual HRM but still the trainer as sensor, in hope it would work that way.

dvmarinoff commented 5 months ago

So I did try to debug this, but I currently can't figure out why it is not working.

Both the latest and the old version of Flux use the standard indoor bike data characteristic on the FTMS service to read heart rate from a trainer. This is the way it should happen by the Specification documents. The tests on the parsers pass, the simulator also works. I've changed the label for heart rate from 'hrm' in the old version to 'heartRateMonitor' in the new version, so this might require a manual switch in the settings, but according to the log you already did this and it's the right label. So I am currently out of ideas why it won't work.

dvmarinoff commented 5 months ago

NOTE: I've added the old version 0.1.43 as 'stable' version here: https://flux-stable.vercel.app/, you can fallback to it, but will need to setup heart rate source again in settings (just click it to something else and return it to the device you wish to be reading).