Skip to content

Handle PLTN-ATR G700 variants in sensor interface routing#63

Merged
doudar merged 4 commits into
developfrom
copilot/fix-grupetto-crash-g700
Apr 15, 2026
Merged

Handle PLTN-ATR G700 variants in sensor interface routing#63
doudar merged 4 commits into
developfrom
copilot/fix-grupetto-crash-g700

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown

On Peloton G700 hardware reported as PLTN-ATR01, the app routes to the wrong sensor path and crashes during startup. This change broadens G700 detection so PLTN-ATR* models use the same interface path as other G700 devices.

  • Model detection update

    • Added a dedicated helper in Peloton.kt for G700 classification.
    • G700 detection now matches either legacy G700 strings or newer PLTN-ATR prefixes.
  • Startup routing impact

    • Existing startup logic that selects the Bike+/G700 sensor interface now correctly includes PLTN-ATR* devices via IsG700CrossTrainer.
  • Regression coverage

    • Added focused unit tests for positive and negative model-classification cases to lock expected routing behavior.
internal fun isG700CrossTrainerModel(model: String): Boolean {
    return model.contains("G700", ignoreCase = true) ||
        model.startsWith("PLTN-ATR", ignoreCase = true)
}

val IsG700CrossTrainer = isG700CrossTrainerModel(Build.MODEL)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 13, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix Grupetto crashes when installed on G700 Handle PLTN-ATR G700 variants in sensor interface routing Apr 13, 2026
Copilot AI requested a review from doudar April 13, 2026 17:30
@doudar doudar marked this pull request as ready for review April 15, 2026 17:08
Copilot AI review requested due to automatic review settings April 15, 2026 17:08
@doudar doudar merged commit bc17bb9 into develop Apr 15, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Peloton G700 model detection so newer PLTN-ATR*-reported devices route to the correct sensor interface at startup, preventing the mis-route crash described in the PR.

Changes:

  • Added a helper function to classify G700 CrossTrainer models (G700* and PLTN-ATR*).
  • Updated IsG700CrossTrainer to use the new helper.
  • Added unit tests covering positive/negative model-classification cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/src/main/java/com/spop/poverlay/util/Peloton.kt Broadens G700 detection via a helper and updates the exported IsG700CrossTrainer flag.
app/src/test/java/com/spop/poverlay/util/PelotonModelDetectionTest.kt Adds regression tests for new model-detection logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +16
/** G700 model strings include either legacy "G700" or newer "PLTN-ATR" prefixes. */
internal fun isG700CrossTrainerModel(model: String): Boolean {

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are now two adjacent KDoc blocks (the existing G700 KDoc above and the new one-liner here). In Kotlin, only the KDoc immediately preceding a declaration is associated, so the earlier block becomes detached/ignored. Consider merging the new sentence into the existing KDoc (or converting one of them to a regular // comment) so documentation stays attached to the intended declaration.

Copilot uses AI. Check for mistakes.
@JohnnyMoo83

Copy link
Copy Markdown

Thanks. I can see the new lines of code and have installed the new v 0.33 but the same issue remains. It opens up but does not log stats before crashing after 10 seconds or so.

@JohnnyMoo83

Copy link
Copy Markdown

Hi Find attached the log errors and the code after my AI had a go at fixing it. The APP now does not crash but moans amount sensors being asleep and then just sits there not showing any stats etc.

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.

Grupetto crashes when installed on G700

4 participants