Skip to content

Debug: 0.01 km/h raw FTMS speed step on Horizon treadmill (not for merge) - #4877

Open
cagnulein wants to merge 2 commits into
masterfrom
debug/horizon-ftms-001-step
Open

Debug: 0.01 km/h raw FTMS speed step on Horizon treadmill (not for merge)#4877
cagnulein wants to merge 2 commits into
masterfrom
debug/horizon-ftms-001-step

Conversation

@cagnulein

@cagnulein cagnulein commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Context

Related to the Gmail thread "Issue with controlling treadmill" — the user reports issues controlling their Horizon treadmill's speed.

This is a diagnostic build, not intended to be merged. Its only purpose is to probe how the treadmill firmware reacts to the smallest possible speed step, so we can correlate each button press with the treadmill's observed behavior and narrow down the control bug.

What it does

This build is always in debug mode (no configuration or env var needed — just install and use):

  • Each tap on the home form's speed + button requests currentSpeed + 0.01 instead of the normal step (0.5/1.0 km/h).
  • In horizontreadmill.cpp, bypasses the 1-decimal rounding and minStepSpeed threshold that would otherwise silently discard such a tiny delta before it reaches forceSpeed().
  • Logs every outgoing BLE write with a timestamp and the raw hex bytes (qDebug), for both the standard FTMS branch and the two Horizon proprietary-protocol branches, so the exact command sent can be matched against what's observed on the treadmill console.
  • Note: the Horizon proprietary protocol (gattCustomService) only has 0.1 km/h resolution, so a 0.01 step won't change the bytes on that branch — the log makes this explicit. The test is meaningful only if this specific unit uses the FTMS branch (gattFTMSService).

How to test

  1. Build the Android debug APK via the android-build job in the CI GitHub Action (runs automatically on this PR, artifact name fdroid-android-trial), or build locally.
  2. Install the APK and launch the app — no setup needed, the debug behavior is always on in this build.
  3. Connect to the Horizon treadmill, tap the speed + button repeatedly, and note down what the treadmill actually does after each tap.
  4. Pull the debug log (adb logcat on Android) and match each [QZ_DEBUG_SPEED_001_STEP] line (timestamp + raw bytes) to the corresponding observed treadmill reaction.

Test plan

  • homeform.o and horizontreadmill.o compile cleanly (verified locally)
  • Manual test against a real Horizon treadmill to confirm raw bytes are actually sent and observe firmware reaction

cagnulein and others added 2 commits August 2, 2026 09:51
Not intended for merge. Gated behind QZ_DEBUG_SPEED_001_STEP env var:
each tap on the home form speed + button requests currentSpeed+0.01
instead of the normal step, and the Horizon rounding/threshold filter
is bypassed so the tiny delta actually reaches forceSpeed(). Logs the
exact raw bytes/requestSpeed with a timestamp for every write (FTMS
and both Horizon custom-protocol branches) so a tester can correlate
each button press with the treadmill's observed reaction.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Setting an environment variable isn't practical for a tester on
Android who just installs the debug APK. Make the 0.01 km/h forced
step and raw-byte logging unconditional in this throwaway branch
instead of gating it behind QZ_DEBUG_SPEED_001_STEP.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@stale

stale Bot commented Aug 18, 2026

Copy link
Copy Markdown

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.

@stale stale Bot added the wontfix This will not be worked on label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant