Closed mjmare closed 7 years ago
Oh if you have a main loop that never exits (the while True) ampy will get confused waiting for the program to finish and eventually timeout. In those cases add the -n option which tells amp not to wait for output. For example:
ampy run -n foo.py
Ah, should have thought of that. Saw you use this feature in one of the videos. OTOH, I would expect amp to "hang", but not the program on the board to not work.
Thanks -- I was getting timeout error on a microPython program. I used the -n option and it went away.
The problem is that I do not see the results of any print outs. How can I avoid the timeout and get printouts.
Thank you!, -n works good. Great tool.
Thanks -- I was getting timeout error on a microPython program. I used the -n option and it went away.
The problem is that I do not see the results of any print outs. How can I avoid the timeout and get printouts.
yes same thing happened but then i tried lighting led if msg was correct in the sub_cb func and still it didn't work, then i removed the while loop and did it for single try, still same error what could have happened
Thanks -- I was getting timeout error on a microPython program. I used the -n option and it went away.
The problem is that I do not see the results of any print outs. How can I avoid the timeout and get printouts.
i tried the -n option and intentionally made an error in the code, and ran it, without the -n option it gave a syntax error and with -n it just completed and terminal prompt came back with no error, -n doesn't work
I use
ampy run
a lot and find it very useful. However, it turns out that not all programs can be run this way. When the exact same code is run on the board through the REPL (screen) it does work! I do not understand why.The program in question is an example from the micropython-lib umqtt module: example_sub.py
This is the exception:
When I put the file on the LoPy board and call it from main.py, it works correctly. This is main.py: