cagnulein / qdomyos-zwift

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

Vzfit on oculus quest and qz logs #680

Closed ibbr0 closed 2 years ago

ibbr0 commented 2 years ago

Hi, you had requested logs from vzfit rides to assist in getting it configures.

Using the new beta, vzfit connects to qz and the ride starts correctly, however if i stop pedalling, the cadence does not stop and vzfit thinks i'm still pedalling. qz shows cadence stopped. while riding if i change incline, it is immediately set back to the original value. force zwift resistance was off and resistance can be changed on the bike normally.

debug-Mon_Feb_14_14_40_49_2022-1.log

Using the non beta current version cadence stops properly when i quit pedaling. If I change incline using the bike buttons, it immediately changes back to the previous values. Same for resistance if force zwift resistance is on, otherwise i can change it and it stays.

vzfit does say they support ftms auto resistance. I have a list of bikes they mentioned if needed. they have not mentioned incline control but i haven't specifically asked yet.

one other thing i've noticed is that when i go back into vzfit, it say's 'pedal to connect to iphone addr ###'. it will never connect. i go into standing mode and then go back to selecting a sensor and it immediately connects properly. I only mention it in case you see corresponding weirdness in the logs.

Thank you! IB

debug-Mon_Feb_14_14_46_19_2022.log

cagnulein commented 2 years ago

thanks @ibbr0 the cadence issue about stop pedaling, is something that you have on Zwift too? It's only about cadence or also wattage?

About the inclination: seems that the app is always sending 0 as FTMS values. But in order to be sure, could you please also collect me a log with the ios peloton workaround OFF? Remember to put it on after the log collection.

Thanks

ibbr0 commented 2 years ago

Answer below.

Sent from my iPhone

On Feb 15, 2022, at 2:43 AM, Roberto Viola @.***> wrote:

 thanks @ibbr0 the cadence issue about stop pedaling, is something that you have on Zwift too? It's only about cadence or also wattage?

I believe I did see it in zwift once but didn’t reckognize it. Incline had gone negative and the bike didn’t stop when i stopped peddling. I assumed it was a zwift thing and coasting downhill. I didn’t notice cadence or power readout at that time but will try to duplicate and check. I believe that was after I had bumped up the experimental incline offset and gain. About the inclination: seems that the app is always sending 0 as FTMS values. But in order to be sure, could you please also collect me a log with the ios peloton workaround OFF? Remember to put it on after the log collection.

I will get it too you. Thanks

And thank you

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

ibbr0 commented 2 years ago

Hello,

I ran in both beta and release in zwift and vzfit and could not duplicate the situation where the bike kept going without pedaling. In vzfit I currently find that unless speed from power is on, the bike does not move. It would seem that vzfit can connect unsuccessfully occasionally. Power no cadence, or the reverse. If I am diligent about connection sequence it seems pretty stable though.

The log below is from beta, running vzfit on quest and pelaton iOS workaround off. The bike does not get any resistance or inclination commands as far as I can tell. Changing either does not result in them immediately being changed back like it did before with workaround on.

Is it possible vzfit only sends resistance if it recognizes a certain bike model? I do have a tech that responds quickly and is trying to be helpful at vzfit. If there is anything I should be asking him let me know.

IB

Sent from my iPhone

On Feb 15, 2022, at 2:43 AM, Roberto Viola @.***> wrote:  thanks @ibbr0 the cadence issue about stop pedaling, is something that you have on Zwift too? It's only about cadence or also wattage?

About the inclination: seems that the app is always sending 0 as FTMS values. But in order to be sure, could you please also collect me a log with the ios peloton workaround OFF? Remember to put it on after the log collection.

Thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

cagnulein commented 2 years ago

@ibbr0 i don't see the log but yes it's possible that they are Sending control on resistance only if they see some bikes or something similar Maybe you can invite them here or you can put me in CC With them Let me know

ibbr0 commented 2 years ago

I cc’d and introduced you in my latest email to vzfit.

When I went back to turn the peloton iOS workaround back on I found that the bike was set to tdf1.0 which did not work for me before in zwift. Not sure how it got set to that. Maybe I forgot to exit and restart. That is what I used to produce the log attached. I’ll try again later today and confirm which bike settings work/fail with zwift and vzfit and get a new log without iOS workaround on.

IB

Sent from my iPhone

On Feb 15, 2022, at 11:25 AM, Roberto Viola @.***> wrote:

 @ibbr0 i don't see the log but yes it's possible that they are Sending control on resistance only if they see some bikes or something similar Maybe you can invite them here or you can put me in CC With them Let me know

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

ibbr0 commented 2 years ago

We’re you saying you haven’t looked at the log or that is was not successfully attached?

-IB

Sent from my iPhone

On Feb 15, 2022, at 11:25 AM, Roberto Viola @.***> wrote:

 @ibbr0 i don't see the log but yes it's possible that they are Sending control on resistance only if they see some bikes or something similar Maybe you can invite them here or you can put me in CC With them Let me know

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

cagnulein commented 2 years ago

it was not attached. you have to attach it from github directly. Thanks

ibbr0 commented 2 years ago

Ahh, I can do that. -Ib

Sent from my iPhone

On Feb 15, 2022, at 1:52 PM, Roberto Viola @.***> wrote:

 it was not attached. you have to attach it from github directly. Thanks

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

emalafeew commented 2 years ago

Hi all, developer from Virzoom/VZfit here. Hope I can help!

We don't have a list of devices for resistance control, it's determined by the bluetooth protocol handshake. First we look for devices supporting either the cadence&speed, cycling power, or FTMS services. If we find FTMS we connect and look for "indoor bike data" support, followed by "ftms control" support. We then attempt to initialize resistance through that control, and if successful the game will continue to drive it.

Regarding speed, cadence, and power, the FTMS indoor bike protocol requires instantaneous speed but cadence & power depend on device. The game follows the speed as reported, it doesn't have any separate coasting functionality. Cadence and power are used if they are reported, to drive the pedaling animation and HUD rpms/spins and vzcals, otherwise those are estimated from what is reported.

Let us know what we can do

cagnulein commented 2 years ago

@emalafeew Hi, nice to meet you! So it's strange that QZ and VzFit will not work out of the box: QZ is sending indoor bike data and controllable too.

Let's see the log that @ibbr0 will share soon: it should be very clear from that one

Thanks

ibbr0 commented 2 years ago

Here are the latest logs. In all three cases the bike is moving without me peddling. Qz shows no cadence no real time watts perhaps average watts was not 0 and not updating. First logs had peloton iOS fix off. On in the last ones. I switched from studio bike to tdf1.0 in the last 2 logs. I’ll try again in a minute. Just wanted to get these up. debug-Tue_Feb_15_13_55_13_2022.log debug-Tue_Feb_15_16_02_31_2022.log debug-Tue_Feb_15_16_03_59_2022.log debug-Tue_Feb_15_16_04_14_2022.log

ibbr0 commented 2 years ago

I set qz speed from power on and this ride worked. The bike stopped moving when I stopped pedaling. Still set to tdf1.0. No evidence of resistance control. Also resistance did not get set to my startup resistance from qz. That always worked with studio bike selected. debug-Tue_Feb_15_16_11_12_2022.log

ibbr0 commented 2 years ago

Ok, back to qz set as studio bike. Connects and works. I can change resistance using bike controls. When I use bike incline controls it is immediately set back to 0. Saw no incline or resistance commands from vzfit. [Uploading debug-Tue_Feb_15_16_19_08_2022.log…]()

ibbr0 commented 2 years ago

Hope that’s helpful. Let me know if you need settings changed. I did see in vzfit forums one person mentioned raising ride difficulty in order to get resistance from vzfit. This is not a setting I have found in vzfit

ibbr0 commented 2 years ago

By the way, when I set qz back to studio bike, starting qz does correctly set the initial resistance, which was not the case when set to tdf1.0

cagnulein commented 2 years ago

Ok, back to qz set as studio bike. Connects and works. I can change resistance using bike controls. When I use bike incline controls it is immediately set back to 0. Saw now incline or resistance commands from vzfit.

[Uploading debug-Tue_Feb_15_16_19_08_2022.log…]()

this log is corrupted on github please upload it again thanks

ibbr0 commented 2 years ago

debug-Tue_Feb_15_16_19_08_2022.log

emalafeew commented 2 years ago

I was under the impression that the device we were working on here was a bike. We strongly suggest that VZfit users do not use treadmills when using our software as the lack peripheral vision in VR can be quite dangerous.

ibbr0 commented 2 years ago

It is a bike. Proform Tour de France bike. Would very much appreciate your help in getting the kinks out.

Sent from my iPhone

On Feb 15, 2022, at 7:58 PM, emalafeew @.***> wrote:

 I was under the impression that the device we were working on here was a bike. We strongly suggest that VZfit users do not use treadmills when using our software as the lack peripheral vision in VR can be quite dangerous. I apologize, but I won't be able to assist further in this integration effort.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

emalafeew commented 2 years ago

I may have been confused, and would be happy to help connect VZfit to stationary bikes. It seemed like the app acts as a bluetooth translator/intermediary and the Readme features a treadmill. VZfit should work with standard bluetooth bike protocols out of the box, but we haven't supported many custom protocols. If supporting those are the benefit of the app we're all for it.

emalafeew commented 2 years ago

I also see now that QZ can filter and offset resistance and provide useful logging, dashboard, and upload functions. Sorry I jumped in without any context.

emalafeew commented 2 years ago

@emalafeew Hi, nice to meet you! So it's strange that QZ and VzFit will not work out of the box: QZ is sending indoor bike data and controllable too.

Let's see the log that @ibbr0 will share soon: it should be very clear from that one

Thanks

I can also run a diagnostic connecting to QZ from VZfit's point of view.

emalafeew commented 2 years ago

My bluetooth trainer (a Saris M2) doesn't seem to be recognized by QZ. Is there a way to put QZ into a test mode without a device?

ibbr0 commented 2 years ago

No worries. Thanks for your help. I would really like the features of my bike to work with vzfit. I think it is close using qdomyos. Thank you!

cagnulein commented 2 years ago

My bluetooth trainer (a Saris M2) doesn't seem to be recognized by QZ. Is there a way to put QZ into a test mode without a device?

@emalafeew Enable the Apple Watch fake app in the experimental settings and restart qz. Or if you have a cadence sensor we can use that one. Sorry for the delay in the answers but I'm based in Italy. Yes QZ converts custom protocol to FTMS one so that means a lot of new customers for you! If you want you can also write me to roberto.viola83 at gmail.com

cagnulein commented 2 years ago

@ibbr0 i checked the log about the iOS peloton workaround off and i can confirm that VZFit is not sending any control packets. In order to keep this ticket clean, please post only logs about the VZFit thing, don't provide log about studio settings or other. Maybe open a new ticket for this. So @emalafeew will have a more clean look about the issue

@emalafeew as i wrote above, i don't see any FTMS Control packets from you. So we need to do a little troubleshooting here. Let me know if i can help you in this way. If you want open a new ticket about Saris M2 and i will add the compatibilty for it. I just need the name of the bluetooth device if it's FTMS

emalafeew commented 2 years ago

The fake Apple device worked for my diagnostics, thank you. I think I found the problem... we are writing 0x3 to subscribe to the FTMS control ccc, which is a bitwise combo of notification (0x1) and indication (0x2). When first implementing we found some FTMS devices that responded to one or the other, and found that combo has generally worked though it's non-standard. Your QZ device is, perhaps properly, returning an invalid attribute length error (0xd), and so we skip trying to control its resistance.

So you could modify your implementation to allow 0x3 to subscribe to FTMS control point, or we could modify our implementation to use either notification or indication (whichever you handle now and is likely the proper one) and hope that works with all FTMS devices.

ibbr0 commented 2 years ago

I will stay available to test and provide logs as needed. Just for reference, my preferred setup if possible would be for vzfit to change incline but not resistance, which works very well on proform bikes and zwift.

cagnulein commented 2 years ago

great @emalafeew i will do the modification today and i hope to release a new beta tomorrow. Thanks for the troubleshooting

cagnulein commented 2 years ago

@emalafeew just to be sure, you're referring to 0x2AD9 characteristic isn't it? Now QZ has Write and Indicate for it, you need also the notification, isn't it?

emalafeew commented 2 years ago

@cagnulein yes, the 0x2AD9 characteristic. We're requesting "both" indication and notification, and just need it to handle that without an error, and provide the indication. I see from reading the FTMS spec again that indication is correct, so maybe we should switch to only that. But if you can allow both for now that would be great and faster.

@ibbr0 we'd gotten feedback from Kinetic that resistance control was more widely handled than inclination control for FTMS indoor bikes. Does the ProForm not support direct resistance, or does inclination control feel better than direct resistance? I suppose this could be another feature of the QZ app, to translate resistance to inclination and vice versa if there's a device/game support mismatch. We don't have a wide variety of FTMS devices to test so appreciate all input.

cagnulein commented 2 years ago

@cagnulein yes, the 0x2AD9 characteristic. We're requesting "both" indication and notification, and just need it to handle that without an error, and provide the indication. I see from reading the FTMS spec again that indication is correct, so maybe we should switch to only that. But if you can allow both for now that would be great and faster.

@emalafeew yeah i can do, i'm only worried about that this could broke the compatibility with other app...I will do the modification tomorrow and let's see if Zwift, for example, will still work.

@ibbr0 we'd gotten feedback from Kinetic that resistance control was more widely handled than inclination control for FTMS indoor bikes. Does the ProForm not support direct resistance, or does inclination control feel better than direct resistance? I suppose this could be another feature of the QZ app, to translate resistance to inclination and vice versa if there's a device/game support mismatch. We don't have a wide variety of FTMS devices to test so appreciate all input.

I don't think Kinetic is right. The majority of the FTMS Bike supports the inclination control. Just a minority of them support also the resistance one. The proform bike as the other custom bikes, have a command to change the resistance and i'm using it to control by incline or directly

ibbr0 commented 2 years ago

The bike does support commanded resistance and I have tried it both ways with qz and zwift. When zwift controls inclination only i can use the resistance setting on the bike as gears. One problem with proform bikes is that the resistance range is very low unless the incline is high. On proform tdf's incline and resistance are combined to produce actual resistance using the resistance motor. The incline motor just tilts the bike. I use incline offset and gain in qz to scale incline from zwift to get a realistic ride. I had thought about asking roberto about a resistance to incline translation if vzfit is unable to provide incline. Let's see where we land.

cagnulein commented 2 years ago

@ibbr0 modification done. send me an email to roberto.viola83 at gmail.com as a reminder to send you the ios beta. i did other more improvements (speed up the bluetooth communication to zwift and also i added also the peloton profile so, with the peloton cadence sensor off you should be able to run peloton too). Let me know @emalafeew i will send you the beta to you too

ibbr0 commented 2 years ago

Qz version 2.10.29 connected to vzfit and changed incline on bike to 0. I did part of a ride that started flat and then started climbing. Saw no resistance or incline changed on bike. debug-Thu_Feb_17_08_36_04_2022.log debug-Thu_Feb_17_08_46_01_2022.log

I believe the 2nd log exists because I pushed stop on qz, and it starts a new log immediately. With some clarification on that I can not post it for future tests.

One thing I see that is different from using vzfit with an add in cadence sensor. When vzfit starts it says’pedal to connect’. With qz this never connects. Instead I go into standing mode and then click on the bike icon which prompts me to connect and immediately works properly. This is not a big issue, but while you guys are working on qz/vzfit thought you should know.

cagnulein commented 2 years ago

thanks @ibbr0 let's see if @emalafeew will see something on their side. I sent the same version to him too

emalafeew commented 2 years ago

I got the QZ beta this morning and still see the 0x13 error when subscribing to FTMS control point.

Let me try a change to VZfit to only ask for indication, not combined notification, on that field. If that works I can incorporate into our next release which is scheduled for Tuesday @ibbr0. Eyal (the Virzoom tech you were talking to before) can also get you on our beta list to test a build with it today. Would you please ask him about that, I will give him the heads up.

cagnulein commented 2 years ago

so strange @emalafeew i double checked it with nrfconnect. do you see it too?

ibbr0 commented 2 years ago

@emalafeew i will email Eyal. Done.

ibbr0 commented 2 years ago

@cagnulein can you confirm that I am running the new beta? TestFlight showed it installed but I don’t see the (25) after version number in qz. Looking closer I see an open option in TestFlight. I ran it from my main screen, not TestFlight, but that worked with the beta that added incline gain…

emalafeew commented 2 years ago

I'm still getting the error with change to Vzfit asking for only indication. I'll double check with nrfconnect and try some other things.

cagnulein commented 2 years ago

@ibbr0 in the left side bar of QZ you have to see 2.10.29 And yes, the build 25 is right

cagnulein commented 2 years ago

Hi Guys, any news about this?

ibbr0 commented 2 years ago

I did a quick test this morning and adjusted difficulty in vzfit. Someone with a wahoo on their fb group said he got autoresistance when it was set as high as possible. Again, I did not see any commanded resistance or incline from vzfit. However I did notice that with the new qz beta, now when I change inclination on the bike it is immediately set back to 0 while running vzfit.

cagnulein commented 2 years ago

@ibbr0 yes it was releated to #684 i just send you the new beta that fixes it

ibbr0 commented 2 years ago

debug-Fri_Feb_18_08_59_13_2022.log @cagnulein The new beta changed how vzfit connects. Before I had to skip the pedal to connect screen and go to standing mode, then select the cycle icon and connect. Now it connects from the pedal to connect screen successfully. One thing I wander about is that the bike does nt have to be pedalled to connect when running qz. With the old add on cadence sensor it was neccessary to pedal. Could the bike or qz enumerate a different feature set over bluetooth if actively being pedaled than if not?

I am not seeing any commanded resistance or incline from vzfit. In this beta incline is not auto set back to 0 if I change it on the bike

@emalafeew I noticed that the difficulty buttons on the vzfit hud are greyed out. They do work to change the cadence/speed relationship. I’d assume that if autoresistance was active they might not be greyed out. Eyal did add me to beta program. Let me know when I should try a beta please

cagnulein commented 2 years ago

@emalafeew any news?

emalafeew commented 2 years ago

Sorry for the delay, I was traveling over the long weekend. Back to trying things out, will report results today.

emalafeew commented 2 years ago

I've got VZfit connecting to the QZ app with resistance control. I had to change VZfit to subscribe to indications {0x2, 0} rather than both indications and notifications {0x3, 0}, so @cagnulein it seems the beta change didn't allow that.

Requesting both is allowed by the Bluetooth spec, and from my notes may have been necessary for a certain trainer. However the FTMS spec calls for indications so I will make this change to the VZfit beta today @ibbr0 and will retest on that trainer.

emalafeew commented 2 years ago

@ibbr0 that VZfit beta build is up now. After you update it should have the build number 1.15.0.13