-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Remotely starting a stored program with pybricksdev #284
Comments
Although seemingly unrelated, this would be solved by #408, by running a script that just does And this is perhaps even more useful than a special start command, since you'd be completely flexible in passing additional commands. You could upload the same from main import SmartTrain
train = SmartTrain(param1, param2)
train.start() |
This is now theoretically possible with pybricks/pybricks-micropython#109 and subsequent PRs. Sending program size 0 is the same as pressing the button. Although it might be nicer to make a command for it just like we have the stop command. Then we can get rid of the special size to trigger the REPL as well. |
Could that currently work using pybricksdev? |
This has been done in the firmware, so it is possible now. There just isn't a high-level API for it in pybricksdev. It should be easy enough to split the download and run function into two functions. |
Oh yeah, I see it now, I have no idea why I missed this earlier |
If I understand correctly, the new function For me, the ideal API would be to have |
Is your feature request related to a problem? Please describe.
I am incorporating multiple PoweredUp Hubs in a larger project which is controlled centrally on a PC using
pybricksdev
. When running it, I have to runBLEPUPConnection.run()
for each Hub, which for me takes about 10 seconds (see #283). Given that we have the possibility to store a program on the hub permanently, it would be a nice feature to be able to start that program remotely usingpybricksdev
, so the program will not have to be copied to the hub every time I am testing my larger project. Even when #283 is addressed, each download and run operation takes about 2-3 seconds for me even with Pybricks Code, so I still think that this would be a useful addition topybricksdev
especially if you are using scripts of large sizes, which might take a bit longer to copy still.Describe the solution you'd like
I can imagine adjusting the API by seperating copying and starting a program like so:
And this should also work when ommitting
copy_script
when a program was already stored permanently when flashing the firmware.If there might ever be the possiblity of storing multiple scripts on the hub, one could introduce a separate name parameter for
copy_script
andrun_script
so the scripts can be identified.The text was updated successfully, but these errors were encountered: