cagnulein / QZCompanionNordictrackTreadmill

Companion App of QZ for Nordictrack Treadmills and Bikes
https://www.qzfitness.com/
GNU Affero General Public License v3.0
43 stars 12 forks source link

No connection to x22i #65

Closed samkenw closed 7 months ago

samkenw commented 10 months ago

Hi there,

Trying to get this to run with my Nordictrack x22i.

What I did: Installed companion via browser (no windows pc available). In the companion app I selected "other". In the QZ app (iOS) added the IP address of the treadmill.

Issue: In the iOS app I am seeing the data fields - but nothing is changing.

Logs: In the log dump in the companion app on the treadmill I get:

2023-11-03 17:59:18.755 Service started 2023-11-03 17:59:18.765 Service onCreate 2023-11-03 17:59:18.765 Service postDelayed 2023-11-03 17:59:18.766 Service started 2023-11-03 17:59:19.267 Service run 2023-11-03 17:59:19.276 /sdcard/.wolflogs/ 2023-11-03 17:59:19.276 lastModifiedFile /scard/wolflogs/2023-11-03 _logs.txt 2023-11-03 17:59:19.277 string: /sdeard/wolflogs/2023-11-03_logs.txt 2023-11-03 17:59:19.277 Parsing /sdcard/.wolflogs/2023-11-03_logs.txt 2023-11-03 17:59:19.278 Device: null 2023-11-03 17:59:19.654 2023-11-03 17:59:19.894 2023-11-03 17:59:19.936 Got UDP broadcast from , message: -1;-100 2023-11-03 17:59:19.937 -1:-100

cagnulein commented 10 months ago

Hi @samkenw try to set the c1750 device on the treadmill companion and reboot it

Let me know

samkenw commented 10 months ago

Great, data is now being shown in the app! Thanks. However, controlling the treadmill does not seem to work. Am I missing a setting?

cagnulein commented 10 months ago

Great! In order to add control to it I need a screenshot of your manual view on the tablet that you can with adb via this script https://github.com/cagnulein/QZCompanionNordictrackTreadmill/blob/master/InstallPackage/adb-screenshot.bat

Don't u have a pc or a Mac?

samkenw commented 10 months ago

I have a Mac, suppose I can't just execute the bat. Will try adapting and let you know. Thanks

cagnulein commented 10 months ago

yes you need to call the adb lines

Il giorno ven 3 nov 2023 alle 18:48 Sam K @.***> ha scritto:

I have a Mac, suppose I can't just execute the bat. Will try adapting and let you know. Thanks

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1792881338, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWE3AMYXKIJGASKWWYDYCUVAXAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSHA4DCMZTHA . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

yea, doing that but getting "connection refused"

cagnulein commented 10 months ago

did you enable adb on the treadmill tablet? you should also need to do a factory reset on it in order to enable adb

Il giorno ven 3 nov 2023 alle 18:53 Sam K @.***> ha scritto:

yea, doing that but getting "connection refused"

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1792887636, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWGGPGMVJQD6AICU5NLYCUVTHAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSHA4DONRTGY . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

adb is enabled.. is factory reset necessary even though I can turn on debugging in developer options? I have not done the factory reset however. I will do that and get back to you.

samkenw commented 10 months ago

I am seeing that there is no wireless debugging option.. must I use adb via USB?

cagnulein commented 10 months ago

nope as far as i know adb is available only on wifi

Il giorno ven 3 nov 2023 alle 19:13 Sam K @.***> ha scritto:

I am seeing that there is no wireless debugging option.. must I use adb via USB?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1792915522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWFA3GBED46PIOMWMU3YCUX5VAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSHEYTKNJSGI . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

Okay, so to clarify: do I need to reset to be able to adb connect even though I have already turned usb debugging on?

samkenw commented 10 months ago

Is there another way I can get the screenshot? Perhaps I can upload a photo?

cagnulein commented 10 months ago

Okay, so to clarify: do I need to reset to be able to adb connect even though I have already turned usb debugging on?

Yes exactly, ifit closed the door on the latest releases.

You can use an apk that take a screenshot on the tablet and then upload the picture. It must be precise to the pixel

samkenw commented 10 months ago

Okay, I understand, thanks for clarifying! Do you need a screenshot of a specific screen?

samkenw commented 10 months ago

Sadly after reset still getting:

adb connect 123.456.123.456

  • daemon not running; starting now at tcp:5037
  • daemon started successfully > failed to connect to '123.456.123.456:5555': Connection refused
cagnulein commented 10 months ago

Okay, I understand, thanks for clarifying! Do you need a screenshot of a specific screen?

Yes of the manual workout screen

cagnulein commented 10 months ago

Sadly after reset still getting:

adb connect 123.456.123.456

  • daemon not running; starting now at tcp:5037

  • daemon started successfully

> failed to connect to '123.456.123.456:5555': Connection refused

Ok if you want let's try a thing: clicking on the plus and minus button on the inclination tile on qz, staying on the manual workout screen on the treadmill, check you see some touch event on the tablet. If so we have hopes!

Let me know

samkenw commented 10 months ago

(after reset) reading is still working but sadly no touch events visible. (I set touch to be visible in developer options)

cagnulein commented 10 months ago

Mmm another test From a terminal app on the tablet try to run input swipe 100 200 300 400 200

Check if you see a touch event

Now I'm going to bed, we will catch up tomorrow Thanks

samkenw commented 10 months ago

Will try that! Can you recommend an app and mirror?

cagnulein commented 10 months ago

nope but there are dozens of terminal app :)

samkenw commented 10 months ago

Alright thanks. Btw. if you are basically simulating pressing buttons on the screen, I can give you the location of all UI elements by activating the "show pointer location" in the developer options. Additionally I can send you a photo of the screen so you know where which action is. Would this be sufficient?

cagnulein commented 10 months ago

yes it should be enough 4 points

max speed, min speed, max inclination, min inclinatio

then i derive the linear formula ;)

samkenw commented 10 months ago

sorry, what do you mean with "max speed" etc. The buttons that increase the speed on the screen for example?

cagnulein commented 10 months ago

the slider that you have in the manual workout window on the ifit tablet. do you have 2 slider, right?

samkenw commented 10 months ago

no, I have included a picture of the screen. The settings are changed with manual buttons, I guess the same as on the x32i models. tempImagelcJFmi

samkenw commented 10 months ago

so sorry, I can enable the sliders. Give me a few minutes, I will pass the values

samkenw commented 10 months ago

Alright: max incline (40%) x: 75, y: 275 min incline: (-6%) x: 75, y: 845 max speed (22kph) x: 1845, y: 275 min speed (1kph): x: 1845, y: 845

cagnulein commented 10 months ago

Thanks, I will add them asapInviato da Apple WatchIl giorno 4 nov 2023, alle ore 18:37, Sam K @.***> ha scritto: Alright: max incline (40%) x: 75, y: 275 min incline: (-6%) x: 75, y: 845 max speed (22kph) x: 1845, y: 275 min speed (1kph): x: 1845, y: 275

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

samkenw commented 10 months ago

Quick update: I have updated to the newest app version. Now the y-values have slightly changed (same for incline and speed) x-values are the same:

y-low: 785 y-high: 265

cagnulein commented 10 months ago

Thanks for the update!

Il giorno sab 4 nov 2023 alle 19:15 Sam K @.***> ha scritto:

Quick update: I have updated to the newest app version. Now the y-values have slightly changed (same for incline and speed) x-values are the same:

y-low: 785 y-high: 265

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793512170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWHWM6G7IWYFPACFJXLYC2A5NAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGUYTEMJXGA . You are receiving this because you commented.Message ID: @.*** com>

cagnulein commented 10 months ago

done @samkenw download the new one https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.3.13/QZCompanionNordictrackTreadmill.apk and select the new device from the list and restart the treadmill

Let me know!

samkenw commented 10 months ago

Thanks for the update!

I have selected x22i in the companion app and restarted. Not getting any data in the iOS app and no control. Log dump:

2023-11-05 11:25:31.41 Service started 2023-11-05 11:25:31.412 Service onCreate 2023-11-05 11:25:31.412 Service postDelayed 2023-11-05 11:25:31.412 Service started 2023-11-05 11:25:31.463 Waiting for UDP broadcast 2023-11-05 11:25:31.915 Service run 2023-11-05 11:25:31.923 /scard/.wolflogs/ 2023-11-05 11:25:31.923 lastModifiedFile /sdcard/.wolflogs/2023-11-05_logs.txt 2023-11-05 11:25:31.924 string: /sdcard/.wolflogs/2023-11-05_logs.txt 2023-11-05 11:25:31.924 Parsing /sdcard/.wolflogs/2023-11-05_logs.txt 2023-11-05 11:25:31.925 Device: x221 2023-11-05 11:25:32.355 IOException: sendto failed: ENETUNREACH (Network is unreachable) 2023-11-05 11:25:32.442 IOException: sendto failed: ENETUNREACH (Network is unreachable) 2023-11-05 11:25:32.609 IOExcention: sendto failed: ENETUNREACH (Network is unreachable)

I have also tested with selecting c1750: this is still transmitting data to the app but no control.

cagnulein commented 10 months ago

ok so please test the adb swipe thing that I said above. it's the only way to override the ifit protection

Il giorno dom 5 nov 2023 alle 11:59 Sam K @.***> ha scritto:

Thanks for the update!

I have selected x22i in the companion app and restarted. Not getting any data in the iOS app and no control. Log dump:

2023-11-05 11:25:31.41 Service started 2023-11-05 11:25:31.412 Service onCreate 2023-11-05 11:25:31.412 Service postDelayed 2023-11-05 11:25:31.412 Service started 2023-11-05 11:25:31.463 Waiting for UDP broadcast 2023-11-05 11:25:31.915 Service run 2023-11-05 11:25:31.923 /scard/.wolflogs/ 2023-11-05 11:25:31.923 lastModifiedFile /sdcard/.wolflogs/2023-11-05_logs.txt 2023-11-05 11:25:31.924 string: /sdcard/.wolflogs/2023-11-05_logs.txt 2023-11-05 11:25:31.924 Parsing /sdcard/.wolflogs/2023-11-05_logs.txt 2023-11-05 11:25:31.925 Device: x221 2023-11-05 11:25:32.355 IOException: sendto failed: ENETUNREACH (Network is unreachable) 2023-11-05 11:25:32.442 IOException: sendto failed: ENETUNREACH (Network is unreachable) 2023-11-05 11:25:32.609 IOExcention: sendto failed: ENETUNREACH (Network is unreachable)

I have also tested with selecting c1750: this is still transmitting data to the app but no control.

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793703795, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWG2VMGRRF4H7V5GWNDYC5WRRAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4YDGNZZGU . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

Tested the sipe, I am seeing an input event. but as I said, when selecting x22i in the companion I am also not receiving any data

cagnulein commented 10 months ago

ok so it means I need to implement the adb method in qz, no problem I already did it.

Right now this method is available for android or windows. is one of this ok for you?

otherwise It means I have to do a bigger development

Il giorno dom 5 nov 2023 alle 12:30 Sam K @.***> ha scritto:

Tested the sipe, I am seeing an input event. but as I said, when selecting x22i in the companion I am also not receiving any data

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793710234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWGHM7UQ3M6YTWX7673YC52D3AVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4YTAMRTGQ . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

I sadly have neither android nor windows... will the adb method work even though I cannot use adb to connect to the treadmill from my Mac?

cagnulein commented 10 months ago

do you have a m1-2-3 mac or an intel one?

Il giorno dom 5 nov 2023 alle 12:35 Sam K @.***> ha scritto:

I sadly have neither android nor windows... will the adb method work even though I cannot use adb to connect to the treadmill from my Mac?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793711581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWCLPLHJDWHSMDWHHK3YC52ZLAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4YTCNJYGE . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

intel

cagnulein commented 10 months ago

ok i can try a build but only starting from wednesday

also using the mac version will require to become a patreon member due to the high development required

Il giorno dom 5 nov 2023 alle 12:37 Sam K @.***> ha scritto:

intel

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793711880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWH73WBASZDE22QYKGTYC526PAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4YTCOBYGA . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

tell you what, I have a raspberry on which I can try running adb - would this help?

samkenw commented 10 months ago

I fully understand the requirement for patreon. However this is currently outside of my scope, so perhaps don't develop this just for me. I will try a VM for windows.

cagnulein commented 10 months ago

also the window version requires the patreon one but at least it's already available:)

Il giorno dom 5 nov 2023 alle 12:41 Sam K @.***> ha scritto:

I fully understand the requirement for patreon. However this is currently outside of my scope, so perhaps don't develop this just for me. I will try a VM for windows.

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793712728, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWDCSA2NA7HPUQEOKW3YC53OVAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4YTENZSHA . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

I understand. I am not certain that adb will work for this model as it is running android 5.1.1 and it seems that network debugging may not be possible anyway.

cagnulein commented 10 months ago

how did you run the adb swipe thing? from terminal?

if so can you please dump log from the companion just after pressing the plus button of the speed or inclination tile

maybe there is still something to fix, let me know

Il giorno dom 5 nov 2023 alle 12:47 Sam K @.***> ha scritto:

I understand. I am not certain that adb will work for this model as it is running android 5.1.1 and it seems that network debugging may not be possible anyway.

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/65#issuecomment-1793714119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWE2NMWP7SPQ5IRRBYLYC54GNAVCNFSM6AAAAAA64XWWIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4YTIMJRHE . You are receiving this because you commented.Message ID: @.*** com>

samkenw commented 10 months ago

Yes from a terminal. Perhaps this is the issue: it sees and transmits from treadmill to app correctly - but values received from app are invalid

Log dump:

2023-11-05 12:52:59.668 Parsing /sdcard/wolflogs/2023-11-05_logs.txt 2023-11-05 12:52:59.674 Device: c1750 2023-11-05 12:52:59.9 [35] 3360145 12:52:44.4274 [Trace:FitPro] Changed KPH to: 3 2023-11-05 12:52:59.905 [27] 3360438 12:52:44.7205 (Trace:FitPro] Changed Watts to: 119 2023-11-05 12:53:00.028 Got UDP broadcast from ip, message: -1;-100 2023-11-05 12:53:00.031 -1;-100 2023-11-05 12:53:00.035 requestSpeed: -1.0 lastSpeed:3.0 cachedSpeed:-1.0 2023-11-05 12:53:00.038 requestInclination: -100.0 -100.0 2023-11-05 12:53:00.046 Waiting for UDP broadcast 2023-11-05 12:53:00.05 Waiting for UDP broadcast

samkenw commented 10 months ago

In the app, I have no treadmill selected - is there a specific option I need to set for the correct values to be transmitted?

cagnulein commented 10 months ago

In the app, I have no treadmill selected - is there a specific option I need to set for the correct values to be transmitted?

that's right

samkenw commented 10 months ago

Which treadmill would I need to select? The x22i is not an option.

cagnulein commented 10 months ago

in the log that you sent i don't see the requested speed, probably you got a moment after the send (qz is always send that formula so you can scroll the dump log looking for a speed request with a value different from -1)