Open eMadman opened 2 years ago
hi @eMadman i checked the log. The main issue is this one: when ss2k starts in an echelon setup, i'm sending the current resistance value got from the bike to the ss2k in order to init its resistance value. from that moment on, echelon and ss2k will be aligned on the same resistance value even if the user rotates the knob.
ok now let's talk about the schwinn setup: the schwinn bikes doesn't send the resistance by bluetooth. The resistance is derived from wattage and cadence in QZ. This means that at the startup phase, the resistance level is 0 and so i'm sending 0 to SS2k despite the real value in the bike.
In the log i saw that all the resistance values that comes from the ss2k during the ride are all negative value and i think this is releated to the startup issue (also the gear one).
So i guess, we can try to do a thing just to have a simplier setup: start the QZ session with your bike resistance set to 1. In this way the SS2K and QZ should be more or less aligned and let's see if it will go better.
@marklogan17 @kadaan what do you think?
also a question @eMadman : zwift is paired with QZ or with the SS2k? in this scenario it has to be linked with QZ
@cagnulein a resistance of 0 on my bike appears as '5' on QZ. To compensate for this, I tried to set "resistance at startup" to 5 in order to match it.
This did work with SS2k for a while, but I'm noticing that the resistance gains are very small. Partway through the ride, it sent resistance up past 90 which was very unexpected.
QZ is paired with SS2k and the IC4 Zwift is paired with QZ and my HRM
@eMadman ok I need always the debug log every time you did a try to understand the behavior
Apologies - I thought I included the log yesterday! Here you go
Ok probably it's all releated to "Shift Step" setting in QZ. You have to found a step number that matches with your bike know.
You can find it empirically putting the knob to 0, and then manually rotating it to the max. If your step setting is ok you should see on QZ the value that you have to the bike. If the resistance value on QZ is too big (as is now) means that you have to decrease this setting (for example you can start from a 400 instead of 900).
Every change of this setting requires a QZ restart.
Let me know @eMadman
P.S. the 900 actual value is refereed to the echelon bike
@eMadman did you solve this?
@cagnulein I haven't been able to give this the time to generate the log files. My last attempt, the shift step setting didn't change anything. Best I can describe it as is that it appeared to me that QZ wasn't sending updates to SS2k - either at all or in a timely way (I'd need the logs to help figure that out).
When I lower shift steps to around 400 on the SS2k (eliminating QZ from the equation), I find the erg responses to be too slow. Shifting up or down, for example only changes the watts by ~5-10. Bigger steps should make more drastic changes but perhaps I'm misunderstanding how that works.
I do wonder if, QZ not reporting a '0' value for resistance to SS2k has anything to do with it. Lowest I can get with my knob fully zeroed out is 5 on the QZ dashboard.
To date, I haven't tried the peloton integration due to the time needed to test it properly. I'll try for a few hours on Sunday to capture logs for Zwift and for peloton for you.
@eMadman eliminating QZ from the equation, you should find a shift step value that allow you to change only 1 resistance point to your bike when you use the plus/minus button on the SS2K. If you find this, then you have to fill this value in QZ and it should work properly. Of course send me the debug log if it doesn't because you're the first one who is using SS2k with the schwinn :)
@eMadman maybe on the SS2K forums people are using it with schwinn (without QZ)? If so, you could ask them what their shift step value is. As Roberto pointed out, its really meant to give SS2K the information it needs so that it can add one level of resistance.
@marklogan17 , @cagnulein - this is eye-opening! I'll get back to you guys this weekend. Will try to get an SS2k into my buddy's hands for next week as well - he's got an IC4 as well and can help with testing.
@cagnulein @marklogan17 I wrote too soon over on Facebook. I did a full class just know and the resistance stopped updating somewhere between 5 and 8 minutes into the ride. Before that it was updating but was consistently 1-2 levels below the Peloton target.
Setup: IC4, SS2k, Peloton Conversion Offset = -10, Schwinn calculation On. LMK if you need other settings
I had the shift step set to 300, although I did try changing that to 400 late in the ride to no effect. I also unplugged and replugged the SS2K at some point and it seemed to connect again (the blue LED stopped blinking anyways). The shifter b uttons worked the whole time but the gears tile stopped at the same time as auto shifting. Gears also didn't start working until the class started for whatever that's worth.
QZ log attached. I didn't get an SS2K log unfortunately
This looks suspicious: Sat Dec 4 15:51:19 2021 1638661879573 Debug: /Users/cagnulein/qdomyos-zwift/src/smartspin2k.cpp void smartspin2k::characteristicChanged(const QLowEnergyCharacteristic &, const QByteArray &) Resistance received from SS2k: ### -257
@rjbutler there is a major issue on this log: at the time 15:41:25 the SS2K disconnects from the QZ app and it doesn't connect anymore. Maybe a bluetooth glitch? You can see this from these kind of lines:
Sat Dec 4 15:41:25 2021 1638661285503 Debug: /Users/cagnulein/qdomyos-zwift/src/smartspin2k.cpp void smartspin2k::controllerStateChanged(QLowEnergyController::ControllerState) "trying to connect back again..."
also about the -257 thing: i fixed this because SS2k was sending -1. Anyway the issue is that SS2K was probably in the middle of 2 resistance levels. Infact QZ wrote to reset but the SS2K answered back with -1. Anyway i fixed the wrong -257 thing but it was completely unrelated from the disconnection issue.
@cagnulein I tried power cycling the SS2K at some point during that log and initiated a bluetooth scan but it didn’t reconnect. Should it have?
Yes qz after is connected to ss2k will try forever to connect to it if it lost the connection.
If it happens again let's annotate the time of the events. So we can understand more. Thanks
@cagnulein Another couple of logs, both QZ and SS2K this time. It disconnected again at I think 15:29, from the SS2K side it looks like it immediately reconnected again but QZ never adjusted the resistance again. I tried powercycling the SS2K a couple of times a little later but no luck
It's also pretty consistently overshooting the target resistance. I'm set for the midpoint of the Peloton range and when it's working it's setting the the resistance level so the Schwinn calculated resistance is 3-5 points higher than the Peloton target tile. debug-Sun_Dec_5_15_15_20_2021.log 20211205 SS2K Logs.txt
@rjbutler didn't use the newest version that i send you yesterday? Anyway good news: thanks to your log i fixed a reconnection issue (of course you should understand why in your setup, you're seeing SS2K disconnections...maybe the SS2K has some bluetooth issue?) @marklogan17 didn't have this issue as i know. The version with this fix will be 2.8.136
About the overshooting: the calculated schwinn resistance is a metric calculated from your wattage so i guess you should try to look at the actual resistance level in the display of your bike. Anyway in the log the target resistance and the resistance on the SS2K always matches, so for sure it's not an issue of the chain peloton->qz->ss2k and that's a good start :)
I haven't had any bluetooth disconnections at all but my SS2K version is fairly out of date now. If I get some time later this week I'll build the new QZ version and give it a try. I'm nervous about updating SS2K since its been stable.
@marklogan17 i don't think it's reletated to QZ. SS2K just disconnects itself. Maybe it's better if @rjbutler could try with your old firmware just to understand if it's hardware or not ;)
@marklogan17 i don't think it's reletated to QZ. SS2K just disconnects itself. Maybe it's better if @rjbutler could try with your old firmware just to understand if it's hardware or not ;)
I'm in LA until Wednesday. When I'm home I can send the firmware I'm using.
@cagnulein the new version didn’t show up in Test Flight, not sure why.
On the overshooting, I’m comparing the Peloton Resistance tile to the Target Peloton Resistance tile. The Peloton Resistance tile is 3-5 points higher. I’ll note the time and values next workout and compare to the logs.
@rjbutler write me to roberto.viola83 at gmail.com your email. maybe i sent it to another one :D On the overshooting: hah ok, so probably there is a mismatch with all these conversions. Peloton resistance and SS2K resistance are both calculated, so a minimum difference creates the issue that you're seeing i guess.
@cagnulein - apologies for my absence on this ticket. I finally managed to get some testing time in last night as well. I managed to get resistance to auto follow in a peloton power zone ride for perhaps the first 5-10 minutes in this ride, but I found that it stayed out of sync with the callouts in the ride (possibly an issue with the ride's metadata?) and needed to be corrected upwards throughout the ride with the shift up buttons in QZ. Towards the last ~5 minutes or so of this log, I realized it wasn't adjusting resistance down at all
debug-Sun_Dec_5_17_53_04_2021.log
I hope it's useful.
I will check the log tomorrow. For the delay you have to use the peloton offset tile, it's a problem in the peloton api (they aren't precise also for the peloton bike owners )
Il giorno lun 6 dic 2021 alle 18:55 eMadman @.***> ha scritto:
@cagnulein https://github.com/cagnulein - apologies for my absence on this ticket. I finally managed to get some testing time in last night as well. I managed to get resistance to auto follow in a peloton power zone ride for perhaps the first 5-10 minutes in this ride, but I found that it stayed out of sync with the callouts in the ride (possibly an issue with the ride's metadata?) and needed to be corrected upwards throughout the ride with the shift up buttons in QZ. Towards the last ~5 minutes or so of this log, I realized it wasn't adjusting resistance down at all
debug-Sun_Dec_5_17_53_04_2021.log https://github.com/cagnulein/qdomyos-zwift/files/7662563/debug-Sun_Dec_5_17_53_04_2021.log
I hope it's useful.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cagnulein/qdomyos-zwift/issues/500#issuecomment-987014389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWF3N3YQAZHBUAUTE7DUPT2HJANCNFSM5IFX5PDQ .
-- Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud
@eMadman i checked the log and it seems that it was working fine. Probably you were just out of sync: remember that for power zone, QZ is getting data from homefitnessbuddy if you aren't a PZP premium user, and sometimes, the HFB metrics, aren't so precise (usually they don't have the warmup, so you can be out of sync for the full warmup thing, you can trim it then with the peloton offset tile as i suggested before).
Also no disconnection for you (so @rjbutler i guess you have something on your setup)
Let me know
@cagnulein Awesome! I'll dig further on this on my end and try another pz ride with the ss2k this week
Well, that was interesting. I couldn't really ride long enough to see if it disconnected. It kept driving the resistance up -- it went to 67 when the target was 32 before I manually reduced it and then it did it again on the next resistance change. I gave up then.
SS2K-Tue_Dec_7_14_08_16_2021.txt debug-Tue_Dec_7_14_08_16_2021.log
Something is definitely weird. I tried the same class again and this time it set the resistance too low instead of too high.
Well, that was interesting. I couldn't really ride long enough to see if it disconnected. It kept driving the resistance up -- it went to 67 when the target was 32 before I manually reduced it and then it did it again on the next resistance change. I gave up then.
SS2K-Tue_Dec_7_14_08_16_2021.txt debug-Tue_Dec_7_14_08_16_2021.log
the main issue of this is that the SS2K resistance is negative for the majority of the time. Are you starting always with resistance to the minimum? If not, you should because, instead of the echelon that sent the resistance over bluetooth, your bike doesn't send it. So QZ assumes that your bike is to resistance 0 each time at startup.
So do another try: put the resistance to the minimum before opening QZ, then do the class as you did. If it works, we should think about another way to calibrate the SS2K on the startup for the schwinn bike (for example, excluding the startup calibration for schwinn bike) let me know
Something is definitely weird. I tried the same class again and this time it set the resistance too low instead of too high.
infact, in this case, the resistance is not negative, probably you started the session in another position.
That makes sense. I'll try starting at zero
@cagnulein I'm happy to report that zeroing it out resulting in a ride that adjusted the resistance all the way through!
I don't see SS2K disconnecting in the logs, so I'm not sure if that's something you fixed or a transient issue. I wonder if I have heat problems with my SS2K.
One remaining issue is that the conversion is too high compared to the resistance tile. That gets compounded by the fact that the normal Schwinn conversion isn't great at the higher resistances anyway (at least on my bike, which has the older firmware). If I'm trying to target resistances in the 50s or more it really gets tough to pedal since the conversion seems to invert somewhere around 60 for me (with a -10 offset) where it takes increasingly more points on the Schwinn to increase the converted resistance -- so an extra couple of points really make a difference. I don't know if there's something wrong with the algorithm at the higher levels or it's a quirk of my bike.
@cagnulein I'm happy to report that zeroing it out resulting in a ride that adjusted the resistance all the way through!
great news! So i guess we can safely remove the zeroing from the schwinn-ss2k module. Is the SS2K remembering the last position when you turn it on?
I don't see SS2K disconnecting in the logs, so I'm not sure if that's something you fixed or a transient issue. I wonder if I have heat problems with my SS2K.
No i just fixed something AFTER the disconnection, so if you didn't see any disconnection, i guess it was something on the SS2K side or your scenario side :) but it's a good news :)
One remaining issue is that the conversion is too high compared to the resistance tile. That gets compounded by the fact that the normal Schwinn conversion isn't great at the higher resistances anyway (at least on my bike, which has the older firmware). If I'm trying to target resistances in the 50s or more it really gets tough to pedal since the conversion seems to invert somewhere around 60 for me (with a -10 offset) where it takes increasingly more points on the Schwinn to increase the converted resistance -- so an extra couple of points really make a difference. I don't know if there's something wrong with the algorithm at the higher levels or it's a quirk of my bike.
about this, we have to split this thing in 2: ride workout and power zone workout. let's focus on the first one. Peloton asks me for a resistance: what i'm doing right now, is sending the requested one to SS2K. So you're saying that the target resistance tile is not right, or that the SS2K resistance isn't?
also @eMadman do you feel the same too?
If "T. Peloton R" tile is at 40, matching the callout, I would manually set the Schwinn to about 25 to get a "Peloton R" value of 40 (using a -10 offset). With the SS2K, it sets the Schwinn to 27 or 28, and the "Peloton R" tile displays 43.
@rjbutler so you can't just put a lower offset, for example -14? or using a gain value that matches better it proportionally?
Shouldn't the "Peloton R" tile match the "T. Peloton R" tile if everything is working correctly? I would think changing the offset would make it easier to pedal but not really solve the problem
Or maybe harder to pedal since it's a negative offset?
@rjbutler the 2 of them should match (for example in the echelon it does) but not on your bike, because your bike doesn't have a real resistance to resistance conversion. Your bike sends only power, so when i set a resistance value on SS2K and we read again the resistance value, the peloton resistance couldn't be precise. BUT probably i have a solution for this.
Now this are the concurrent flows
peloton asks resistance -> conversion to schwinn resistance -> send the value to SS2K reading power and cadence from your bike -> translating in schwinn resistance -> translating to peloton resistance -> showing it to the peloton resistance tile
we can modify them in peloton asks resistance -> conversion to schwinn resistance -> send the value to SS2K if a SS2K is connected then: reading the resistance from SS2K -> transaliting to peloton resistance -> showing it into the peloton resistance tile otherwise: reading power and cadence from your bike -> translating in schwinn resistance -> translating to peloton resistance -> showing it to the peloton resistance tile
what do you think? @eMadman also
about the negative offset, if you changed the peloton offset means that when peloton asks for resistance 30, for example, you're doing like 20, so you're doing an easier job
@cagnulein I think what you're proposing makes sense, but perhaps a little clarity is needed:
if a SS2K is connected then: reading the resistance from SS2K -> transaliting to peloton resistance -> showing it into the peloton resistance tile
If I am I understanding correctly:
On my bike, when the dial is completely opened up to 0 and at the very end of rotation, QZ reports a resistance between 4-8 (this varies every day). I suspect that may also cause a syncing issue. I wonder if having a "calibrate 0" option in QZ would help for that. When I think about my 3d printer, accurate homing at 0 on all axes is very in order for the software to understand where the toolhead is in space.
I have SS2k paired to QZ and nothing else when I ride with QZ. As far as I understand, the SS2k acts as a dumb device to turn the knob in this sense - the QZ app is acting as the brain and telling SS2k how much to turn the dial in order to get to the desired resistance. What if we ignore the exact value reported by SS2k and focus on achieving the target resistance in QZ?
So that: If we're requesting 30 resistance on, QZ is sending instructions to ss2k to step either up or down until 30 resistance is met on QZ. Does the value on ss2k matter unless it tries to go out of bounds - below 0 or above 100?
@cagnulein I think what you're proposing makes sense, but perhaps a little clarity is needed:
if a SS2K is connected then: reading the resistance from SS2K -> transaliting to peloton resistance -> showing it into the peloton resistance tile
If I am I understanding correctly:
- at start, the resistance knob should be set to 0. When SS2k and QZ start, they'll start at 0 or close to 0 and be 'synced' this way.
yes
On my bike, when the dial is completely opened up to 0 and at the very end of rotation, QZ reports a resistance between 4-8 (this varies every day). I suspect that may also cause a syncing issue. I wonder if having a "calibrate 0" option in QZ would help for that. When I think about my 3d printer, accurate homing at 0 on all axes is very in order for the software to understand where the toolhead is in space.
yes it's what i would like to do too, but i don't know if SS2K has the ability to do so. This is why i'm telling to disable the auto sync feature on startup for the scwhinn bike. Because if the SS2K can remeber it's position, we can use it to have a right resistance from startup. What do you think also @doudar ?
I have SS2k paired to QZ and nothing else when I ride with QZ. As far as I understand, the SS2k acts as a dumb device to turn the knob in this sense - the QZ app is acting as the brain and telling SS2k how much to turn the dial in order to get to the desired resistance. What if we ignore the exact value reported by SS2k and focus on achieving the target resistance in QZ?
since SS2K has a real info from the knob of the schwinn bike, i think we shouldn't discard it. Because, instead of the echelon, the schwinn bike has a major lack: the realtime value of the resistance.
So that: If we're requesting 30 resistance on, QZ is sending instructions to ss2k to step either up or down until 30 resistance is met on QZ. Does the value on ss2k matter unless it tries to go out of bounds - below 0 or above 100?
mmm...you're saying, like a manual device...mmm i don't like it. I mean, QZ without the SS2K for the schwinn bike is trying to understand the resistance from the wattage. Now, with the SS2K we should know the real resistance value, so we shouldn't discard it! Instead we should use it! What do you think?
mmm...you're saying, like a manual device...mmm i don't like it. I mean, QZ without the SS2K for the schwinn bike is trying to understand the resistance from the wattage. Now, with the SS2K we should know the real resistance value, so we shouldn't discard it! Instead we should use it! What do you think?
Ahh, okay. I did not think SS2K provides real resistance from the bike. What I see in ss2k through the status screen on the browser didn't indicate any resistance reporting - I assumed the bike reports speed/cadence and everything is calculated from there.
I'll try the ss2k/qz integration again tonight but this time with the following:
SS2k Paired to schwinn QZ paired to ss2k
@eMadman i'm sure that it provides it, because i already implemented the handler for that frame :) but i don't know if it has the ability to store this information when it turns off.
@eMadman i'm sure that it provides it, because i already implemented the handler for that frame :) but i don't know if it has the ability to store this information when it turns off.
I think you're both right. SS2K does provide resistance out in the mode in which QZ uses it. So at start up QZ 'sets' the current resistance and then as SS2K changes the resistance it pushes that value out to QZ. So if QZ 'tells' SS2K to change resistance it does - and then reports it. If the physical buttons are used to change the SS2K resistance it changes the resistance and then reports out. However SS2K doesn't 'read' it from the bike. That's why its dependent on QZ setting it.
What @cagnulein is asking is: If after the first time you run it (set your resistance to zero, connect QZ and SS2K, run it), does SS2K 'remember' the resistance so that next time you start up it will go from there. I 'think' the answer is no. If you leave it plugged in and running it may, but I think it would lose it over any power cycle - so I don't think you can depend on it.
I honestly think the only way to do this with the Schwinn or any bike that doesn't directly report out resistance, is to set the resistance to zero (or a specified number I guess) every time at start up.
You’re correct, resistance is not remembered after reboot.
On Thu, Dec 9, 2021 at 7:43 AM marklogan17 @.***> wrote:
@eMadman https://github.com/eMadman i'm sure that it provides it, because i already implemented the handler for that frame :) but i don't know if it has the ability to store this information when it turns off.
I think you're both right. SS2K does provide resistance out in the mode in which QZ uses it. So at start up QZ 'sets' the current resistance and then as SS2K changes the resistance it pushes that value out to QZ. So if QZ 'tells' SS2K to change resistance it does - and then reports it. If the physical buttons are used to change the SS2K resistance it changes the resistance and then reports out. However SS2K doesn't 'read' it from the bike. That's why its dependent on QZ setting it.
What @cagnulein https://github.com/cagnulein is asking is: If after the first time you run it (set your resistance to zero, connect QZ and SS2K, run it), does SS2K 'remember' the resistance so that next time you start up it will go from there. I 'think' the answer is no. If you leave it plugged in and running it may, but I think it would lose it over any power cycle - so I don't think you can depend on it.
I honestly think the only way to do this with the Schwinn or any bike that doesn't directly report out resistance, is to set the resistance to zero (or a specified number I guess) every time at start up.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cagnulein/qdomyos-zwift/issues/500#issuecomment-989916352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEO2KHPRKMIQUQOFLLYP7DUQC6ATANCNFSM5IFX5PDQ .
--
---------------------- Anthony Doud
But the SS2K doesn't really "know" the resistance, it's just using what QZ tells it, and that's really just an approximation. For the Schwinn, it seems the only way to do this is to do what @eMadman said and just use SS2K to turn the knob. Give it some minimum amount of time at the beginning where the cadence is above say 60, use the Schwinn power to calculate the Peloton resistance and then if the target resistance is higher, turn the knob up and if lower, turn the knob down. Maybe build in some buffer on the high and low ends or add it as another config options to avoid going past zero or 100 (maybe no less than 4 no more than 96 on the Schwinn).
@rjbutler we have to start from an assumption: the SS2K step setting is right for your knob. If it is, we know that, from the startup and on, the SS2K will tell us the right resistance level. If it's so, we can discard all the resistance calculation based on power and using directly the value that the SS2K is telling us during the ride.
Since @doudar told us that it can't remember it after a power cycle, you have to start all the rides from the resistance 1 (or 0, i don't know if resistance 0 is avaiable on your bike)
Or maybe a +/- tile to tweak the resistance and get SS2k, Schwinn and QZ all in sync?
Or maybe a +/- tile to tweak the resistance and get SS2k, Schwinn and QZ all in sync?
for this you can always use the Gears tile :) (you can already)
for this you can always use the Gears tile :) (you can already)
Oh, I thought the gears tile just mimicked the physical buttons on the SS2K. If it adjusts the calculation then that should work
Describe the bug
Power, speed and cadence continue to appear in zwift
To Reproduce Setup:
Steps to reproduce the behavior:
Expected behavior
Log FIle https://drive.google.com/file/d/1EAYfuIV3rmlQK09TAkf3xEW-s5HDHWtv/view?usp=sharing