You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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>
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>
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>
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.
Activity
dlech commentedon Apr 9, 2021
Is the program supposed to print something?
thesynman commentedon Apr 9, 2021
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.
laurensvalk commentedon Apr 9, 2021
Yes and no. No prints in this demo, but the "Running program..." seems to get gobbled up.
dlech commentedon Apr 9, 2021
Of course. (Why didn't I notice that? 😄)
connections: fix checksum race condition
dlech commentedon Apr 9, 2021
Should be fixed now. Not 100% sure since I could only rarely reproduce the problem.
thesynman commentedon Apr 10, 2021
@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):
With v1.0.0-alpha.1 (29b1bee):
thesynman commentedon Apr 10, 2021
Further to my last comment, I've discovered that a short wait after the print allows the program to execute correctly:
laurensvalk commentedon Apr 10, 2021
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.