Skip to content

[Bug] Ignore stdin when no program is running #303

Closed

Description

@laurensvalk

At the moment, programs downloads and user input/output happen on the same Bluetooth characteristic.

So when no program is running and you type something (anything) in the terminal, the hub interprets it as a program, which usually gives:

ValueError: incompatible .mpy file

As a workaround, perhaps Pybricks Code could ignore user input when no program is running.

Example: stopped a program and then press UP or DOWN button, shows:

SystemExit: stop button pressed
ValueError: incompatible .mpy file
ValueError: incompatible .mpy file
ValueError: incompatible .mpy file
ValueError: incompatible .mpy file
ValueError: incompatible .mpy file

No idea why I would want to press UP or DOWN though 😃
And do not know what the cursor keys are supposed to do.
Most browsing keys act the same.

Originally posted by @BertLindeman in #297 (comment)

Activity

  1. added
    software: pybricks-code
    on Apr 13, 2021
  2. laurensvalk commented on Apr 13, 2021

    @laurensvalk
    MemberAuthor

    We could also accept this as-is, knowing that we will revisit it in the next version.

    As long as program downloads still work after getting this error, this may be acceptable.

  3. laurensvalk commented on Aug 23, 2022

    @laurensvalk
    MemberAuthor

    This should be fixed by pybricks/pybricks-micropython#109 when it gets merged.

  4. laurensvalk commented on Sep 1, 2022

    @laurensvalk
    MemberAuthor

    This should be fixed by pybricks/pybricks-micropython#109 when it gets merged.

    This is done, so we can close this.

  5. added theissue type on Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    software: pybricks-code

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions