Need help debugging with REPL

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
BillG
Posts: 9
Joined: Fri Feb 05, 2016 4:12 pm

Re: Need help debugging with REPL

Post by BillG » Wed Apr 06, 2016 5:21 pm

@pythoncoder - Thanks, Peter. I'll try your approach of running the program from REPL. I have so far been running the program as a startup, without starting from REPL.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Need help debugging with REPL

Post by pythoncoder » Thu Apr 07, 2016 6:25 am

It does make things much simpler. When you've debugged your application and you want it to run at startup, my approach is to edit main.py to be a one-liner which runs your program. The beauty of this is that, if it fails or you want to modify it, you can get the REPL back simply by fitting an SD card with a null main.py. Even easier, if you use rshell, you can edit main.py from rshell to comment out the line, then get the REPL back.

There are other ways to get it back, notably the safe boot modes, but that's how I do it ;)
Peter Hinch
Index to my micropython libraries.

Post Reply