cagnulein / qdomyos-zwift

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

Unable to connect my Zwift Play to QZ #2458

Closed felixlbr closed 2 months ago

felixlbr commented 3 months ago

I followed the tutorial on Youtube to use my controllers Zwift Play on QZ but it doesn’t work. Even my Home Trainer that I am able to connect, when I can’t change gear by using “+” “-“ on the screen. I am using Zwift Cog and not a classic Gear

To Reproduce Steps to reproduce the behavior:

  1. Enable “Zwift Play”, “Gear” and adjust “Gear gain”
  2. Quit the app
  3. Connect my Zwift Play to my Ipad via Bluetooth
  4. Restart QZ

Expected behavior I expected to have my Zwift Play connected to QZ. I only see my Home Trainer “found” on the dashboard.

image

Device

debug-merjuil17_22_12_06_2024.log

cagnulein commented 2 months ago

i don-t see a the connection from indievelo, that's the issue. did you pair as before?

Citizenyolo commented 2 months ago

I tried again and I think I connected correctly this time. Before the update the name of the trainer was "QZ" and now it changed to "iPhone 14". That's why I overlooked it. I also attached my heart rate monitor FYI.

The update does not seem to address the lag, which is about 3-4 sec.

debug-Wed_Aug_7_10_14_38_2024.log

Attached the log.

cagnulein commented 2 months ago

ok now i see everything and everything is under 200ms. I'm wondering if the issue is that your trainer doesn't get small difference from the gears. try to increase the gears gain for example to 5, so this means that every time you press it it will increase by 5.

Citizenyolo commented 2 months ago

ok now i see everything and everything is under 200ms. I'm wondering if the issue is that your trainer doesn't get small difference from the gears. try to increase the gears gain for example to 5, so this means that every time you press it it will increase by 5.

Where can I set it? In Advanced settings I can see Watt gain, cadence gain, speed gain but no gear gain setting...

cagnulein commented 2 months ago

bike options

Citizenyolo commented 2 months ago

I set gear gain from 1 to 5. When I change gear it now goes in about 10 or 20 increments. It now feels much more responsive but the change from one gear to the next next is dramatic eg. from 75 watt to 180 watt at same rpm.

Zwift publishes the gear ratio for each gear. you can see the increments is about 0.2 from each gear. The current version feels more like an increment of 1.0 or more per gear change.

Zwift gears

debug-Wed_Aug_7_10_31_26_2024.log

Citizenyolo commented 2 months ago

If it's any help I can go through the gears in zwift at a constant rpm and tell you for each virtual gear the wattage. May help to calibrate a more consistent feel? Or maybe more settings in QZ to address it?

cagnulein commented 2 months ago

Ok so let me summarize it: so now with the gears gain to 5 you feel that it's changing immediately right? so this means that your trainer has low sensitivity to the inclination changes. I mean, QZ is applying an offset to the inclination sent from indievelo. Assume that you are at 0% in indievelo, and you have gear 1 in QZ, QZ is sending 0.5% to your trainer.

What you are telling me, is that 0.5% or 1% is not noticable, instead a 2.5% is noticeable, right?

another test that you can do, without QZ, pairing indievelo directly to your trainer, is to see on a hill how much you feel the inclination, i mean if it's the indivelo grade changes from 0.5 to 1 and you don't feel it, that's a confirmation of what i'm saying

If it's so, you just need to find a confortable gears gain, for example, maybe 2 is enough for you

Citizenyolo commented 2 months ago

So, a few test:

I tested IndieVelo on my trainer and the gradient changes were between 0% and +/- 1%. The watt meter showed about a 30W change immediately and there was an immediate subtle change in resistance feel. Same is for Zwift natively.

I also fired up Mywhoosh with Belgium (0% gradient all the way) hooked up to QZ. I lowered the gear gain to 2. When I change 1 gear the difference in wattage is about 100 watts. That's a lot for one gear.

On IndieVelo maybe there is a workaround to this, as it does offer to change virtual gear on the screen or with a bluetooth keyboard's +/-. You already successfully reverse engineered the buttons on the Zwift Play so maybe it would be not only easier to link the buttons to Indivelo's +/- bluetooth reciever but also keep Indivelo's famous accuracy intact. Someone seems to have experimented with this idea already:

https://github.com/jat255/zwift_click_handling

debug-Wed_Aug_7_11_01_41_2024.log

cagnulein commented 2 months ago

ok so for what you are saying a gears gain of 0.5 or even less it should be the perfection. Maybe the issue is that qz is sending too much frames on the trainer? Try to set the 0.5 gears gain and do just one gear change at a time. do you feel the difference? It could be a matter of too much frames because usually indievelo or zwift sends the inclination only when it changes, qz, if you are changing the gears continuosly it sends it each time. (so in a second i can send 5 different settings to the trainer max.).

We just need to figure out the limit of your trainer, check the guy here https://github.com/cagnulein/qdomyos-zwift/issues/2470 it has your same setup and it seems ok to him after the lag patch. I'm mentioning him here to discuss about this @jontnswift

Citizenyolo commented 2 months ago

I set the gear resistance to 0.3 which gives about the same gear ratio change as Zwift virtual cogs. On 0% gradient Brussels I set constant effort to result in 100w and that was at about 76 rpm.

If I change one gear, within about 1 second (as per previous guy's observation) you feel a slight change and read 111 watt. If you keep pedalling at that constant RPM and 0% gradient it takes about 3 seconds to arrive at the 130 Watt that 1 gear changes means.

Overall we are in good place already: Zwift click working and I can use this for exercise purposes for all the apps. The only scenario where this may not be fast enough for some people is for racing, but for 90% of the people this is brilliant!

I may have a quick fix idea for IndiVelo for racers / quicker shifting. You can assign maybe the lower right side buttons on zwift play for transmitting "+" signal for and lower left to transmit "-" signal. You can keep the upper side buttons as is for QZ gear change, it is a duplicate anyway as per Zwift assignment.

My iphone (with QZ running) is connected to my iPad (running IndieVelo) as a bluetooth device. Wouldn't that be picked up by IndieVelio as a keyboard +/- input? If yes, that's an extra solution for IndieVelo and in future if other apps follow that virtual gear change route, it is quite likely/logical they will use the +/- buttons for that, too.

Overall this is great stuff, thanks for your quick fix!

cagnulein commented 2 months ago

I may have a quick fix idea for IndiVelo for racers / quicker shifting. You can assign maybe the lower right side buttons on zwift play for transmitting "+" signal for and lower left to transmit "-" signal. You can keep the upper side buttons as is for QZ gear change, it is a duplicate anyway as per Zwift assignment.

sure, do you think this could solve your issue? I didn't get from what you are saying if it's a delay thing of qz or a delay thing of your trainer or just a gear gain issue. From your phrase it seems that you need a more precise settings, and yes I can do easily this mod. Let me know if you want to proceed in this way!

Citizenyolo commented 2 months ago

That would be great if we can have that +/- set up to the lower buttons. IndieVelo does change gears a bit faster but it is clumsy to use the touchscreen for that.

cagnulein commented 2 months ago

hah no wait i misread the message: i guess you would like to set a 2x gear with the top button. No i can't emulate a keyboard button to indievelo. I don't understand how it could be faster on indievelo: it's the same message sent from a device to another. How much faster is it? in the order of 0.5s?

Citizenyolo commented 2 months ago

I may be completely wrong, I'm no expert, just brainstorming :) . But in that scenario I would choose the Wahoo trainer in IndieVelo (not QZ). QZ as an app or "virtual trainer" connected to my iPad (running Indivelo app) could send +/- signal whenever I press the correct keys in Zwift Play. This would trigger Indivelo's built in virtual gear change which constantly listens to +/- input for that from a bluetooth keyboard.

cagnulein commented 2 months ago

QZ can't broadcast itself like a bluetooth keyboard, that's the issue. Indievelop app should have some APIs to do this in order to implement this. The only way to do what you are asking is using indievelo on PC and play a macro to use + and - minus button on the PC itself. Ipad and ios devices are out of the game.

But again I would like to understand where the delays comes in: i mean from my point of view, qz is a man on the middle, i accept that there is a delay because there is a one more device in, but i guess it's in the order of some hundreds millseconds, not more. If there is more, there is somethign else that we have to understand (unfortunately it's not easy on remote). For example do you see the gears change immediately on qz? If so we can say that the zwift play controller to QZ is fine, and we can focus on the trainer to qz communication only.

Citizenyolo commented 2 months ago

I think you are right. Gears now DO change almost immediately on QZ. I think the delay is about 1/5th of a second only.

I also did another test, which I should have done earlier. I compared the speed of watt change by changing gear on Indivelo's on screen touch enabled virtual gear buttons. If I shift up quickly 5 gears it also takes a few seconds for the full impact to arrive. Your solution now delivers about 99% the same experience. The only thing I can still finetune is the gear change, which I think will be between 0.3 and 0.5 to replicate the zwift gear ratio steps.

I would leave the buttons as is, users coming from Zwift would have the same experience.

Overall I think we can close this: Questo lavoro è perfetto.

Thank You!!

cagnulein commented 2 months ago

Amazing!