zacharyedwardbull / pycycling

A Python package for interacting with Bluetooth Low Energy (BLE) compatible bike trainers, power meters, radars and heart rate monitors
https://pypi.org/project/pycycling/
MIT License
126 stars 25 forks source link

indoor_bike_data: Calculation of cadence is incorrect #32

Closed wklenk closed 9 months ago

wklenk commented 9 months ago

Please check the calculation of cadence in file _pycycling/ftms_parsers/indoor_bikedata.py

To get the value for _instantcadence and _averagecadence, the value is divided by 2. I think it has to be divided by 10 instead.

See https://github.com/oesmith/gatt-xml/blob/master/org.bluetooth.characteristic.indoor_bike_data.xml

zacharyedwardbull commented 9 months ago

Hey, thanks for raising this issue.

I'm not very familiar with this protocol, @tensorturtle would you mind taking a look?

Cheers

tensorturtle commented 9 months ago

@wklenk Thanks for raising this issue. From the gatt-xml link you shared, I see this relevant line: https://github.com/oesmith/gatt-xml/blob/4fd2ede1d3da9365fdc6dec89290c346581a03f9/org.bluetooth.characteristic.indoor_bike_data.xml#L117-L119 In my understanding, a resolution of 0.5 means there are 2 measurements per 1 RPM, meaning we must divide the measurement by 2 to get the RPM. Could you expand on your reasoning for multiplying by 10 instead of 2?

In my real-world tests with my smart trainer I believe I got the correct RPM but re-testing is possible.

tensorturtle commented 9 months ago

@zacharyedwardbull Close because real values are correct on Elite Suito trainer using FTMS