cagnulein / qdomyos-zwift

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

[REQ] NordicTrack S15i bike with MyWoosh #2436

Closed jones-d closed 1 month ago

jones-d commented 4 months ago

Is your feature request related to a problem? Please describe. When using MyWoosh, I would like QZ just to just control incline/decline. So I can manually adjust the resistance.

Describe the solution you'd like QZ to control incline and decline as per the route I am following.

Describe alternatives you've considered I have the new beta app, but it does not align to the route I am following.

Additional context Add any other context or screenshots about the feature request here.

jones-d commented 3 months ago

Ok, that was the log file from the companion app on the bike (I hope), but will try again. CheersDaveOn 15 Jul 2024, at 09:00, Roberto Viola @.***> wrote: ok that's an half good news. For the log i need the one from the companion directly. you can also get them using adb logcat -f > log.txt let me know

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

cagnulein commented 3 months ago

hi @jones-d you have to upload directly on github web interface otherwise I can't see it. thanks

jones-d commented 3 months ago

It was in the previous comment - reattaching the log from the bike directly. I will also try the other approach you outline. 2024-07-14_logs.txt

cagnulein commented 3 months ago

hah ok i misread your last comment. Nope, this log is from the fit app. I need the one from the companion

jones-d commented 3 months ago

I have run the adb-debug-mac - do these two files help? logcat.log logcat.txt

cagnulein commented 3 months ago

yes perfect. i'm checking

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

Il giorno lun 15 lug 2024 alle ore 11:12 jones-d @.***> ha scritto:

I have run the adb-debug-mac - do these two files help? logcat.log https://github.com/user-attachments/files/16232364/logcat.log logcat.txt https://github.com/user-attachments/files/16232366/logcat.txt

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

cagnulein commented 3 months ago

Correct me if I'm wrong: in this log you tried to change gears but it doesn't have any effect at all, right? If it's so, these are the swipe events (companion is correctly changing the resistance, but somehow it hasn't an effect)

adb shell input swipe 1848 728 1848 427 200
adb shell input swipe 1848 728 1848 404 200
adb shell input swipe 1848 728 1848 381 200
adb shell input swipe 1848 728 1848 312 200

can you try to run it manually from your pc and checking if the resistance changes? if not we have a coordinates issue. Thanks

jones-d commented 3 months ago

I built and ran this script,

`#!/bin/bash

Assumes Android treadmill USB debugging is turned on

read -p "Enter treadmill IP address: " TMIP

ping -c 4 $TMIP sleep 5

./adb disconnect ./adb kill-server ./adb connect $TMIP ./adb devices -l sleep 5

./adb shell input swipe 1848 728 1848 427 200 sleep 5 ./adb shell input swipe 1848 728 1848 404 200 sleep 5 ./adb shell input swipe 1848 728 1848 381 200 sleep 5 ./adb shell input swipe 1848 728 1848 312 200 sleep 5 `

I didn't see any changes in the resistance on the bike.

cagnulein commented 3 months ago

does it give any error? do you see any fake event somewhere? in the treadmill developer setting you can also enable the input trace to see where the touching point is

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

Il giorno lun 15 lug 2024 alle 17:11 jones-d @.***> ha scritto:

I built and ran this script,

`#!/bin/bash Assumes Android treadmill USB debugging is turned on

read -p "Enter treadmill IP address: " TMIP

ping -c 4 $TMIP sleep 5

./adb disconnect ./adb kill-server ./adb connect $TMIP ./adb devices -l sleep 5

./adb shell input swipe 1848 728 1848 427 200 sleep 5 ./adb shell input swipe 1848 728 1848 404 200 sleep 5 ./adb shell input swipe 1848 728 1848 381 200 sleep 5 ./adb shell input swipe 1848 728 1848 312 200 sleep 5 `

I didn't see any changes in the resistance on the bike.

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

jones-d commented 3 months ago

No errors when I send the command Turned debugging on Ran whilst cycling adb shell input swipe 1848 728 1848 427 200 I can see the plot on screen IMG_4059 (I stopped cycling to take the picture as it was better to see the trace)

jones-d commented 3 months ago

ran adb shell input swipe 1848 768 1848 312 200

This then moved the resistance slider to 20

cagnulein commented 3 months ago

it was 728 because in the log you were at resistance 4. so the first y argument is about the current resistance, and the second value to the destination. can you validate this formula

x1 = 1848; y1Resistance = 820 - (int) ((lastResistanceFloat) 23.16); y2 = y1Resistance - (int) ((reqResistance - QZService.lastResistanceFloat) 23.16);

jones-d commented 3 months ago

Perfect - so this all looks to be fine - let me try A run leaving the debug on to see if I can see the movements it makes when I change the gears in QZ

jones-d commented 3 months ago

I can see it is trying to change the resistance, but i don't think it is picking up the slider start point correctly https://github.com/user-attachments/assets/1e3041f5-6e79-4ffe-b363-5433875618de

jones-d commented 3 months ago

Check your formula, and this all looks to be correct. But in QZ app, it does seem to be working as defined. IMG_4061 Here in the app current resistance is 9 and target is 10 The app is trying to do the change but fails if I run it manually using your formula it works ./adb shell input swipe 1848 612 1848 589 200

cagnulein commented 3 months ago

are you able to calculate the right offset to replace the ones from the formula that I wrote above?

jones-d commented 3 months ago

Yes, this worked, when I did the ADB from my Mac and it correctly changed the resistance. But from QZ app, it looks like it is missing the start resistance (you might see this in the video in the previous comment).

cagnulein commented 3 months ago

qz is telling only the target one, it doesn't send the actual, it's the opposite: the companion sends the resistance and also it use it internally for the equation above. so i don't understand, if the algorithm is right and the resistance show in qz is right (receiving from the companion), where is the issue? I'm thinking louder. do you have any idea? did you try with different resitance starting point values?

jones-d commented 3 months ago

No idea on this one!  Let me do some more testing. To confirm, I should just increase the gears and the resistance some increase? (I unable to change the resistance title in the QZ app)  CheersDa sOn 15 Jul 2024, at 18:27, Roberto Viola @.***> wrote: qz is telling only the target one, it doesn't send the actual, it's the opposite: the companion sends the resistance and also it use it internally for the equation above. so i don't understand, if the algorithm is right and the resistance show in qz is right (receiving from the companion), where is the issue? I'm thinking louder. do you have any idea? did you try with different resitance starting point values?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

cagnulein commented 3 months ago

just use the gears for the resistance

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

Il giorno lun 15 lug 2024 alle ore 23:47 jones-d @.***> ha scritto:

No idea on this one! Let me do some more testing. To confirm, I should just increase the gears and the resistance some increase? (I unable to change the resistance title in the QZ app) CheersDa sOn 15 Jul 2024, at 18:27, Roberto Viola @.***> wrote: qz is telling only the target one, it doesn't send the actual, it's the opposite: the companion sends the resistance and also it use it internally for the equation above. so i don't understand, if the algorithm is right and the resistance show in qz is right (receiving from the companion), where is the issue? I'm thinking louder. do you have any idea? did you try with different resitance starting point values?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

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

stale[bot] commented 3 months ago

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.

jones-d commented 3 months ago

Just on holiday, I will be able to test when I am back at the end of the week. Many thanksDaveOn 16 Jul 2024, at 00:49, Roberto Viola @.***> wrote: just use the gears for the resistance

Roberto Viola

Software engineer and open source enthusiast

http://robertoviola.cloud

Il giorno lun 15 lug 2024 alle ore 23:47 jones-d @.***>

ha scritto:

No idea on this one! Let me do some more testing. To confirm, I should

just increase the gears and the resistance some increase? (I unable to

change the resistance title in the QZ app) CheersDa sOn 15 Jul 2024, at

18:27, Roberto Viola @.***> wrote:

qz is telling only the target one, it doesn't send the actual, it's the

opposite: the companion sends the resistance and also it use it internally

for the equation above. so i don't understand, if the algorithm is right

and the resistance show in qz is right (receiving from the companion),

where is the issue? I'm thinking louder. do you have any idea? did you try

with different resitance starting point values?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are

receiving this because you were mentioned.Message ID: @.***>

Reply to this email directly, view it on GitHub

https://github.com/cagnulein/qdomyos-zwift/issues/2436#issuecomment-2229494739,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAALYWC7VTN5DO3GI6GTZD3ZMQ7NPAVCNFSM6AAAAABKS2QJRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRZGQ4TINZTHE

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

cagnulein commented 3 months ago

ok, have a good vacation!

jones-d commented 3 months ago

All back, and did a quick test. QZ App and Bike only, screen debug turned on. 1st video - I started the manual ride, and the gear was set to 1 as the default. You can see the helper application trying to change resistance. 2nd video - changed gears in tile 3rd video - manually adjusted resistance down, you can see the helper application change the resistance. debug-Thu_Aug_8_10_05_17_2024.log

https://github.com/user-attachments/assets/0f51d76f-17a7-4a5a-b114-84d9f8e7cf23

https://github.com/user-attachments/assets/d0c196dc-f27c-4a6d-8554-4305abbbc242

https://github.com/user-attachments/assets/5ab1de9f-4d40-4f87-b487-4293c6ba24d9

So the helper can change the gears but not align with what gear you are in.

cagnulein commented 3 months ago

welcome back @jones-d are you able to collect an adb logcat while you are doing this? the issue is in the companion. Thanks

jones-d commented 3 months ago

I will give it a go, this is the log file that you can create from the Mac connecting to bike?On 8 Aug 2024, at 11:11, Roberto Viola @.***> wrote: welcome back @jones-d are you able to collect an adb logcat while you are doing this? the issue is in the companion. Thanks

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

cagnulein commented 3 months ago

yes simply run adb logcat after the test

stale[bot] commented 2 months ago

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.

jones-d commented 2 months ago

Sorry for the delay - here are the logs I just ran the app and the bike, started the manual ride, and started debugging on Mac. In the picture, the screen debug is trying to change from 5 to 16, but the current resistance is at 9, so it isn't changing. logcat.log IMG_4526 debug-Sat_Aug_31_11_01_46_2024.log.zip

cagnulein commented 2 months ago

Thanks I will check it ASAP

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

Il giorno sab 31 ago 2024 alle 12:09 jones-d @.***> ha scritto:

Sorry for the delay - here are the logs I just ran the app and the bike, started the manual ride, and started debugging on Mac. In the picture, the screen debug is trying to change from 5 to 16, but the current resistance is at 9, so it isn't changing. logcat.log https://github.com/user-attachments/files/16824206/logcat.log IMG_4526.jpeg (view on web) https://github.com/user-attachments/assets/f592fa6e-1b51-4cba-980d-0fe15d9f06d6 debug-Sat_Aug_31_11_01_46_2024.log.zip https://github.com/user-attachments/files/16824208/debug-Sat_Aug_31_11_01_46_2024.log.zip

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

cagnulein commented 2 months ago

@jones-d i created a new one https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.4.11/QZCompanionNordictrackTreadmill.apk

let's see if it's better

jones-d commented 2 months ago

Many thanks - I tested the new version, but I still seem to have the same issue. logcat.txt.zip [logcat.log.zip](https://github.com/user-attachments/ debug-Wed_Sep_4_13_54_48_2024.log.zip IMG_4553

files/16870868/logcat.log.zip)

cagnulein commented 2 months ago

ok i got the issue, it seems that the resistance value on the logcat is not mapped as currentresistance but in the currentgear one. let me try to modify this

cagnulein commented 2 months ago

ok let's try this one https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.4.14/QZCompanionNordictrackTreadmill.apk let me know!

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

Il giorno mer 4 set 2024 alle ore 15:01 jones-d @.***> ha scritto:

Many thanks - I tested the new version, but I still seem to have the same issue. logcat.txt.zip https://github.com/user-attachments/files/16870867/logcat.txt.zip [logcat.log.zip](https://github.com/user-attachments/ debug-Wed_Sep_4_13_54_48_2024.log.zip https://github.com/user-attachments/files/16870879/debug-Wed_Sep_4_13_54_48_2024.log.zip IMG_4553.jpeg (view on web) https://github.com/user-attachments/assets/b5e3b4a2-f672-46c3-83e8-cdf9fe7f0de7

files/16870868/logcat.log.zip)

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

jones-d commented 2 months ago

Thanks. I've done a quick test, and this update seemsto fix the issue. I will conduct a longer test with MyWhoop next week to see how it works. Kind regards DaveOn 6 Sep 2024, at 10:32, Roberto Viola @.***> wrote: ok let's try this one

https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.4.14/QZCompanionNordictrackTreadmill.apk

let me know!

Roberto Viola

Software engineer and open source enthusiast

http://robertoviola.cloud

Il giorno mer 4 set 2024 alle ore 15:01 jones-d @.***>

ha scritto:

Many thanks - I tested the new version, but I still seem to have the same

issue.

logcat.txt.zip

https://github.com/user-attachments/files/16870867/logcat.txt.zip

[logcat.log.zip](https://github.com/user-attachments/

debug-Wed_Sep_4_13_54_48_2024.log.zip

https://github.com/user-attachments/files/16870879/debug-Wed_Sep_4_13_54_48_2024.log.zip

IMG_4553.jpeg (view on web)

https://github.com/user-attachments/assets/b5e3b4a2-f672-46c3-83e8-cdf9fe7f0de7

files/16870868/logcat.log.zip)

Reply to this email directly, view it on GitHub

https://github.com/cagnulein/qdomyos-zwift/issues/2436#issuecomment-2328967201,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AAALYWCGRZ7S3E7IKLHLNYLZU4ABZAVCNFSM6AAAAABKS2QJRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRYHE3DOMRQGE

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

cagnulein commented 2 months ago

Awesome, thanks for the update! Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

Il giorno ven 6 set 2024 alle ore 14:37 jones-d @.***> ha scritto:

Thanks. I've done a quick test, and this update seemsto fix the issue. I will conduct a longer test with MyWhoop next week to see how it works. Kind regards DaveOn 6 Sep 2024, at 10:32, Roberto Viola @.***> wrote: ok let's try this one

https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.4.14/QZCompanionNordictrackTreadmill.apk

let me know!

Roberto Viola

Software engineer and open source enthusiast

http://robertoviola.cloud

Il giorno mer 4 set 2024 alle ore 15:01 jones-d @.***>

ha scritto:

Many thanks - I tested the new version, but I still seem to have the same

issue.

logcat.txt.zip

https://github.com/user-attachments/files/16870867/logcat.txt.zip

[logcat.log.zip](https://github.com/user-attachments/

debug-Wed_Sep_4_13_54_48_2024.log.zip

< https://github.com/user-attachments/files/16870879/debug-Wed_Sep_4_13_54_48_2024.log.zip>

IMG_4553.jpeg (view on web)

< https://github.com/user-attachments/assets/b5e3b4a2-f672-46c3-83e8-cdf9fe7f0de7>

files/16870868/logcat.log.zip)

Reply to this email directly, view it on GitHub

< https://github.com/cagnulein/qdomyos-zwift/issues/2436#issuecomment-2328967201>,

or unsubscribe

< https://github.com/notifications/unsubscribe-auth/AAALYWCGRZ7S3E7IKLHLNYLZU4ABZAVCNFSM6AAAAABKS2QJRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRYHE3DOMRQGE>

.

You are receiving this because you were mentioned.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

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

stale[bot] commented 1 month ago

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.