Giter Club home page Giter Club logo

Comments (40)

cagnulein avatar cagnulein commented on July 20, 2024 2

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024 2

@cagnulein, @fstrydex, @JuergenNeubauer, refer to my repo which documents in detail how I determined the values and equations required for QZ to control speed and incline on my C2950 treadmill. Also includes VBscript code to test speed and incline values and convert to equivalent input swipes: https://github.com/victorypoint/iFit-Wolf2

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

On Android I get an initial connection but immediately it stops working. If I kill the app and restart I can get a new connection but again it will immediately die. So I can see the speed/incline at the moment I open the app but that is where it stays until I kill/reopen.

ok please send me a debug log https://github.com/cagnulein/qdomyos-zwift/wiki/How-do-i-get-the-debug-log-in-case-something-doesn't-work%3F

On iPad the connection remains open and I can see speed/incline changes. But I cannot make and changes from the app.

that's because your treadmill is not added to the companion yet. You have to send me some screenshot as we did here #24 (comment)

From Zwift it finds their "wahoo" device and connects. But no speed/incline data is transmitted. When I start an activity in the top left it shows "Connection Failure"

can't you find the QZ device over bluetooth? The wahoo kickr on ios it's a zwift issue, but you can workaround it with the discovery app. More details here https://forums.zwift.com/t/zwift-didn-t-recognize-wahoo-kickr-with-direct-connect-using-ipad-mini-with-ios-16-1/592239/30?u=roberto_viola

From the Treadmill tablet I have tried X11i, X32i, 2950, and Other. From the Android app I have tried various different settings. I have verified that the app is running on the treadmill

check above :)

I have not been able to find the log dump on Android or iOs. Please direct me where it saves and I can upload it. When I attempt the log dump on the treadmill the app freezes.

check above :)

Thank you!

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Thank you for the reply. I need more breadcrumbs please...how do I generate the screenshots and linear graph?

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@fstrydex :) are you able to use adb from your pc or mac? in case we can use the screenshot script in the install folder

otherwise you can install a screenshot app on the tablet and take some screenshots from the tablet directly
let me know

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Deeper down the rabbit hole; I originally installed via browser. Now trying to connect via ADB, I can ping the ip but not able to connect.

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

I should also clarify: I am able to find the "Wahoo Tread" in Zwift on iPad and connect to it. But when I go into calibration it reports zero speed. Also when I start a run in Zwift after connecting I get "connection failure". I installed the Discovery app and clicked on Wahoo. The strange thing is that in the Discovery app it gives a different ip address than what is on the treadmill

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Deeper down the rabbit hole; I originally installed via browser. Now trying to connect via ADB, I can ping the ip but not able to connect.

ok if it's easier for you use a classic screenshot app

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

I should also clarify: I am able to find the "Wahoo Tread" in Zwift on iPad and connect to it. But when I go into calibration it reports zero speed.

you don't have to press the calibration, you don't need it

Also when I start a run in Zwift after connecting I get "connection failure". I installed the Discovery app and clicked on Wahoo. The strange thing is that in the Discovery app it gives a different ip address than what is on the treadmill

yes that's normal because it's the ip of qz not of the treadmill the one that you see it

on the ipad don't you see also the iphone name on the pairing screen?

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

I run both QZ and Zwift on the iPad

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Qz on background? It can't work. You have to put on split view

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Qz on background? It can't work. You have to put on split view

That solves 1 problem!
Also I tried a different android phone and QZ worked fine on that. Not sure it's worth the effort to troubleshoot the other android phone as I cannot access the log location.
So only remaining is the screenshots. Need to figure out how to find and side load a suitable app.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Ok let me know!

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

2023_03_19_15 04 40
2023_03_19_15 04 01
2023_03_19_15 04 18
2023_03_19_15 04 33

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

hi @fstrydex actually I saw that we already did some steps with @JuergenNeubauer on cagnulein/qdomyos-zwift#1010

So if you try to change speed on inclination on QZ don't you see anything moves on the ifit tablet?
On the QZ companion you have to select X11i of course and then keep the ifit app on foreground. You should see the sliders moving.

In case send me a QZ companion log if you can't see anything moving.
Thanks

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

So if you try to change speed on inclination on QZ don't you see anything moves on the ifit tablet?
Correct

On the QZ companion you have to select X11i of course and then keep the ifit app on foreground.
Yes

logcat.log

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

hi @fstrydex unfortunately this is the logcat from the system itself. I need the one from the QZ Companion app. In order to do so, recreate the issue and then from the companion app, press the dump log button and then a new file called logcat.txt will be created on the /sdcard/ folder

let me know

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Somehow it started working. Here is what I did. Because iFit after a while takes control of the system again it disables USB debugging. So I re-enabled USB debugging and I side loaded CX file explorer. In CX file explorer I enabled "show system storage".
Those are the only 3 things I did and it started working. I will give it a bit of time for iFit to lock the tablet again and see if it still works. I have tried many times previously with USB debugging enabled but it did not work. I am not saying it is solved, just that I will do more testing and report back.

But I think the coordinates previously loaded for the X11i are incorrect.
I get some jumping up and down on speed control. So + may end up going up or down in speed.
For incline I either get no adjustment or it declines. Never incline.
Can you please double check from my screenshots?

On the log files, best I can figure out is that the files are stored under "wolf log" folder as .txt. Is this what you are looking for?

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Somehow it started working. Here is what I did. Because iFit after a while takes control of the system again it disables USB debugging. So I re-enabled USB debugging and I side loaded CX file explorer. In CX file explorer I enabled "show system storage". Those are the only 3 things I did and it started working. I will give it a bit of time for iFit to lock the tablet again and see if it still works. I have tried many times previously with USB debugging enabled but it did not work. I am not saying it is solved, just that I will do more testing and report back.

ok keep us updated!

But I think the coordinates previously loaded for the X11i are incorrect. I get some jumping up and down on speed control. So + may end up going up or down in speed. For incline I either get no adjustment or it declines. Never incline. Can you please double check from my screenshots?

ok I can check it. For the incline, you mean also from the inclination tile you can't change them?

On the log files, best I can figure out is that the files are stored under "wolf log" folder as .txt. Is this what you are looking for?

yes! if you see the metrics on qz it means that i'm actually already reading them!

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Yes, I am specifically referring to the speed and incline tiles in QZ.
Sorry autocorrect messed up my typing: "wolf log" folder as a date.txt file

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

mmm @fstrydex the coordinates from your screenshot seems slightly different from the one posted from @JuergenNeubauer here cagnulein/qdomyos-zwift#1010 (comment)

but it's strange because he did a very great job on it.

the best and quickest way to achieve this is if you can try your self the input touch that qz is sending in order to move the sliders

let's start from the speed

actually the formula in order to get the speed is

y2 = (int) (621.997 - (21.785 * reqSpeed));

and qz is sending

input swipe 1207 prevY2 1207 y2 200

where prevY2 is the previous y2 coordinates of the last speed sent.

Are you able to run this command from adb @fstrydex ? and check with different speeds? so we can calibrate them.

Let me know

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Finally got adb working. Can you give me a bit more info on how to run this from adb?

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

simply run from a shell on your pc

adb shell

this will show a shell

then run

input swipe 1207 prevY2 1207 y2 200

replacing prevY2 and y2 with some values getting from the formula y2 = (int) (621.997 - (21.785 * reqSpeed));

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Im not quite able to figure this out. Here are a few values swiping up from 611.1 (0.5)
Should be. | Formula. | Actual
1 | 600.2. | 0.8
2 | 578.4 | 1.8
3 | 556.6 | 2

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Is 621.997 the lowest value (0.5)? If so, it is too high. The y for 0.5 is around 590. But even then the multiplier is incorrect. Here are the rough values for each speed clickable on the screen:
12 230.6
10 265.7
9 300.6
8 336.6
7 372.5
6 407.5
5 443.3
3 480.3
2 515.4
1 552.2
0.5 587.2

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

no 621 is the q constant in the linear equation

y = mx + q

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

ok, so then as an example the value for 0.5 is 611. Swiping from 611 to 600 gives me 0.8 instead of 1 speed

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Ok so are you able to validate a new linear equation using excel? On the excel chart you can create automatically the linear equation

from qzcompanionnordictracktreadmill.

JuergenNeubauer avatar JuergenNeubauer commented on July 20, 2024

Hi, my speed values were in km/h not miles per hour. I am still more familiar with kph rather than mph. Sorry for the confusion.

So divide the slope value 21.785 by 1.6 to calculate in mph. Can you query with QZ what units the user is using?

Also, can you use a round function before you cast to int? Might be more accurate?

Good luck, Juergen

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

Actually for the slope it is *1.6
Should be able to use whatever units the user is selecting from the phone app when communicating with the QZ companion. Probably easier than trying to figure it out from the iFit app.

I have done so much trial and error I am about ready to give up. I don't think the slider is quite linear so combined with not 100% accurate y measurements I can never quite get exact numbers.
@JuergenNeubauer formula works as well as anything I could figure out with trial and error. For example I can go from 1 to 12 exactly but I cannot go to 11 exactly.

So I think y2 = (int) (621.997 - ((21.785 * 1.6) * reqSpeed)); is as good as it gets

from qzcompanionnordictracktreadmill.

JuergenNeubauer avatar JuergenNeubauer commented on July 20, 2024

Sorry for the frustration. I will go back and measure some more. I don't remember how large the errors were. If the linear relationship and some rounding doesn't work robustly, another way would be to hard-code a small lookup table with good values for the major speed values that work. Maybe interpolating between them could produce the 1/10 increments well enough then.

@cagnulein Can I use the adb shell and the input swipe command or something similar to query the treadmill for the speed value for every possible integer value of the input swipe command? Or does the speed value show up somewhere else in the QZ logs?

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Actually for the slope it is *1.6

mmm that's sound strange to me. 1.6 should be applied only to speed to convert km to miles.

I have done so much trial and error I am about ready to give up. I don't think the slider is quite linear so combined with not 100% accurate y measurements I can never quite get exact numbers. @JuergenNeubauer formula works as well as anything I could figure out with trial and error. For example I can go from 1 to 12 exactly but I cannot go to 11 exactly.

So I think y2 = (int) (621.997 - ((21.785 * 1.6) * reqSpeed)); is as good as it gets

mmm ok so if it's so it's already the code inside qz. Since qz is sending km/h the reqSpeed value should be already contains the * 1.6 factor.

Sorry if I can't help you in this, but the only way to test this is to try as you're doing on the treadmill itself. It's strange that it feels like not linear, because on the @victorypoint treadmil it's quite linear

Sorry for the frustration. I will go back and measure some more. I don't remember how large the errors were. If the linear relationship and some rounding doesn't work robustly, another way would be to hard-code a small lookup table with good values for the major speed values that work. Maybe interpolating between them could produce the 1/10 increments well enough then.

Yes that's sound good for sure. maybe @fstrydex you can try with some fix value to validate this idea?

@cagnulein Can I use the adb shell and the input swipe command or something similar to query the treadmill for the speed value for every possible integer value of the input swipe command?

yes for sure, check my above example for @fstrydex

Or does the speed value show up somewhere else in the QZ logs?

yes it's also available in the log, but i suggest first to use the fixed method in order to leave QZ out of the game until we have a right formula.

Thanks to both

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

image
Here is everything I was able to capture yesterday. The top table are the y coordinates. I also calculated the differences between each but no matter how hard I tried I could not get it to closer to consistent differences between each value.
Notice on the graph how there are straight lines between 1 & 3 and 5 & 10. But they don't exactly follow the trend line. The missing 4 and 11 on the screen creates the deviations from the trend line.
The slope calculation of 31.254 is too low. Something around 34 is a better slope.
The bottom table is the linear equation applied. As it shows it's using 34.856 & 621.997 and not the values from the graph (Just because that's where I ended my testing yesterday)

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

thanks @fstrydex
so one big question: do you think it's better to go to the lookup table approach?
If so i just need each possible coordinate for each possible value of the slider.
Let me know!
If you want in the meantime i can change the actual equation on the code, with the one that you just provided.

from qzcompanionnordictracktreadmill.

fstrydex avatar fstrydex commented on July 20, 2024

@cagnulein I did more testing last night, including attempting @victorypoint 's approach. I need to do more testing. I need to setup a laptop next to the treadmill because this running between the pc upstairs and treadmill downstairs is getting old!
Here are some of the additional things I learned;

  • I seem to be getting inconsistent swipes on the same values. Probably due to sluggish tablet? This may be the root of the problem. Need more testing while standing next to the treadmill to observe.
  • The "buttons" onscreen for 1,,2,3, etc speed values have different y values than the slider for the same speed values. The table above that I originally compiled is for the "button" values, not the slider values. Need to compile a new table to see if a lookup table approach could work.
  • The 0.5 value is a problem that is messing the linear line up somewhat. It's not a full step but it is also not a half step. Maybe we should ignore 0.5 and do not go below 1?

As I need to do more testing, maybe we can attack the remaining 2 problems:

  • Incline slider. What is the current formula?
  • Zwift is not sending speed/incline values to QZ/treadmill.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024
  • The 0.5 value is a problem that is messing the linear line up somewhat. It's not a full step but it is also not a half step. Maybe we should ignore 0.5 and do not go below 1?

yes we can do what we want :) at least as for a first step :)

  • Incline slider. What is the current formula?

(565.491 - (8.44 * reqInclination));

  • Zwift is not sending speed/incline values to QZ/treadmill.

zwift doesn't send inclination or speed to any treadmill by default. but i did some workaround

  1. https://github.com/cagnulein/qdomyos-zwift/wiki/Zwift-Auto-Inclination-with-one-Android-Device-Only-Guide
  2. https://www.youtube.com/watch?v=KTQ2n7yeDbo

from qzcompanionnordictracktreadmill.

JuergenNeubauer avatar JuergenNeubauer commented on July 20, 2024

@cagnulein, @fstrydex, @JuergenNeubauer, refer to my repo which documents in detail how I determined the values and equations required for QZ to control speed and incline on my C2950 treadmill. Also includes VBscript code to test speed and incline values and convert to equivalent input swipes: https://github.com/victorypoint/iFit-Wolf2

@victorypoint You grep the wolf file for KPH changes, what if the user is using MPH units?

You used speed = 1.0 kph as your value for bottomy, not 0.0 kph, no?

Not surprisingly, it seems the two tablets will have different scaling behavior as they have different screen sizes and resolutions.

The Round operation might be important and the accuracy of the cSpeed and nSpeed value, only to one decimal.

bottomy = 807
speedscale = 31.0

speedy1 = bottomy - Round( (cSpeed - 1.0) * speedscale ) = bottomy - Round( cSpeed * speedscale ) + speedscale

speedy1 = 776 - Round ( cSpeed * speedscale )

The X11i at least is quite tricky when you lower the speed to less than 0.5 mph, then it stops the workout. So getting that value wrong is quite the show stopper.

@fstrydex So far you had not used the onscreen SLIDER, but only the preset speed values, in MPH? Maybe I'm wrong, is the SWIPE command based on the SLIDER action? Again, in MPH or KPH?

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@victorypoint You grep the wolf file for KPH changes, what if the user is using MPH units?

No sorry, have not tried mph yet.

You used speed = 1.0 kph as your value for bottomy, not 0.0 kph, no?

Yes. If you look at my screenshot, you will see speed slider goes down to 1.0 minimum. Yours goes to 0?

Not surprisingly, it seems the two tablets will have different scaling behavior as they have different screen sizes and resolutions.

Yes, it's all screen size and resolution dependent.

The Round operation might be important and the accuracy of the cSpeed and nSpeed value, only to one decimal.

Yes, I found the equation works perfect on my C2950.

The X11i at least is quite tricky when you lower the speed to less than 0.5 mph, then it stops the workout. So getting that value wrong is quite the show stopper.

You could limit the lowest speed to 1.0 and it should be fine.

@fstrydex So far you had not used the onscreen SLIDER, but only the preset speed values, in MPH? Maybe I'm wrong, is the SWIPE command based on the SLIDER action? Again, in MPH or KPH?

Yes, the swipe needs a start coordinate and end coordinate which controls the sliders.

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@victorypoint You grep the wolf file for KPH changes, what if the user is using MPH units?

No sorry, have not tried mph yet. The equations should still work fine as you will have practically the same speed slider.

You used speed = 1.0 kph as your value for bottomy, not 0.0 kph, no?

Yes. If you look at my screenshot, you will see speed slider goes down to 1.0 minimum. Yours goes to 0?

Not surprisingly, it seems the two tablets will have different scaling behavior as they have different screen sizes and resolutions.

Yes, it's all screen size and resolution dependent.

The Round operation might be important and the accuracy of the cSpeed and nSpeed value, only to one decimal.

Yes, I found the equation works perfect on my C2950.

The X11i at least is quite tricky when you lower the speed to less than 0.5 mph, then it stops the workout. So getting that value wrong is quite the show stopper.

You could limit the lowest speed to 1.0 and it should be fine.

@fstrydex So far you had not used the onscreen SLIDER, but only the preset speed values, in MPH? Maybe I'm wrong, is the SWIPE command based on the SLIDER action? Again, in MPH or KPH?

Yes, the swipe needs a start coordinate and end coordinate which controls the sliders.

from qzcompanionnordictracktreadmill.

stale avatar stale commented on July 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from qzcompanionnordictracktreadmill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.