Closed laurensvalk closed 3 years ago
Is the program supposed to print something?
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.
Is the program supposed to print something?
Yes and no. No prints in this demo, but the "Running program..." seems to get gobbled up.
Of course. (Why didn't I notice that? :smile:)
Should be fixed now. Not 100% sure since I could only rarely reproduce the problem.
@dlech Something seems to have gone seriously wrong with program output in the latest version of pybricksdev - I'm not seeing any!
With latest (34ac155fda24b86eaeda685104cb6651f2d66720):
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 (29b1bee32dc44bf85480781eff4e12b1245b712b):
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.
On Ubuntu 20.04 and
('primehub', '3.0.0b4', 'a0856ec1 on 2021-04-09')
, I'm getting this:It does run despite this.
This was working before.