Skip to content

Keep a workout's heart rate running: restart on reconnect and after silence - #89

Merged
gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd
Nov 17, 2026
Merged

gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

Copy link
Copy Markdown
Owner

What happened

The owner's 17 Nov gym session (2.16.17, jring) read 76 bpm with readings covering only 12 of 57 minutes. A Huawei watch on the same session read 107 / 146.

The diagnostics export only held the last four minutes before it was taken, but it included the ring's own minute log (unmasked "full" export):

Ring log Readings
06:56–07:00 live, varying: 71–89 bpm
07:00 → 07:53 only the ring's routine checks: 71 at 07:00, 75 at 07:30, 77 at 07:44

So the ring stopped measuring about four minutes in, and nothing asked it to start again. What stopped it is outside the export. It was either a start sent before the 0x20 reply (which falls back to the 180 s check), or a later command ending the live mode.

Changes

  • Reconnect (RingSyncCoordinator): a real reconnect during a workout re-sends the workout start. The vendor's run screen does exactly this (RunRecordActivity, BLE state 2 → startHeartrateMode(true)).
  • Started while disconnected: the stream now starts when the ring connects. The start used to be silently dropped.
  • Silence: a connected ring that sends nothing for 60 s during a workout gets the start again. For Colmi's sport session a repeated start mid-session is already a no-op.
  • Background sync (RingSyncWorker): skips while a workout records. With the screen off it used to open a second client, re-run the whole startup (settings writes included) and broadcast DISCONNECTED.
  • Diagnostics: every start, restart, disconnect and stop is logged, along with which command jring chose (sport mode, or the 180 s fallback). The next export will show which one was sent and when the ring went quiet.
  • Notes: the finding is written up in docs/jring-56ff-plan.md.

Checks

  • Full unit suite: 2065 tests. The same 3 environment-only failures as main has in this container.
  • No UI change, so no audit file.

Generated by Claude Code

…ilence

The 17 Nov gym session read 76 bpm over 12 of 57 minutes. The ring's own
minute log in the export shows live readings 06:56-07:00 and then only its
routine checks: the ring stopped measuring four minutes in and nothing asked
it again.

- A real reconnect mid-workout re-sends the start, as the vendor's run
  screen does (RunRecordActivity, BLE state 2).
- A workout started while the ring is away starts its stream on connect;
  the start used to be dropped.
- A connected ring silent for 60 s mid-workout gets the start again.
- RingSyncWorker skips while a workout records: it opened a second client,
  re-ran the startup and broadcast DISCONNECTED.
- Starts, restarts, stops and jring's chosen command go to diagnostics.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr
gabrielbr merged commit ae3339b into main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants