-
Notifications
You must be signed in to change notification settings - Fork 160
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
ampy not working while main.py is running #64
Comments
if you can open a terminal session to the REPL ( issue control C and enter to get to REPL) try:
|
@jerryneedell Do you think ampy might send a ctrl-C itself to the REPL, always, before doing something, so that any running program is interrupted? Is that a good enhancement? |
@dhalbert I thought it did that already. |
@dhalbert it should call enter_raw_repl() https://github.com/adafruit/ampy/blob/master/ampy/pyboard.py#L175 |
Yes, it does: https://github.com/adafruit/ampy/blob/master/ampy/pyboard.py#L180. Yes, we need more info. |
This has come upon the past and been fixed then reappeared though I can't find the references to it. Playing with the "delay" parameter might help ... |
some discussion here: adafruit/circuitpython#636 |
FWIW -- I am able to do am ampy ls with an endless main.py on my esp32.
It did hang once but it recovered when I tried adding a longer delay I usuallh have the delay set to 0 -- here is my .ampy file
I am using ampy 1.0.5 -- Ubuntu 18.04 - micropython 1.9.4 |
I also had this problem, getting started with CircuitPython on esp8266. When I have a main.py that does not exit, all ampy operations fail in enter_raw_repl, when the device soft reboots and b'raw REPL; CTRL-B to exit\r\n' never appears on the buffer. Changing the delay did not help. I was able to "fix" with: After soft reset, look for prompt to enter REPL and send Ctrl-A to enter raw REPL.
Second, after executing a command, I was seeing b'raw REPL; CTRL-B to exit\r\n' on the buffer before 'OK'.
|
Hiya! We are discontinuing support for ampy, and will no longer be maintaining it. We are leaving this repository available for continued use. If you would like to take over supporting it, please contact us on the Adafruit Discord server and we can transfer the repository to you. |
Does anyone know of a good replacement for |
ampy is now maintained at https://github.com/pycampers/ampy |
@willcharlton Hey! I'm one of the members of pycampers; we just got maintainership of this project. If you have any specific stuff you want to talk about, just ping me. |
Still having this issue, I have tried @gkyle approach, however no luck. In fact it stops me from being able to execute any commands. |
I don't have a clear solution, but I just wanna spit out my 2 cents :- This project is originally based on What I would like to see, is a proper API for communicating with the device. I admit, that haven't had the time to fully devote myself to this project, but this is one fundamental issue I see with micropython, in the limited time I have the chance to fire up my editor, and hack on ampy. I would love any suggestions that you guys have on building a proper communication backend inside micropython. I have one idea -- Maybe we can build a special, "debug" firmware, that contains a simple http/tcp server, that listens for commands from an ampy client. This way, we could avoid all sorts of issues that arise from doing flaky serial communication, and potentially, even enable in-browser apps that talk directly to the boards! |
@devxpy As you see, trying to control things through the REPL can be less than satisfactory. That's one reason why Adafruit dropped support for |
@dhalbert Took me time to get there, but I've finally built a POC, that involves a development micropython firmware, which hosts an RPC server. This allows users to remotely execute code on the device, from their machine, without ever interacting through the REPL in serial mode. More details here. Needless to say, haven't quite given up on ampy just yet :) |
Adding a delay of 0.5 worked for me. |
@devxpy - whoa, that is great news. I'm just seeing this now that you're the new maintainer. I will start thinking about features again. Thank you! |
This is working, except that for me it was more than 0.5, so for other people I suggest experimenting. |
If I have a main.py file in which a while-loop runs forever, then I can not issue the ampy command.
I don't think this is a bug, but I will have to use esptool.py to erase my esp32 borad, and flush firmware.
Is there any other way to edit or delete the none-stoping main.py file
--EDIT---------
I had the issue above with Ubuntu16.
Now on Win10, I don't have the issue any more, I can "ampy rm main.py" while main.py is running
The text was updated successfully, but these errors were encountered: