cagnulein / qdomyos-zwift

Zwift bridge for smart treadmills and bike/cyclette
https://www.qzfitness.com/
GNU General Public License v3.0
383 stars 110 forks source link

Cadence (spm) on Zwift Erratic and Inaccurate. #626

Closed brumohr closed 1 year ago

brumohr commented 2 years ago

Describe the bug Cadence in SPM is very erratic and inaccurate on Zwift particularly at running speeds above 5 kph. Below 5 kph Zwift begins to display accurate SPM. Note that cadence RPM on the QZ is always accurate and very stable.

To Reproduce Steps to reproduce the behavior:

  1. Create Meetup on Zwift
  2. Pair QZ as bike in Zwift; Join meetup; pair QZ to Zwift in run mode.
  3. Tap QZ Start/Pause to change from Pause to Start.
  4. Using Myrun speed paddle increase speed slowly to 5 kph while monitoring SPM on Zwift. SPM on Zwift increases and fairly stable.
  5. Increase run speed to 6 kph. SPM on Zwift drops down to near zero and becomes erratic reading below 50 spm. QZ cadence rpm is good.
  6. Decrease speed to below 5 kph and SPM on Zwift becomes accurate and somewhat stable again.

Expected behavior Zwift SPM should be stable and accurate throughout run speed range.

Desktop:

Smartphone:

Append a debug log debug-Thu_Jan_27_09_11_26_2022.log

cagnulein commented 2 years ago

@CiccioFritz did you see something similar too?

CiccioFritz79 commented 2 years ago

@cagnulein no, sorry, from my side (runner) cadence is exaclty what my belt (Garmin Run) read and transmit.

I had in the past only some problem with bluetooth communication (about cadence): i resolved a lot of problems with this dongle:

https://www.amazon.it/TP-Link-UB400-Adattatore-Bluetooth-Compatibile/dp/B07NQ5YGDW/ref=sr_1_4?crid=2AH5MMUT7GISP&keywords=BT400&qid=1643362159&sprefix=bt400%2Caps%2C77&sr=8-4

I understanded that a BT 4.0 works lot better than a BT5.0. Maybe could be some communication problem.

brumohr commented 2 years ago

I suspect that the erratic cadence that I am seeing on zwift may be bluetooth related. There seems to be quite a few people having BT related issues https://forums.zwift.com/t/bluetooth-improvements-for-controllable-trainers-treadmills-january-2022/569781/70 on zwift. I also noticed that QZ can be difficult to pair to Zwift in bike mode upon first initialization. But other than that I am not seeing any other BT issues with my system neither with the KICKR BIKE, 2 Headwinds, 2 Tickr’s, and PowerBeat Pro’s that are used regularly on a variety of platforms: SYSTEM, Zwift, Rouvy. The BT dongle is worth a try though and I will give it a go and let you know the results.

cagnulein commented 2 years ago

I don't think it's Bluetooth releated imho. Otherwise all the metrics should be corrupted

Il giorno ven 28 gen 2022 alle 15:56 Bob @.***> ha scritto:

I suspect that the erratic cadence that I am seeing on zwift may be bluetooth related. There seems to be quite a few people having BT related issues < https://forums.zwift.com/t/bluetooth-improvements-for-controllable-trainers-treadmills-january-2022/569781/70> on zwift. I also noticed that QZ can be difficult to pair to Zwift in bike mode upon first initialization. But other than that I am not seeing any other BT issues with my system neither with the KICKR BIKE, 2 Headwinds, 2 Tickr’s, and PowerBeat Pro’s that are use regularly on a variety of platforms: SYSTEM, Zwift, Rouvy. The BT dongle is worth a try though and I will give it a go and let you know the results.

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/qdomyos-zwift/issues/626#issuecomment-1024300011, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWHR7ZQGAUZJUSGKTLTUYKVBBANCNFSM5M6UI22A . You are receiving this because you were mentioned.Message ID: @.***>

-- Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

brumohr commented 2 years ago

<Roberto Viola @.***> wrote: I don't think it's Bluetooth releated imho. Otherwise all the metrics should be corrupted>

Has the log revealed anything of interest?

cagnulein commented 2 years ago

I had to study it more. Not at first sight

Il giorno ven 28 gen 2022 alle 16:12 Bob @.***> ha scritto:

<Roberto Viola @.***> wrote: I don't think it's Bluetooth releated imho. Otherwise all the metrics should be corrupted>

Has the log revealed anything of interest?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/qdomyos-zwift/issues/626#issuecomment-1024314526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWCFDN5T2T3A6MP7XZ3UYKW7VANCNFSM5M6UI22A . You are receiving this because you were mentioned.Message ID: @.***>

-- Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

brumohr commented 2 years ago

Did another run today to re-test cadence on Zwift. Zwift cadence dropouts are easily duplicated on my system. At 5.5 km/h cadence begins to drop out intermittently and gets progressively worse dropping out completely at about 6.2 km/h. I repeated this process several times during this run and each time I went from 5.5 km/h up to 6.5 km/h in 1 km/h increments, total drop out takes place around 6.2 km/h. Zwift reads from 0 to about 20 spm when dropped out. QZ app never drops out and always shows accurate rpm.

Attached is a log file of the event.

debug-Fri_Jan_28_10_21_42_2022.log

cicciofritz commented 2 years ago

@cicciofritz did you see something similar too?

I'm the wrong cicciofritz xD sorry

cagnulein commented 2 years ago

@cicciofritz Lol sorry ;)

brumohr commented 2 years ago

Duplicated cadence dropout on today's run. Attached are two fit files.

This Strava link #QZ Run and it's associated fit file show that cadence (rpm) was recorded by QZ for the entire run/walk. Note that the Strava link shows accurate spm for the event duration. The fit file associated with this Strava link is named: Run_QZ.fit (download as .txt and rename as .fit) Run_QZ.txt

Now this Strava link Zwift Run - Bob's Meetup Chili Pepper is the same run but the fit file was uploaded by Zwift and you can see that cadence becomes erratic and inaccurate. Zwift fit file is named Zwift_Run_Bob_Rumohr_s_Meetup_Chili_Pepper.txt (download as .txt and rename as .fit) Zwift_Run_Bob_Rumohr_s_Meetup_Chili_Pepper.txt

derhexer13 commented 2 years ago

@brumohr my MyRun generates cadence dropouts by default if i run faster than about 164 rpm. This happens from first day on, i got my treadmill. Therefore i bought a stryd footpod, now everything works fine.

brumohr commented 2 years ago

@brumohr https://github.com/brumohr my MyRun generates cadence dropouts by default if i run faster than 164 spm. This happens from first day on, i got my treadmill. Therefore i bought a stryd footpod, now everything works fine.

I assume you mean that your Myrun cadence drops out on Zwift when connected to via QZ? I have no issues with cadence when connected to Zwift via Technogym LIVE. I don’t seen cadence issues when connected to any other app.

derhexer13 commented 2 years ago

@brumohr No. I mean MyRun cadence dropouts by using MyRun only connected with Zwift. This happens with my MyRun only when my spm is higher than about 164-168… Sample at Zwift: Heribert S. - 07.December 2021

derhexer13 commented 2 years ago

@brumohr How do you connect Zwift via TechnoGym Live? Both apps on same device? TechnoGym Live offers only sessions, workouts, free run… How and why do u use TechnoGym Live as a bridge to Zwift?

cagnulein commented 2 years ago

@brumohr got the issue now! @CiccioFritz79 question for you: on your runs, the cadence goes upper than 127 bpm?

CiccioFritz79 commented 2 years ago

@brumohr got the issue now! @CiccioFritz79 question for you: on your runs, the cadence goes upper than 127 bpm?

Yes. Normally my cadence stay from 160 to 190 bpm, whitout any problem.

cagnulein commented 2 years ago

so strange then, i guess it could be an overflow issue, but if @brumohr has it, everyone should have it. It's for sure an overflow issue but i don't understand why it's happening only to @brumohr

@brumohr an idea just to understand this: could you try to enable the "Doubling Cadence for Run" setting under accesories->power senor ?

you will see the cadence doubled in QZ but i would like to check what happens on zwift side. Let me know

brumohr commented 2 years ago

@brumohr https://github.com/brumohr an idea just to understand this: could you try to enable the "Doubling Cadence for Run" setting under accesories->power senor ?

you will see the cadence doubled in QZ but i would like to check what happens on zwift side. Let me know

Changed setting to double cadence. Drop out still occurs on zwift only. QZ solid.

brumohr commented 2 years ago

If the myrun had problems reporting inconsistent cadence then QZ should reflect that and it does not. Neither does Technogym LIVE. IMO it is a bluetooth issue with zwift.

cagnulein commented 2 years ago

If the myrun had problems reporting inconsistent cadence then QZ should reflect that and it does not. Neither does Technogym LIVE. IMO it is a bluetooth issue with zwift.

No @brumohr ,it's not an issue about your treadmill. It seems that zwift doesn't handle value over 127, classic int8 overflow But it's strange that it happened only to you. The code is common for all the treadmills. I have to think about this

derhexer13 commented 2 years ago

If the myrun had problems reporting inconsistent cadence then QZ should reflect that and it does not. Neither does Technogym LIVE. IMO it is a bluetooth issue with zwift.

No @brumohr ,it's not an issue about your treadmill. It seems that zwift doesn't handle value over 127, classic int8 overflow But it's strange that it happened only to you. The code is common for all the treadmills. I have to think about this

@cagnulein if the cadence is transmitted as int8, why is my stryd cadence correct?

cagnulein commented 2 years ago

@derhexer13 Nope the cadence is sent as unsigned int 8 from qz, but I guess zwift reads it (idk why) as a signed int 8. Maybe it doesn't think that a 127 bigger value it could be possible

derhexer13 commented 2 years ago

@cagnulein That's what i do not understand. Zwift shows no cadence higher about 164/168 spm when MyRun is cadence source,. Zwift shows all cadences correct if stryd is cadence source.

derhexer13 commented 2 years ago

@cagnulein i've to check high cadences using my MyRun with TechnoGym LIVE app...

cagnulein commented 2 years ago

Yes it's what I don't understand either! :) also @CiccioFritz79 use the same qz cadence algorithm to send his garmin and it works ok

derhexer13 commented 2 years ago

@cagnulein One question to the transmitted cadence. Is there any conversion of the source value in spm needed to be transmitted as a uint8 value?

cagnulein commented 2 years ago

Cadence is always sent to uint8 because it hasn't sign :) maybe I don't understand your question My question is: why zwift is using the sign for @brumohr cadence

derhexer13 commented 2 years ago

@cagnulein Which unit is the uint8 value based? Is the uint8 value spm based? I ask this because e.g. 140 spm should already results in a int8 overflow... but 140 spm is displayed correct. Remind: This behavior (no cadence display in zwift if spm is above 164) occurs without qz. MyRun is cadence source is Zwift.

derhexer13 commented 2 years ago

@cagnulein i do not find a cadence in the treadmill datablock in the ftms protocol. https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/td-0000001050147077

derhexer13 commented 2 years ago

@cagnulein As I thought: My MyRun seems to have a problem with faster cadences than 164 spm. It also fails with the TechnoGym LIVE app. Maybe they have a problem detecting the spm at that these cadences and my weight (86 kg). This was my first idea when Zwift only showed zero values for these high cadences and the reason why I bought the Stryd Footpod.

cagnulein commented 2 years ago

@cagnulein i do not find a cadence in the treadmill datablock in the ftms protocol. https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/td-0000001050147077

check this one, your treadmill send info with this format along with the FTMS one https://github.com/cagnulein/qdomyos-zwift/blob/master/docs/specs/org.bluetooth.service.running_speed_and_cadence.xml

brumohr commented 2 years ago

@cagnulein https://github.com/cagnulein As I thought: My MyRun seems to have a problem with faster cadences than 164 spm. It fails also with the TechnoGym LIVE app. Maybe they have a problem detecting the spm at that these cadences and my weight (86 kg).

At a speed of 5 km/h (don’t know cadence but less than 160 spm) cadence is stable on zwift. Because I am suffering from achilles tendonitisI occasionally would hold onto the hand rails to reduce some of the weight placed on my ankles. When I did this the cadence on zwift would drop out or become erratic. I weight 68 kg. However, cadence on the QZ app was always solid and did not become erratic. Experimenting with heavy and light footfalls does influence the stability of the cadence on zwift. The lighter the foot fall the more unstable the cadence. This could be an issue with Myrun force detection. But I keep coming back to the same question, “why do I only see the problem on Zwift”?

cagnulein commented 2 years ago

@brumohr just a stupid question: are you using the cadence that QZ sends to the virtual zwift interface or the treadmill cadence directly? i don't know if your treadmill has the ability to allow 2 concurrent connections at the same time

brumohr commented 2 years ago

@brumohr https://github.com/brumohr just a stupid question: are you using the cadence that QZ sends to the virtual zwift interface or the treadmill cadence directly?

I don’t know the answer to this question. How do I determine this?

a). QZ running on iPad and Zwift running on PC win11: when I pair to zwift using the RUN pairing screen the only option I see is QZ. b). I do have significant trouble pairing QZ to zwift using the bike pairing screen. I have tried many different approaches but have not found any combination of events to reliably pair QZ to zwift as bike. c). I have never been successful in pairing the Myrun directly to zwift running zwift on my PC Win 11.
d). Zwift launches, pairs and runs flawlessly (I do not get cadence dropouts on zwift) when launched from Technogym LIVE on my iPad.

< i don't know if your treadmill has the ability to allow 2 concurrent connections at the same time>

I don’t believe the Myrun has the ability to make more than one connection. I have tried to find the answer to this but very little information is provided by Technogym. Myrun seems to be an Apple centric device however.

cagnulein commented 2 years ago

Zwift launches, pairs and runs flawlessly (I do not get cadence dropouts on zwift) when launched from Technogym LIVE on my iPad.

just to understand: your treadmill has a ipad builtin? What you mean run Zwift from Technogym LIVE? Remember that i never saw a Technogym treadmill in my life :)

derhexer13 commented 2 years ago

@cagnulein The MyRun has a slot (holder) for tablets. Technogym LIVE runs on Android and iOS.

brumohr commented 2 years ago

Zwift launches, pairs and runs flawlessly (I do not get cadence dropouts on zwift) when launched from Technogym LIVE on my iPad.

just to understand: your treadmill has a ipad builtin? What you mean run Zwift from Technogym LIVE? Remember that i never saw a Technogym treadmill in my life :)

I am running Technogym LIVE on my iPad. LIVE is their app which allows the user to directly connect via the app to either Zwift or Rouvy (among other uses). When using LIVE to connect to zwift the user simply clicks on the zwift icon in the app which then launches zwift on the same device (iPad in my case). So zwift then launches and pairs immediately to the Myrun. Choose your world, route, or workout and start run. Works flawlessly.

cagnulein commented 2 years ago

so i don't understand: what does it mean that zwift pairs with technogym live? the technogym app creates a bridge too like QZ? @derhexer13

derhexer13 commented 2 years ago

@brumohr Do you start Zwift via TechnoGym LIVE? I start only Zwift on my iPad - do not use TechnoGym LIVE. Zwift always remembers the last paired device (MyRun, Stryd and Wahoo TICKR). Works fine.

cagnulein commented 2 years ago

hah ok @brumohr so they did a bridge too! now i understood

brumohr commented 2 years ago

@brumohr Do you start Zwift via TechnoGym LIVE? I start only Zwift on my iPad - do not use TechnoGym LIVE. Zwift always remembers the last paired device (MyRun, Stryd and Wahoo TICKR). Works fine.

The fact that zwift cashes paired devices is why imo I am having so much trouble pairing QZ to zwift on PC in bike pairing screen. I prefer to launch zwift from LIVE when zwifting if using LIVE. It just works.

derhexer13 commented 2 years ago

@cagnulein @brumohr Today i got an answer from TechnoGym about the cadence problem:

Info from Technogym Italy , Cadence is displayed correctly up to 9 Km/h. Best Regards Technical Call Center Dept

Now all clear....

cagnulein commented 2 years ago

hahahah really @derhexer13 ?? They are italian indeed! :D

derhexer13 commented 2 years ago

So.... do not run too fast!

brumohr commented 2 years ago

@cagnulein https://github.com/cagnulein @brumohr https://github.com/brumohr Today i got an answer from TechoGym about the cadence problem:

Info from Technogym Italy , Cadence is displayed correctly up to 9 Km/h. Best Regards Technical Call Center Dept

Now all clear….

Hah! Too funny. I have restored numerous Italian motorcycles (moto morini, moto guzzi, ducati) over the years and while I love Italian styling, their electronics can make the British - Lucas Prince of Darkness - look good 🤪

derhexer13 commented 2 years ago

@cagnulein I add this nice info to the MyRun Wiki...

brumohr commented 2 years ago

I have contacted Technogym regarding my inability to pair the Myrun to Zwift on PC running win11. Will share their comments when I hear back. I did contact tp-link and inquired about incompatibility of their UB400 BT adapter with Win11 even though their marketing literature indicates that the UB400 is compatible with win11. They simply apologized for the advertising and told me they don't have a driver for win11 yet.

derhexer13 commented 2 years ago

@brumohr Can you edit the wiki and correct the 'Starting MyRun with QZ:' section?

brumohr commented 2 years ago

@brumohr https://github.com/brumohr Can you edit the wiki and correct the 'Starting MyRun with QZ:' section?

Done.

cagnulein commented 2 years ago

@brumohr Since you see the right value without qz we can work on this. What do you think?