Thonny: view variables and debugging

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
sgar
Posts: 5
Joined: Sat May 01, 2021 1:14 pm

Thonny: view variables and debugging

Post by sgar » Sat May 01, 2021 2:13 pm

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 :)

User avatar
aivarannamaa
Posts: 123
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Thonny: view variables and debugging

Post by aivarannamaa » 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?
Aivar Annamaa
https://thonny.org

sgar
Posts: 5
Joined: Sat May 01, 2021 1:14 pm

Re: Thonny: view variables and debugging

Post by sgar » Sat May 01, 2021 10:50 pm

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

User avatar
aivarannamaa
Posts: 123
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Thonny: view variables and debugging

Post by aivarannamaa » 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
Aivar Annamaa
https://thonny.org

sgar
Posts: 5
Joined: Sat May 01, 2021 1:14 pm

Re: Thonny: view variables and debugging

Post by sgar » Mon May 03, 2021 2:27 pm

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

Post Reply