Page 1 of 1

Thonny: view variables and debugging

Posted: Sat May 01, 2021 2:13 pm
by sgar
I'm trying to use Thonny and ESP for an educational prupose and I noticed that debugging seems dissabled and the "variable window" don't show any variable of my scripts. And this features would be nice for newbies.

I read somewhere in this forum that micropython don't support debugging, is this true? Any way to do something similar?
And about the "variables" window in thonny, is not supported either? I only read (bdev, gc and uos) variables in it and new variables introduced by terminal.

BTW where I can find these information? I tried to find it in micropython website or Thonny website with no luck.

Thanks in advance for your time :)

Re: Thonny: view variables and debugging

Posted: Sat May 01, 2021 6:57 pm
by aivarannamaa
Debugging isn't supported, because MicroPython lacks some required featured for this.

Regarding variables table -- it is supposed to show all global variables which don't start with an underscore. Can you bring a specific example, where some variables are present in globals() but not shown in the table?

Re: Thonny: view variables and debugging

Posted: Sat May 01, 2021 10:50 pm
by sgar
aivarannamaa wrote:
Sat May 01, 2021 6:57 pm
Debugging isn't supported, because MicroPython lacks some required featured for this.

Regarding variables table -- it is supposed to show all global variables which don't start with an underscore. Can you bring a specific example, where some variables are present in globals() but not shown in the table?
Thanks for your prompt response.

About the variables table I didn't know about need to be global and without underscore, thanks!.
Unluckily seems to be not working for me. Maybe I'm misunderstanding something...
I tried version 3.3.3 and 3.3.7

Thanks!

Image

Re: Thonny: view variables and debugging

Posted: Sun May 02, 2021 5:15 am
by aivarannamaa
From the screenshot I see that you have stopped your program with Stop/Restart button. This button, besides interrupting the program, does soft reboot for MicroPython's VM. That's why you don't see the globals defined in your program. If you want to simply interrupt your program then use Ctrl+C

Re: Thonny: view variables and debugging

Posted: Mon May 03, 2021 2:27 pm
by sgar
aivarannamaa wrote:
Sun May 02, 2021 5:15 am
From the screenshot I see that you have stopped your program with Stop/Restart button. This button, besides interrupting the program, does soft reboot for MicroPython's VM. That's why you don't see the globals defined in your program. If you want to simply interrupt your program then use Ctrl+C
It was that, thanks a lot for your time! :D