Skip to content

Expected checksum #16

Closed
Closed

Description

@laurensvalk

On Ubuntu 20.04 and ('primehub', '3.0.0b4', 'a0856ec1 on 2021-04-09'), I'm getting this:

pybricksdev run ble "Pybricks Hub" ~/git-pybricks/pybricks-micropython/tests/pup/sensors/color_color.py 
Searching for Pybricks Hub
Downloading 748 bytes in 8 steps.
Progress: 12%
Progress: 25%
Progress: 38%
Progress: 50%
Progress: 62%
Progress: 75%
Progress: 88%
Progress: 100%
2021-04-09 11:59:19,975: WARNING: Expected checksum 197 but got 13
2021-04-09 11:59:19,976: WARNING: Expected checksum 197 but got 32

...done.

It does run despite this.

This was working before.

Activity

  1. dlech commented on Apr 9, 2021

    @dlech
    Member

    Is the program supposed to print something?

  2. thesynman commented on Apr 9, 2021

    @thesynman

    I'm seeing the same issue on Win10 with the latest pybricksdev and latest firmware. I get the occasional checksum error but the program seems to install OK.

  3. laurensvalk commented on Apr 9, 2021

    @laurensvalk
    MemberAuthor

    Is the program supposed to print something?

    Yes and no. No prints in this demo, but the "Running program..." seems to get gobbled up.

  4. dlech commented on Apr 9, 2021

    @dlech
    Member

    Of course. (Why didn't I notice that? 😄)

  5. added a commit that references this issue on Apr 9, 2021
  6. dlech commented on Apr 9, 2021

    @dlech
    Member

    Should be fixed now. Not 100% sure since I could only rarely reproduce the problem.

  7. added
    bug
    on Apr 9, 2021
  8. self-assigned this
    on Apr 9, 2021
  9. thesynman commented on Apr 10, 2021

    @thesynman

    @dlech Something seems to have gone seriously wrong with program output in the latest version of pybricksdev - I'm not seeing any!

    With latest (34ac155):

    C:\PycharmProjects\pybricksdev>poetry run pybricksdev run ble "Pybricks Hub" "print('hi there')"
    Searching for Pybricks Hub
    Downloading 45 bytes in 1 steps.
    
    Progress: 100%
    Running downloaded program...
    
    C:\PycharmProjects\pybricksdev>
    

    With v1.0.0-alpha.1 (29b1bee):

    C:\PycharmProjects\pybricksdev>poetry run pybricksdev run ble "Pybricks Hub" "print('hi there')"
    Searching for Pybricks Hub
    Downloading 45 bytes in 1 steps.
    Progress: 100%
    
    Running downloaded program...
    hi there
    
    ...done.
    
    C:\PycharmProjects\pybricksdev>
    
  10. thesynman commented on Apr 10, 2021

    @thesynman

    Further to my last comment, I've discovered that a short wait after the print allows the program to execute correctly:

    C:\PycharmProjects\pybricksdev>poetry run pybricksdev run ble "Pybricks Hub" "from pybricks.tools import wait; print('hi there'); wait(200)"
    Searching for Pybricks Hub
    Downloading 84 bytes in 1 steps.
    Progress: 100%
    
    Running downloaded program...
    hi there
    
    ...done.
    
    C:\PycharmProjects\pybricksdev>
    
  11. laurensvalk commented on Apr 10, 2021

    @laurensvalk
    MemberAuthor

    It's possible that the final program output hasn't been fully processed and printed by the time the "program-completed" signal comes in. Like you've found, a short delay should be good enough. I've just pushed something like it to the master branch.

    We expect to revise this part of Bluetooth a bit more in the next release, so a workaround like this should be good for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions