Giter Club home page Giter Club logo

Comments (56)

cagnulein avatar cagnulein commented on July 20, 2024 1

https://www.dropbox.com/s/wyawcz0ydcgo5c8/com.ifit.arda-1.zip?dl=0

this is the right one! @victorypoint I did a great discovery today! They don't use a serial port, but a classic USB HID communication like I did for https://github.com/cagnulein/qdomyos-zwift/pull/1510/files#diff-fa9a2ae4e5cf532f4b05f89057af23372b886b46351fd4470140ba02f883f10b

Of course I don't have the protocol but we can experiment with this. This will allow to rip out all the shitness from ifit and control and read the treadmill directly.

I will analyze this more in the next days

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024 1

this is the right one! @victorypoint I did a great discovery today! They don't use a serial port, but a classic USB HID communication like I did for https://github.com/cagnulein/qdomyos-zwift/pull/1510/files#diff-fa9a2ae4e5cf532f4b05f89057af23372b886b46351fd4470140ba02f883f10b

@cagnulein, I think we went down this path before if I recall? Here is some debug info I posted in a previous ticket somewhere if it helps:

Found in logcat:
12-31 20:00:29.256   535   557 I UsbDeviceManager: Setting USB config to adb
12-31 20:00:29.659   535   557 W Looper  : Slow dispatch took 406ms android.fg h=com.android.server.usb.UsbDeviceManager$UsbHandlerLegacy c=null m=4
12-31 20:00:29.700  1103  1109 I adbd    : initializing functionfs
12-31 20:00:29.700  1103  1109 I adbd    : opening control endpoint /dev/usb-ffs/adb/ep0
12-31 20:00:29.702  1103  1109 I adbd    : functionfs successfully initialized
12-31 20:00:29.704  1103  1109 I adbd    : registering usb transport

adb shell ls /dev/bus/usb/002/
	001
	002
	Permission denied - c++ - libusb cannot open USB device, permission isse. NetBeans/Ubuntu - Stack Overflow

adb shell lsusb
	Bus 002 Device 002: ID 213c:0002
	Bus 001 Device 001: ID 1d6b:0002
	Bus 002 Device 001: ID 1d6b:0001

adb shell ls /
	init.mt8163.usb.rc - interesting
	init.usb.configfs.rc
	init.usb.rc

- adb shell getprop | grep "model\|version.sdk\|manufacturer\|hardware\|platform\|revision\|serialno\|product.name\|brand"
	[ro.board.platform]: [mt8163]
	[ro.boot.hardware]: [mt8163]
	[ro.boot.serialno]: [NN35Z109609]
	[ro.build.version.sdk]: [28]
	[ro.frp.pst]: [/dev/block/platform/mtk-msdc.0/11230000.MSDC0/by-name/frp]
	[ro.hardware]: [mt8163]
	[ro.hardware.nfc_nci]: [pn54x]
	[ro.mediatek.platform]: [MT8163]
	[ro.product.brand]: [iFit Embedded]
	[ro.product.manufacturer]: [Malata]
	[ro.product.model]: [MalataMediatekArgon2]
	[ro.product.name]: [argon2]
	[ro.product.vendor.brand]: [alps]
	[ro.product.vendor.manufacturer]: [alps]
	[ro.product.vendor.model]: [k2103]
	[ro.revision]: [0]
	[ro.serialno]: [NN35Z109609]
	[ro.vendor.mediatek.platform]: [MT8163]
	
- adb shell getprop | grep adb
	[init.svc.adbd]: [running]
	[persist.service.adb.tcp.port]: [5555]
	[persist.sys.usb.config]: [adb]
	[ro.adb.secure]: [1]
	[ro.boottime.adbd]: [26601662385]
	[sys.usb.config]: [adb]
	[sys.usb.state]: [adb]
	
- adb shell getprop | grep usb (treadmill idle on screen saver) - no change when running
	[init.svc.usbd]: [stopped]
	[init.svc.vendor.usb-hal-1-0]: [running]
	[persist.sys.usb.config]: [adb]
	[ro.audio.usb.period_us]: [16000]
	[ro.boottime.usbd]: [7838175230]
	[ro.boottime.vendor.usb-hal-1-0]: [3882140768]
	[ro.sys.usb.bicr]: [no]
	[ro.sys.usb.charging.only]: [yes]
	[ro.sys.usb.mtp.whql.enable]: [0]
	[ro.sys.usb.storage.type]: [mtp]
	[sys.allow_usb_debug]: [1]
	[sys.usb.config]: [adb]
	[sys.usb.configfs]: [1]
	[sys.usb.controller]: [musb-hdrc] - drivers/usb/gadget/Kconfig - kernel/mediatek - Git at Google (googlesource.com), device_blu_V0310WW/init.mt6771.usb.rc at Vivo_XI-user-9-PPR1.180610.011-1569469089-release-keys · AndroidBlobs/device_blu_V0310WW , (github.com), Chapter 2. Linux MUSB Basics (kernel.org)
	[sys.usb.ffs.ready]: [1]
	[sys.usb.state]: [adb]
	[sys.usb.vid]: [0E8D]
	[vendor.usb.acm_cnt]: [0]
	[vendor.usb.acm_enable]: [0]
	[vendor.usb.acm_port0]: []
	[vendor.usb.acm_port1]: []
	[vendor.usb.clear]: [boot]
	[vendor.usb.pid]: [0x201C]
	[vendor.usb.temp]: []
	[vendor.usb.vid]: [0x0E8D]

And here is the USB HID info from my C2950 TM:

		DEVICE INFO
		Device Path: /dev/bus/usb/002/002
		Device Class: Use class information in the Interface Descriptors (0x0)
		Vendor ID: 213c
		Vendor Name (reported): ICON Fitness
		Vendor Name (from DB): not found
		Product ID: 0002
		Product Name (reported): ICON Generic HID
		Product Name (from DB): not found
		
		ADDITIONAL INFO
		Interface #0 
		Class: Human Interaction Device (0x3)
		Endpoint: #0 
			Address :0x81 (10000001)
			Number :1
			Direction Inbound (0x80) 
			Type : Interrupt (0x3)
			Poll Interval: 1
			Max Packet Size: 64 
			Attributes : 00000011
		Endpoint: #1
			Address : 0x02 (00000010)
			Number :2
			Direction :Outbound (0x0) 
			Type :Interrupt (0x3)
			Poll Interval: 1
			Max Packet Size: 64 
		Attributes : 00000011

Interesting post about Android USB HID - https://stackoverflow.com/questions/52542934/android-usb-understanding-controltransfer-method

USB HID usage table - https://www.freebsddiary.org/APC/usb_hid_usages.php

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024 1

@cagnulein, ok great news. Yes a permission pop-up appeared which I granted.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024 1

Omg @victorypoint I'm blind!
I will implement this tomorrow, thank you very much for the double check!
@slowjud great news! Are you still interested?

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

Hi Roberto,

thanks for such a quick reply.

Yes this was during a workout. From what I see it just logs the startup then stops logging.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

The APK is too big for github, find it here: https://www.dropbox.com/s/k34f0jkd3mdfvw2/base.apk?dl=0

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

The APK is too big for github, find it here: https://www.dropbox.com/s/k34f0jkd3mdfvw2/base.apk?dl=0

is this the only apk available in the treadmill? I already checked it and it doesn't contains a communication with the firmware of the treadmill. It seems more the graphic apk. Probably the low level apk is somewhere around

Let me know

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

here are some more ifit apks I've also added the complete package for the ifit.standalone (my previous link was just the apk)

https://www.dropbox.com/s/wp9vigguh37hrak/com.ifit.standalone.zip?dl=0
https://www.dropbox.com/s/z2ylfkaunwvtgw2/com.ifit.launcher-1.0.17.22.zip?dl=0
https://www.dropbox.com/s/rutaiw25hxp36c8/com.ifit.eru-2.zip?dl=0
https://www.dropbox.com/s/wyawcz0ydcgo5c8/com.ifit.arda-1.zip?dl=0

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Thanks @victorypoint they are the information that I need to go further. Actually I don't remember if we discussed about this in the past, but know I have a lot more knowledge about this because I did the same with with the concept2 rower. (So the hid library are already implemented on qz for example)

I will try to study the protocol and I will let you know

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

i'm adding some notes for the future myself: ifit uses protobuf (all protobuffers inside the resources directory) to build the messages.
The only thing that I'm missing is what ifit uses to start the poll, maybe it sends just an empty protobuf

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

ok guys I'm preparing a QZ apk to run directly on the treadmill that will read the data from the USB. I will put here the link of the apk and the instructions to collect some data from the usb when I'm ready (hopefully today)

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint @slowjud ok apk ready for a first test https://github.com/cagnulein/qdomyos-zwift/suites/14543484924/artifacts/823071619

Steps:

  • unzip and install the apk into the treadmill itself
  • close all the ifit app, the important one is the ERU app (i don't know how you can close this, but it must be closed, otherwise qz can't access to the USB)
  • open QZ and grant access to all the permission it requests
  • qz will automatically try to gain access to the usb and it should start reading the frame from it. From the QZ interface you will not see anything for now, qz is collecting automatically the debug log that will give me the information that if i'm on the right way or not

Let me know!

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, just to be clear, you want all ifit apps closed including main ifit one? Without it we cannot run a manual workout to collect metrics.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@cagnulein, just to be clear, you want all ifit apps closed including main ifit one? Without it we cannot run a manual workout to collect metrics.

yes exactly @victorypoint ALL the ifit app closed.
That's because the apk that I provided will be replace the ifit ones! Unlocking it completely (as soon as I will complete it :) )

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, all ifit apps closed/disabled, QZCompanion closed/disabled, USB app launches and immediately stops. I've captured a logcat with the open/close behavior. Screenshot included showing enabled permissions.

logcat.txt
PXL_20230725_143806617
PXL_20230725_143741263

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint fixed thanks! I did a stupid copy and paste error. It's building, I will provide the new apk.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

the good news is that QZ was already connected in the log! Wow!

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint @slowjud new build https://github.com/cagnulein/qdomyos-zwift/suites/14553652950/artifacts/823856996

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, okay no QZ app crash this time. Did you want me to do anything in QZ? Attached is the logcat for QZ launch.

logcat.txt

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint thanks, the log in this way is perfect. Only a question: did you get a popup for the USB permission in qz? Because I saw in the log that it says that the user didn't give the permission to it.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

I guess I can answer myself, we already got a hit!

07-25 19:47:00.638 11523 11718 D HidBridge: Message received of lengths 64 and content: 4 46 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 44 1 0 0 0 0 -76 0 0 0 0 0 0 0 0 0 24 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

the treadmill is already sending something! Let's decode this with the protobuf that are available in the apk. I guess I can use chatgpt for this :)

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint new apk ready https://github.com/cagnulein/qdomyos-zwift/suites/14580674006/artifacts/825950838
same test as before if you can, thanks!

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, thanks! New apk installed and launched. Attached is the logcat.

logcat.txt

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint in the ifit log, did you see something about the ifit.eru app? i mean in the code i saw that it's logging (also the low level communication) but I don't know where. I don't think it's in the classic logcat file. It could be useful to get the actual log from ifit usb communication to understand what's doing on the startup phase.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

note for me: i just found this one http://apk-deguard.com/
It works really well!

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@victorypoint in the ifit log, did you see something about the ifit.eru app? i mean in the code i saw that it's logging (also the low level communication) but I don't know where.

The ifit apps are disabled so the ifit logs would not be updated but I could supply them if you need them? I would simply issue these commands. Let me know.

adb pull /sdcard/.wolflogs/
adb pull /sdcard/eru/

I don't think it's in the classic logcat file. It could be useful to get the actual log from ifit usb communication to understand what's doing on the startup phase.

@cagnulein, you're right, the logcat I posted previously was captured live streamed when I launched QZ on the tablet. This time I disabled all ifit apps, set QZ to launch on treadmill start, and rebooted treadmill. The attached logcat was captured with the traditional "adb logcat -d > logcat.txt" after the treadmill started and QZ launched.

logcat.txt

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

The ifit apps are disabled so the ifit logs would not be updated but I could supply them if you need them? I would simply issue these commands. Let me know.

adb pull /sdcard/.wolflogs/
adb pull /sdcard/eru/

yes i'm interested in the eru subfolder actually
Thanks

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, okay I reset the treadmill back to normal, started a manual workout and captured all the ifit logs.

ifit-logs.zip

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@victorypoint can you do again the same test with this apk? https://github.com/cagnulein/qdomyos-zwift/suites/14652532576/artifacts/831407139

As I said on messenger I found a new logic in the log from the user that could explain why I didn't get a real metrics in the past logs.

Thanks!

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, here's the logs for the new qz apk.

  • stream-logcat.txt - captured when qz was first launched after install
  • logcat.txt - rebooted tm and captured regular logcat after qz launched after boot
  • new ifit logs attached in case you want to see them

new-logs.zip

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@slowjud another user with your same issue fixed it resetting the console completely and without update the ifit software (it seems the new ifit has this issue).

Let me know

@victorypoint i'm checking what i'm doing wrong in the init phase, thanks

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

Hi I'm trying to get this working on a T7.5s

The install went smoothly but no data is coming through.

I've attached the logs from the adb-debug.bat

Thanks

logcat.log logcat.txt 2023-07-21_logs.txt

Sorry guys, I'm just looking at these logs right now. I should have looked at them closer before. @cagnulein, in logcat.txt I'm seeing a slightly different wording for a metric change, for example:

[Trace:FitPro] Changed Actual KPH to: 1.56

from qzcompanionnordictracktreadmill.

victorypoint avatar victorypoint commented on July 20, 2024

@cagnulein, this is excellent news. We discussed in the past about using logcat instead of wolflog for reading real-time metrics but I can't remember what we decided.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Ah they are only on the logcat, now I see this!
Logcat requires shell access and it could be slower, but I can add it as a setting in order to workaround this particular scenario

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

Wow, You both are awesome. I'm still interested in getting this running.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@slowjud great!
I did the modification. You can download the newest version from here https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.3.0/QZCompanionNordictrackTreadmill.apk

After installing it, select the new 7.5s device setting and restart the treadmill.
Let me know if it makes any difference and in case send me the logs (I can't test this on my own, so I just wrote the code).

It could be slow, but in case I know how to fix it (clearing the logcat cache after each reading)

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

@cagnulein no dice, Here are the logs
logcat.log
logcat.txt

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@slowjud I guess I understood the issue. Update with this new one https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.3.1/QZCompanionNordictrackTreadmill.apk

Let me know

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

here are the latest logs.
logcat.txt
logcat.log

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@slowjud did you do debug access to the companion?
image

i saw in the log that it can't connect to adb locally.
if you press on the dump log button, are you seeing the log on the companion, right?

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

Thanks, I've tried this, here is the latest log. One comment, I can't connect via adb when the companion app has debug (maybe that's expected)
logcat.log

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

Here's the logs from the iOS app
debug-Wed_Aug_2_15_34_11_2023.log

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

great! it worked! i have only to fix another small issue. I'm doing it right now!

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

new apk https://github.com/cagnulein/QZCompanionNordictrackTreadmill/releases/download/3.3.2/QZCompanionNordictrackTreadmill.apk @slowjud
Let me know!

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

More logs for you. it got something after I pressed dump log in the companion
logcat.log

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@slowjud actually now it's working from what I'm seeing in the log. What do you get on the ios app? nothing? send me a debug log from it and I will check it now.
Thanks

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

So I've finally had a chance to get more info. Basically what's happening is there is nothing coming through. At least to begin with. When I press the dump logs button in the companion then it can get some logs, but it's stuck at what got dumped at that point in time. If I change the speed on the treadmill nothing changes. From a tiny bit of research I think you might need to request permission to read the logs android.permission.READ_LOGS I can't get good logs for you because I can't connect while the app is connected. If I use adb to connect then the app does that "can't connect to ADB" thing.

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

@slowjud from what I saw on the last log everything was ok. Could you please send me a debug log from the QZ main app?

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

About the log check here too cagnulein/qdomyos-zwift#1591 (comment)

from qzcompanionnordictracktreadmill.

slowjud avatar slowjud commented on July 20, 2024

Here’s the main app debug
debug-Thu_Aug_10_12_22_50_2023.log

from qzcompanionnordictracktreadmill.

cagnulein avatar cagnulein commented on July 20, 2024

Unfortunately there is no message from the companion here, this means that the companion is not running or some issue on the network. Did you change something from the last time?

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.