-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NordicTrack Commercial 2950 iFit Embedded Wifi Treadmill (2021 model) #815
Comments
adb lib, interesting! https://github.com/Jaywalker/libadb |
this is the one! https://github.com/cagnulein/libadb-client.qt |
Test results - QZ log attached |
Test results while connected to Polar Sense BT HRM - QZ log attached debug-Thu_May_26_11_01_06_2022.log Windows error report log attached |
Separate test results - Polar HR monitor connected, Stryd footpod connected, nothing connected debug-Thu_May_26_12_08_01_2022.log |
thanks @victorypoint i will try with an adb simulator now first to submit a new release for you ;) |
@victorypoint i tried with a android emulator and it works fine to me :( could you please try to clone this project https://github.com/cagnulein/libadb-client.qt and install qt creator and run it? let me know |
@victorypoint download qt from here https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34%7C074ddad0-fdef-4e53-8aa8-5e8a876d6ab4 and when you need to install a qt version use the 5.15.2 branch so you will use the same qt version that i'm using myself |
libadb-client.qt test results: |
@victorypoint ok so the issue is adb_connect return false i will check tomorrow the cause of this |
@victorypoint new commit added to the https://github.com/cagnulein/libadb-client.qt please pull it and run it. doAdbPipe "shell:ls " adb_connect shell:ls adb_connect 9 adb_connect 0009 switch_socket_transport switch_socket_transport host:transport-any switch_socket_transport 18 switch_socket_transport 0012 _writex 0x6bfb4f 4 _writex return true _writex 0x6bfb54 18 _writex return true _writex 0x6bfc4f 4 _writex return true _writex 0x10e09b8 9 _writex return true adb_connect OK doAdbPipe true doAdbShell 0x10d0048 doAdbShell "acct config dev metadata res vendor\nadb_keys d etc mnt sdcard\napex data init odm storage\nbin data_mirror init.environ.rc oem sys\nbugreports debug_ramdisk linkerconfig proc system\ncache default.prop lost+found product system_ext\n" adb shell "acct config dev metadata res vendor\nadb_keys d etc mnt sdcard\napex data init odm storage\nbin data_mirror init.environ.rc oem sys\nbugreports debug_ramdisk linkerconfig proc system\ncache default.prop lost+found product system_ext" |
Ok, here is the results of testing your latest libadb-client.qt 13:39:36: Starting C:\Temp\build-adb-client-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\adb-client.exe... |
@victorypoint i added a debug in the constructor because the issue is in the tcp connection. Are you sure you're still changing the IP in the adbclient.cpp? are you sure the port is right? (it should match the one using from the adb.exe) With the last commit we should see the error returning from the tcp. Let me know, I guess we're near |
Hi. Yes, I'm changing the treadmill IP in adbclient.cpp to 10.0.0.124. Here is command-line output when I run adb.exe: adb connect 10.0.0.124
Note that the treadmill daemon starts on tcp port 5037 which is what we're using in adbclient.cpp. Also note that the adb connection is over port 5555. I pulled and tested the new libadb-client.qt. Here's the application output when using IP 10.0.0.124 on port 5037: 19:58:39: Starting C:\Temp\build-adb-client-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\adb-client.exe... And here is the application output when using IP 10.0.0.124 on port 5555: 20:11:24: Starting C:\Temp\build-adb-client-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\adb-client.exe... |
Ok, here is latest libadb-client.qt test results: Application output when using IP 10.0.0.124 on port 5037: 12:27:28: Starting C:\Temp\build-adb-client-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\adb-client.exe... Application output when using IP 10.0.0.124 on port 5555: 12:30:52: Starting C:\Temp\build-adb-client-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\debug\adb-client.exe... |
@victorypoint i guess we need to change the approach because, digging a little more, this adb library requires the daemon on the pc.
I really like the first one, so I will try to create a simple project to test it out if you agree. |
@victorypoint good news! I just created the apk for the companion app. For now just check if the apk works on your treadmill console. Let me know |
Testing new QZ build that communicates with QZ companion apk running on treadmill:
Attached: Wireshark output & QZ log: |
QZ log with a BT device attached to PC (Stryd footpod) - got Windows Firewall alert first: |
QZ log with BT device attached and Windows Firewall totally disabled: |
QZ logs: debug-Sun_Jun_5_12_06_09_2022.log - apk running on treadmill and launched iFit to dashboard screen debug-Sun_Jun_5_12_06_09_2022.log |
Wolflog for above testing attached |
@victorypoint i analyzed again the logs with a fresh mind :) for example: Sun Jun 5 12:08:34 2022 1654441714445 Debug: nordictrackifitadbtreadmill.cpp void nordictrackifitadbtreadmill::processPendingDatagrams() Message :: "[9] 4176325 12:07:48.5770 [Trace:FitPro] Changed KPH to: 2" Sun Jun 5 12:08:34 2022 1654441714461 Debug: nordictrackifitadbtreadmill.cpp void nordictrackifitadbtreadmill::processPendingDatagrams() "[9] 4176325 12:07:48.5770 [Trace:FitPro] Changed KPH to: 2" Sun Jun 5 12:08:34 2022 1654441714476 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Inclination: 0" Sun Jun 5 12:08:34 2022 1654441714490 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Speed: 2" the last log line from qz is Sun Jun 5 12:09:04 2022 1654441744510 Debug: nordictrackifitadbtreadmill.cpp void nordictrackifitadbtreadmill::processPendingDatagrams() "[9] 4251736 12:09:03.9885 [Trace:FitPro] Changed CurrentTime to: 104" but you changed the speed on the treadmill after [17] 4284869 12:09:37.1208 [Trace:FitPro] Changed KPH to: 4.82 [35] 4285120 12:09:37.3722 [Trace:FitnessConsole] Kph changed from 2 to 4.82 [1] 4287068 12:09:39.3197 [Trace:FitnessConsole] Clamped Kph from 4.82 to 4.82. BitField: Kph FitnessValue: Kph [1] 4287075 12:09:39.3246 [Trace:FitnessConsole] List: [BitFieldCommItem: BitField=WorkoutMode, RequestData=Running, IsCmd=False, IsWrite=True, Tcs=System.Threading.Tasks.TaskCompletionSource`1[System.Object]],[BitFieldCommItem: BitField=Kph, RequestData=4.82, IsCmd=False, IsWrite=True, Tcs=System.Threading.Tasks.TaskCompletionSource`1[System.Object]] [35] 4293941 12:09:46.1934 [Trace:FitPro] Changed KPH to: 8.04 [16] 4294186 12:09:46.4360 [Trace:FitnessConsole] Kph changed from 4.82 to 8.04 [18] 4306906 12:09:59.1582 [Trace:FitPro] Changed KPH to: 3.21 [20] 4321687 12:10:13.9386 [Trace:FitPro] Changed KPH to: 1.6 [6] 4321910 12:10:14.1620 [Trace:FitnessConsole] Kph changed from 3.21 to 1.6 [18] 4334489 12:10:26.7406 [Trace:FitPro] Changed KPH to: 0 [18] 4334701 12:10:26.9532 [Trace:FitnessConsole] Kph changed from 1.6 to 0 so please repeat the test and keep attention to leave everything running, thanks! |
Ok, I did some detailed testing and came across the following behaviors:
Logs from treadmill (wolflog) and are QZ attached: Testing workflow:
Test results: Treadmill manual workout events (wolflog) - 2022-06-06_logs.txt iFit in foreground [20] 233203 08:54:16.6710 [Trace:Workout] Starting Manual Workout QZ log - debug-Mon_Jun_6_08_55_48_2022.log Mon Jun 6 08:56:05 2022 1654516565245 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Speed: 0" *** I was was able to close QZ Treadmill manual workout events (wolflog) - 2022-06-06_logs.txt [21] 4288776 10:01:52.2443 [Trace:Workout] Starting Manual Workout QZ Companion app in foreground [19] 4289043 10:01:52.5117 [Trace:FitnessConsole] Clamped Kph from 2 to 2. [16] 4289604 10:01:53.0690 [Trace:FitPro] Changed KPH to: 2 .. 2.9 iFit in foreground 4] 4432650 10:04:16.1179 [Trace:FitPro] Changed KPH to: 1.6 .. 3 QZ Companion app in foreground [37] 4486517 10:05:09.9854 [Trace:FitPro] Changed KPH to: 8.04 QZ Companion app in foreground [6] 4507904 10:05:31.3723 [Trace:FitPro] Changed KPH to: 4.82 QZ log - debug-Mon_Jun_6_10_03_04_2022.log Mon Jun 6 10:03:23 2022 1654520603797 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Inclination: 0" *** QZ appears to have locked-up/crashed at this point (Mon Jun 6 10:06:10 2022) - cursor spinning, app did not respond to clicks, I was able to close QZ Treadmill manual workout events (wolflog) - 2022-06-06_logs.txt iFit in foreground [20] 7188864 10:50:12.3319 [Trace:Workout] Starting Manual Workout QZ log - debug-Mon_Jun_6_10_50_37_2022.log Mon Jun 6 10:50:53 2022 1654523453918 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Speed: 0" *** I was was able to close QZ Treadmill manual workout events (wolflog) - 2022-06-06_logs.txt [34] 7393188 10:53:36.6564 [Trace:Workout] Starting Manual Workout QZ Companion app in foreground [19] 7393683 10:53:37.1492 [Trace:FitPro] Changed KPH to: 2 .. 3 QZ log - debug-Mon_Jun_6_10_54_12_2022.log Mon Jun 6 10:54:29 2022 1654523669039 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Speed: 0" *** At first QZ appears to have locked-up/crashed but it eventually responded after a few minutes after the workout stopped and the cursor stopped spinning, I was able to stop and close QZ Treadmill manual workout events (wolflog) - 2022-06-06_logs.txt [10] 7516717 10:55:40.1848 [Trace:Workout] Starting Manual Workout QZ Companion app in foreground [11] 7517117 10:55:40.5840 [Trace:FitPro] Changed KPH to: 2 .. 3 QZ log - debug-Mon_Jun_6_10_56_04_2022.log Mon Jun 6 10:56:21 2022 1654523781155 Debug: bluetooth.cpp void bluetooth::debug(const QString&) "Current Speed: 0" *** QZ was busy and eventually responded after several minutes after the workout stopped and the cursor stopped spinning at approximately 11:10:00, was able to stop and close QZ |
Oh, absolutely! You know more about this stuff than I. Attached is the QZ log for that workout session. |
maybe I'm blind but I don't see holes here neither
and neither from the current speed from QZ
maybe is the ifit app that didn't log for 20 seconds? @victorypoint also the ftms notification to zwift are fine
|
I have QZ running in background with Zwift in foreground fullscreen on Windows 11 machine so I didn't get to see if it showed delay as well. Give me time to confirm that in future runs. Is there any other log files or dumps I can collect that would help for next time? I appreciate your time on this! |
@victorypoint so you just see the delay from the treadmil to zwift...end to end...got it. Mmm maybe the log from zwift? Maybe you already have it! |
Sorry, just to clarify, speed stall occurs on treadmill console and in Zwift, however, treadmill belt changes speed. I need to do an equivalent run without QZ installed/running to make sure it's not iFit or treadmill misbehaving. |
Hah so even on the treadmill console?! |
Yes, a delay on the console. I've never seen this delay before installing and using Companion. I'll keep testing. |
I have checked the touch coordinates on my S22i and it work using adb e.g. Looks like the inject events permissions is needed. I did a quick search and didn't find any easy way to grant these permissions. |
@bstoney is |
@cagnulein , using QZ Companion, I just ran the ZLDR full marathon event this morning and I experienced a treadmill reboot about 35K into run. I was back up and running in about a minute. Do you see anything in the attached logcat related to a crash? |
@victorypoint are you sure this is the right log? I see only few minutes of a treadmill running 0 speed |
Yes, it's the correct log but I'm using Companion v1.3.2 which I think reports less debug info the logcat. I'll dig around the tablet file system and see if there is anything else that might help. |
@victorypoint i mean there is any speed changing from the treadmill itself, always 0 so |
Oh, sorry I don't know what's going on there. The log shows the right date and timestamps. Very strange |
@victorypoint maybe you encountered a real bug on the treadmill :) i mean 3h+ on a single session is not a joke :) |
Yeah I wouldn't be surprised if it's the iFit app crashing because they don't expect people to run full marathons lol! |
|
app-debug.apk.zip |
I guess we can close this, at least for now :) |
iFit-Wolf
Experimental iFit Workout Data Capture
For NordicTrack Commercial 2950 iFit Embedded Wifi Treadmill (2021 model)
NOTE: The NordicTrack C2950 iFit Embedded Wifi Treadmill is not a "smart treadmill" in the sense that it does not have iFit Bluetooth-enabled technology. That is, it does not transmit speed and inclination data via Bluetooth to applications such as Zwift. Nor does it use WebSockets to communicate over Wifi as older NordicTrack treadmills have.
The NT C2950 treadmill, and perhaps other NT iFit-embredded treadmills (I've only tested the C2950 model), record individual workouts to a local text log in a sequential streaming format. Workout data is recorded to a single log file for each day and is easily identified by the filename – e.g. 2022-05-24_logs.txt. Each days log file contains data for all workouts for that given day. The file naming scheme is therefore: YYYY-MM-DD_logs.txt. Each logged workout event is identified in a single or multiple lines by a unique ID and timestamp derived from the time/date settings within the users iFit configuration. Workout events, including changes to speed and inclination, are recorded in real-time to the log file and can be parsed to isolate current speed and inclination for use in applications such as Zwift. For example, the log file 2022-05-24_logs.txt can contain real-time speed and inclination events which can be identified as follows:
[11] 1758734 14:01:58.8047 [Trace:FitPro] Changed KPH to: 2.1
[7] 1759006 14:01:59.0763 [Trace:FitnessConsole] Kph changed from 2 to 2.1
[10] 1783494 14:02:23.5646 [Trace:FitPro] Changed Grade to: 0.5
[12] 1783763 14:02:23.8342 [Trace:FitnessConsole] Grade changed from 0 to 0.5
The NT C2950 treadmills embedded iFit console runs Android (currently v9 on my model). The workout logs are located in: \sdcard.wolflogs. An example of the full workout log path for a given day is as follows:
\sdcard.wolflogs\2022-05-24_logs.txt
Workout events are recorded sequentially as they occur - top to bottom. To obtain the most recent speed and inclination values, look for the last occurrence of the events towards the bottom of the log file.
I've written a Windows VBscript which accesses the latest workout log and displays the real-time speed and inclination values in a MS Edge browser window. The log is accessed via an ADB connection to the treadmill. The VBscript assumes an ADB connection has already been established with the treadmill, and proceeds to copy the log, parse the current speed and inclination values, and display and refresh the real-time values in Edge. My testing environment is a Surface Book 2 running Windows 11 Pro.
I’ve not included documentation here on how to configure the NT C2950 treadmill for ADB communication, but it involves accessing the machines “Privileged Mode”, turning on “Developer Options” in Android settings, and enabling “USB Debugging” mode. Accessing Privileged Mode is well documented on many websites, dependent on the treadmill model, and version of Android and iFit.
adb-connect.bat (commands to initiate an ADB connection with the treadmill – change the IP to that of the treadmill)
get-speed-incline.vbs (VBscript)
cscript_get-speed-incline.bat (commands to launch VBscript in CScript window)
Not included – ADB
ADB stands for Android Debug Bridge used by developers to connect their development computer with an Android device via a USB cable (and over Wifi in this case). If you don't have Android SDK installed on your PC, ADB may not be recognized. It's recommended you download the latest version.
Obviously, this Windows ADB solution is not ideal and real-time feedback is a bit slow. With this documentation and code, it is hoped that it can be used as a basis to write faster processes to access the treadmills local workout logs and parse the speed and inclination values for transmit to Zwift and other applications.
Files included:
bas files.zip
Reference: https://github.com/victorypoint/iFit-Wolf?fbclid=IwAR01U6QNAU14hP7DPi9rsJI3mzwoBL0p5gIA2CwMHkyrZubAYDglFvGj_xo
@victorypoint
The text was updated successfully, but these errors were encountered: