cagnulein / QZCompanionNordictrackTreadmill

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

3.4.7 Crashes on Samsung Tab S9+ #107

Open Olorin92 opened 1 month ago

Olorin92 commented 1 month ago

Hi there,

As per the title - I've installed the 3.4.7. version of the APK onto my Samsung Tab S9+, but when opening it just crashes immediately. I've done the pre-requisite setup on my Nordictrack treadmill and all appears to be running properly, so not sure what I should do here.

Any help would be greatly appreciated!

Olorin92 commented 1 month ago

Seems to be not just limited to my tablet, my Pixel phone also has the same problem. Both are running Android 14 which could be the issue I guess?

cagnulein commented 1 month ago

you don't have to install this apk on a regular android but only on the nordictrack tablets :) which nordictrack device do you have?

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

Il giorno dom 25 ago 2024 alle 08:26 Olorin92 @.***> ha scritto:

Seems to be not just limited to my tablet, my Pixel phone also has the same problem. Both are running Android 14 which could be the issue I guess?

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionNordictrackTreadmill/issues/107#issuecomment-2308674690, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWBEETPLSXVHAYA3NFDZTF2IJAVCNFSM6AAAAABNCIGDT6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGY3TINRZGA . You are receiving this because you are subscribed to this thread.Message ID: <cagnulein/QZCompanionNordictrackTreadmill/issues/107/2308674690@ github.com>

Olorin92 commented 1 month ago

So I ended up getting the QZ app from the app store and that worked perfectly!

One question - I'm guessing the speed/incline control from within the QZ companion app is essentially just mapping to touches on the treadmill tablet UI (not directly sending some sort of backend request to increase speed/incline)?

And in terms of compatibility - I have a T9.5s but I've just done T7.0 as that was the closest I could find. I assume this only matters for the previously mentioned speed/incline adjustment?

cagnulein commented 1 month ago

yes qz uses the touch screen event to map inclination and speed changes.

you can use the adb screenshot batch file to collect the manual workout window of ifit so i can add the compatibility of your treadmill too

let me know!

Olorin92 commented 1 month ago

Oh sure I can do that!

I guess I just need to start a workout, then ensure the speed and incline is shown on screen and then run the ADB screenshot batch file?

Olorin92 commented 1 month ago

However I just get the following:

List of devices attached
192.168.1.111:5555     device product:argon2 model:MalataMediatekArgon2 device:argon2 transport_id:1

Waiting for 0 seconds, press a key to continue ...
adb.exe: no devices/emulators found
adb: error: failed to get feature set: no devices/emulators found
adb.exe: no devices/emulators found
cagnulein commented 1 month ago

did you enable the adb setting in the developer settings on your treadmill?

Olorin92 commented 1 month ago

All good - was because I don't have 'adb' in my path (just modified it to use .\adb.exe instead). Here is the screenshot! t9 5s screenshot

cagnulein commented 1 month ago

perfect, i will add it tomorrow

cagnulein commented 4 weeks ago

@Olorin92 done https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.4.8/QZCompanionNordictrackTreadmill.apk select the t9.5s new device and restart the treadmill

let me know!

Olorin92 commented 4 weeks ago

Awesome thank you!

Sorry to sidetrack with another question - but I noticed overnight that the app that gets installed on the treadmill had crashed, and took a couple of times to start it up successfully. Is that normal behavior?

cagnulein commented 4 weeks ago

are you able to provide me a adb logcat of the crash? it shouldn't happen of course

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

Il giorno lun 26 ago 2024 alle 11:30 Olorin92 @.***> ha scritto:

Awesome thank you!

Sorry to sidetrack with another question - but I noticed overnight that the app that gets installed on the treadmill had crashed, and took a couple of times to start it up successfully. Is that normal behavior?

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

Olorin92 commented 3 weeks ago

So finally got around to installing the updated companion - set the treadmill to the model you added 😄

One thing I realized though - doesn't something like Zwift or the companion app (the one that actually goes on the tablet or phone, NOT the treadmill) also need to be aware of the T9.5s button locations?

cagnulein commented 3 weeks ago

Nope only qz needs to know the buttons locations

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

Il giorno lun 2 set 2024 alle 14:09 Olorin92 @.***> ha scritto:

So finally got around to installing the updated companion - set the treadmill to the model you added 😄

One thing I realized though - doesn't something like Zwift or the companion app (the one that actually goes on the tablet or phone, NOT the treadmill) also need to be aware of the T9.5s button locations?

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

Olorin92 commented 3 weeks ago

So I did do that and then used the companion app, but the speed change and incline didn't do anything 😢

cagnulein commented 3 weeks ago

Ok this means that the coordinates for inclination are not right. Can you share a debug log showing the issue? https://github.com/cagnulein/qdomyos-zwift/wiki/How-do-i-get-the-debug-log-in-case-something-doesn't-work%3F

Olorin92 commented 3 weeks ago

So just to make sure - I've got the QZ companion app installed on my treadmill and have the T9.5s treadmill selected in there.

On my tablet I've installed the QZ app from here: https://play.google.com/store/apps/details?id=org.cagnulen.qdomyoszwift. In the settings for this app I can't see the T9.5s so just picked what was closest (T8.5s).

Is this all setup correctly?

If so - should I be getting the dump above from my phone or the treadmill?

cagnulein commented 3 weeks ago

Yes you did correctly. Just a confirm : you can see speed and inclination on qz, you can also control speed but not inclination from qz, right? If so the log is required from the qz app on your phone

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

Il giorno lun 2 set 2024 alle 14:34 Olorin92 @.***> ha scritto:

So just to make sure - I've got the QZ companion app installed on my treadmill and have the T9.5s treadmill selected in there.

On my tablet I've installed the QZ app from here: https://play.google.com/store/apps/details?id=org.cagnulen.qdomyoszwift. In the settings for this app I can't see the T9.5s so just picked what was closest (T8.5s).

Is this all setup correctly?

If so - should I be getting the dump above from my phone or the treadmill?

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

Olorin92 commented 3 weeks ago

I can't control speed or incline on the app 😞

cagnulein commented 3 weeks ago

Ok share a debug log so I will check it

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

Il giorno lun 2 set 2024 alle 14:53 Olorin92 @.***> ha scritto:

I can't control speed or incline on the app 😞

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

Olorin92 commented 3 weeks ago

Will do! So from the phone or the treadmill?

cagnulein commented 3 weeks ago

From the phone

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

Il giorno lun 2 set 2024 alle 15:06 Olorin92 @.***> ha scritto:

Will do! So from the phone or the treadmill?

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

Olorin92 commented 3 weeks ago

debug-Mon_Sep_2_23_09_33_2024.log Here's a log from the phone - I started a run on the treadmill then hit the speed and incline buttons up and down in the QZ app but nothing happened

cagnulein commented 3 weeks ago

do you see any touch event on the treadmill when you are pressing the plus button on the speed or incline tile on qz? if not could you please select the profile x22i no adb in the companion, restart the treadmill and check if you can see them? probably you will see them in a wrong position, but if it's so, it's easy to fix

let me know!

Olorin92 commented 3 weeks ago

I don't think so - I didn't notice anything happening on the screen.

I'll test that out and let you know how I go, thanks again for your help!

Olorin92 commented 3 weeks ago

Yep so confirming changing to that treadmill in the QZ app on the treadmill does make clicks happen (although as you said, they're not quite in the right spot)

cagnulein commented 3 weeks ago

That's perfect! I will align them today

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

Il giorno mar 3 set 2024 alle 04:50 Olorin92 @.***> ha scritto:

Yep so confirming changing to that treadmill in the QZ app on the treadmill does make clicks happen (although as you said, they're not quite in the right spot)

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

Olorin92 commented 3 weeks ago

Perfect let me know when I should retest 😁

cagnulein commented 3 weeks ago

done https://github.com/cagnulein/QZCompanionNordictrackTreadmill/actions/runs/10679183964/artifacts/1884910107

select again the t 9.5s (no adb) device and restart it- Let me know if it's better!

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

Il giorno mar 3 set 2024 alle ore 08:11 Olorin92 @.***> ha scritto:

Perfect let me know when I should retest 😁

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

Olorin92 commented 2 weeks ago

So I did this - it sort of worked once (I pressed plus and it took speed down to 1.6 when it was 2) but then doesn't do anything else after I click buttons again 🥲

cagnulein commented 2 weeks ago

does the speed updates in qz as well? enable the touch shadow in the developer settings of the treadmill tablet so we can see what it's doing when "it doesn't do anything else". i guess it's swiping with a wrong coordinates

Olorin92 commented 2 weeks ago

It updated in QZ for the first time, but not after that 😃 I'll enable the show touches option and send through the result

Olorin92 commented 2 weeks ago

Here you go! It seems to swipe down for going up with speed. Inclination seems to just tap and not really swipe

https://photos.app.goo.gl/yPF5RS3iupMoubCh8

cagnulein commented 2 weeks ago

ok so it's just a matter of coordinates. i will check this later

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

Il giorno mer 4 set 2024 alle 07:09 Olorin92 @.***> ha scritto:

Here you go! It seems to swipe down for going up with speed. Inclination seems to just tap and not really swipe

https://photos.app.goo.gl/yPF5RS3iupMoubCh8

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

cagnulein commented 2 weeks ago

ok let's see first for the inclination. does your treadmill handles also the 0.5% step? otherwise set the incliantion step in the treadmill settings in qz from 0.5 to 1 and try again

Olorin92 commented 2 weeks ago

So just confirming it does do 0.5 increments for incline so I guess I shouldn't need to adjust that right?

cagnulein commented 2 weeks ago

ok so let's try this https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.4.12/QZCompanionNordictrackTreadmill.apk don't change anything on the qz side so

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

Il giorno mer 4 set 2024 alle ore 09:39 Olorin92 @.***> ha scritto:

So just confirming it does do 0.5 increments for incline so I guess I shouldn't need to adjust that right?

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

Olorin92 commented 2 weeks ago

Ok speed seems to work now with two caveats - it seems to vary how much it increases and decreases. I did one increase from the QZ companion and that added .4kmh, then a decrease which deducted 0.1kmh then another decrease which deducted 0.2kmh. it's also a bit laggy to respond from the QZ companion app but maybe that's expected.

Incline doesn't do anything still though

cagnulein commented 2 weeks ago

ok so i guess the best way to calibrate this is to fix the offset yourself trying. let's start from the inclination

the actual code of it is

                        x1 = 76;
                        y1Inclination = 823 - (int) ((lastInclinationFloat) * 46.0);
                        y2 = y1Inclination - (int) ((reqInclination - lastInclinationFloat) * 46.0);

where the lastInclinationFloat is the current inclination value in % the reqInclination is the requested one in %

then you can use these using the adb on your mac with

adb shell input swipe x1 y1Inclination x1 y2 200 (of course replace the variable with the numbers)

you have to find the right offset to match the inclination values.

Let me know!

Olorin92 commented 2 weeks ago

Ok thanks! Have you got the numbers for speed too?

cagnulein commented 2 weeks ago

yes

                            x1 = 1845;
                            y1Speed = 817 - (int) (((QZService.lastSpeedFloat * 0.621371) - 1) * 42.5);
                            y2 = y1Speed - (int) (((reqSpeed * 0.621371) - (QZService.lastSpeedFloat * 0.621371)) * 42.5);

same concept of above. the 0.621371 constant is the conversion from miles to km/h because qz is always working on km/h

Olorin92 commented 2 weeks ago

Perfect thanks! So if I understand right, I should effectively plug all these values in and calculate the required variables for the input swipe command, and the value I should be adjusting is the 46 for incline and 42.5 for speed?

cagnulein commented 2 weeks ago

exactly! or the 817 and 823 if needed too

Olorin92 commented 2 weeks ago

Ok I will have a play. Is there any methodology to doing it? I.e. should I start with a fixed increment of say going from 2 to 2.5 speed, get that working, then see how other speeds work?

Also - what exactly does the QZ companion app send for the plus/minus buttons? It doesn't actually tell me how much it's trying to increment by

Olorin92 commented 2 weeks ago

Trying to figure out how to translate this into the function above - for speed I took screenshots at 2kmh at .1 increments up to 2.5kmh, the Y pixel change from the speed before it was as follows 2kmh - N/A (base speed) 2.1kmh - -3px change 2.2kmh - -4px change 2.3kmh - -3px change 2.4kmh - -3px change 2.5kmh - -3px

So obviously the 0.1km/h increment is adjusting the slider on average around 3px up each time. Any ideas how to translate that into your function?

cagnulein commented 2 weeks ago

If you want we can create a lookup table. I just need the perfect coordinates for each speeds value

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

Il giorno mer 4 set 2024 alle 12:05 Olorin92 @.***> ha scritto:

Trying to figure out how to translate this into the function above - for speed I took screenshots at 2kmh at .1 increments up to 2.5kmh, the Y pixel change from the speed before it was as follows 2kmh - N/A (base speed) 2.1kmh - -3px change 2.2kmh - -4px change 2.3kmh - -3px change 2.4kmh - -3px change 2.5kmh - -3px

So obviously the 0.1km/h increment is adjusting the slider on average around 3px up each time. Any ideas how to translate that into your function?

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

Olorin92 commented 2 weeks ago

Ah I was hoping to avoid that given I'd need to pull out 17*10 lots of speeds to capture everything 🥲

Was hoping you might have a better idea of how to translate a 0.1kmh increase equalling a 3 pixel effect on the y pixel coordinate into the function you provided

cagnulein commented 2 weeks ago

yes if it's a constant 3px for each speed increment i can do a simply equation. what about the inclination?

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

Il giorno mer 4 set 2024 alle 12:13 Olorin92 @.***> ha scritto:

Ah I was hoping to avoid that given I'd need to pull out 17*10 lots of speeds to capture everything 🥲

Was hoping you might have a better idea of how to translate a 0.1kmh increase equalling a 3 pixel effect on the y pixel coordinate into the function you provided

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

Olorin92 commented 2 weeks ago

Yep definitely seems that way from my samples!

I'll check incline shortly and come back to you 😁

cagnulein commented 2 weeks ago

the starting Y for the speed was right so?