Skip to content
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

[Peloton] Last cadence seen by Gymnasticon never clears if it is non-zero #32

Closed
jeremydk opened this issue Jan 26, 2021 · 2 comments
Closed

Comments

@jeremydk
Copy link
Contributor

Reported to me over FB Messenger, trying to dig in.

We appear to have an edge case where if the bike is no longer sending updates (i.e. ride screen left), if the last frame contained a non-zero cadence, we emit pedal stroke events at that given rate until the service is restarted.

Thinking through this, we already have the means to account for this -- the PingInterval. We currently reset the clock on the pingInterval with every PedalEvent, but we might be able to move the reset into the onBikeStats handler rather than onPedalEvent since they are being generated synthetically.

The other option is to try to detect the frames sent (if there is anything unique) when the serial handler on the Peloton Tablet is started and destroyed, and match that lifecycle within Gymnasticon, but it feels more fragile than adjusting our pingInterval logic.

@jeremydk
Copy link
Contributor Author

@ptx2 I'm happy to make these changes, but I don't have a way to test on non-Peloton hardware, and we don't have any real branching logic at that point in the application.

Before I go start crafting a PR, I'd love to make sure the intended fix is in line with your mental model of the situation as well.

@ptx2
Copy link
Owner

ptx2 commented Jan 31, 2021

Hey @jeremydk thanks for finding this! I'll try this on the Flywheel today.

@ptx2 ptx2 closed this as completed in 1dc4d0d Feb 2, 2021
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

No branches or pull requests

2 participants