-
Notifications
You must be signed in to change notification settings - Fork 139
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
add "soft reboot" command from rshell #187
Comments
You can do this by using the |
Thank you for your quick answer. |
Same thing on Ubuntu. If the current thread on Pico is "blocking" REPL, you can only interrupt it if your first character is Ctrl-C, every other key or key combination just causes it to freeze, after which even Ctrl-C does not work any more. This is not the case on ESP32. |
Anytime that rshell sends a command to the microcontroller, the microcontroller goes through a soft-reboot process. So even a simple If Control-C doesn't work, then a soft reboot won't work either. The way rshell works is that for every command that needs to get information to/from the microcontroller it goes through a process of entering and exiting the raw repl, which involves sending a Control-C then a Control-A to enter the raw repl, then a Control-D to do a soft-reset, then it sends the command it wants to execute and finally a Control-B to exit the raw repl. The act of starting rshell requires sending at least 6 different commands to establish communications with the board, so by the time you get to the rshell prompt, the board will have gone through 6 soft-reboots. |
I'm trying to update the code on a Pico via rshell in a bash script (the Pico and host are remote), so I can't send Control-D. I've tried sending dummy ls commands, as well as entering and immediately exiting the repl but the Pico is not resetting. Have I misunderstood? Example: |
Hmm. I think the problem is that when rshell does a soft-reboot it's doing it with the raw-repl, and when that happens micropython doesn't run main.py If you create a file called reset.py with the following contents:
Then you could do: |
It would be great if there was a machine.soft_reset() / "Ctrl-D in REPL" command available in rshell... ideally with some shortcut... Ctrl-<some_key>
The text was updated successfully, but these errors were encountered: