Professor_Joe
Posts: 85
Joined: Fri Jul 24, 2020 2:17 am

Raspberry Pico Issue with Thonny

Fri Sep 24, 2021 2:24 pm

Hello, having trouble connecting Thonny to Pico. Followed https://core-electronics.com.au/tutoria ... honny.html and was perfectly fine. But when I tried plugging the pico a second time Thonny no longer detects my Pico
Image
Image
Have tried pressing BOOSET & updating firmware.

User avatar
B.Goode
Posts: 13004
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry Pico Issue with Thonny

Fri Sep 24, 2021 3:50 pm

Professor_Joe wrote:
Fri Sep 24, 2021 2:24 pm
Hello, having trouble connecting Thonny to Pico. Followed https://core-electronics.com.au/tutoria ... honny.html and was perfectly fine. But when I tried plugging the pico a second time Thonny no longer detects my Pico
Image
Have tried pressing BOOSET & updating firmware.


There is official Raspberry Pi documentation for the use of microPython on the RPi Pico microcontroller here -

https://datasheets.raspberrypi.org/pico ... on-sdk.pdf

https://hackspace.raspberrypi.org/books ... ython-pico

and an overview here -
https://www.raspberrypi.org/documentati ... umentation

Professor_Joe
Posts: 85
Joined: Fri Jul 24, 2020 2:17 am

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 1:21 am

B.Goode wrote:
Fri Sep 24, 2021 3:50 pm
Professor_Joe wrote:
Fri Sep 24, 2021 2:24 pm
Hello, having trouble connecting Thonny to Pico. Followed https://core-electronics.com.au/tutoria ... honny.html and was perfectly fine. But when I tried plugging the pico a second time Thonny no longer detects my Pico
Image
Have tried pressing BOOSET & updating firmware.


There is official Raspberry Pi documentation for the use of microPython on the RPi Pico microcontroller here -

https://datasheets.raspberrypi.org/pico ... on-sdk.pdf

https://hackspace.raspberrypi.org/books ... ython-pico

and an overview here -
https://www.raspberrypi.org/documentati ... umentation
I have seen those, and have written one program that is currently running, but pressing the stop button doesn't allow me to cancel the program making Thonny unable to access files from the Pico. Image

Edit: Just discovered Ctl + C was all I had to do.

Professor_Joe
Posts: 85
Joined: Fri Jul 24, 2020 2:17 am

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 1:39 am

Ctrl + C seems to work just one time, but now stops working and unable to cancel program using Ctrl + C

hippy
Posts: 10751
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 12:28 pm

Professor_Joe wrote:
Sat Sep 25, 2021 1:21 am
pressing the stop button doesn't allow me to cancel the program making Thonny unable to access files from the Pico.

Edit: Just discovered Ctl + C was all I had to do.
That's odd because pressing "Stop" should send that Ctrl-C.
Professor_Joe wrote:
Sat Sep 25, 2021 1:39 am
Ctrl + C seems to work just one time, but now stops working and unable to cancel program using Ctrl + C
Thonny can sometimes get confused, quite often when using threading or timers. Perhaps post your code so we can see if there is anything about it which may be causing the behaviour. Also, does Ctrl-C stopping not work with all programs or just this one ?

Professor_Joe
Posts: 85
Joined: Fri Jul 24, 2020 2:17 am

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 12:35 pm

Code: Select all

from machine import Pin
from time import sleep
led = Pin(25, Pin.OUT)
n = 0

while True:
    led.toggle()
    print("13 x {} = {}".format(n, 13*n)) # print the thirteen-times table
    n = n+1
    sleep(0.5)
I have only written one code for this RPI Pico because its new

jayben
Posts: 357
Joined: Mon Aug 19, 2019 9:56 pm

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 1:11 pm

Thonny does seem to go unresponsive if the MicroPython program is doing lots of printing on the USB link; this is particularly problematic if you've set the program to auto-start on the Pico.

The only solution I've found is to limit the amount of printing, and when developing, don't auto-start the program, so as a last resort you can cancel it by re-plugging the USB link.

hippy
Posts: 10751
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 1:33 pm

Nothing wrong or unusual in your code that I can see and it runs fine for me. Thonny stops it when the "Stop" icon is clicked or Ctrl-C is pressed. The rate of data printed shouldn't be high enough to cause Thonny to clog-up.

My suggestion is to type the following commands at the ">>>" REPL prompt to see what that shows, what version of MicroPython you have -

Code: Select all

import os
os.uname()

Professor_Joe
Posts: 85
Joined: Fri Jul 24, 2020 2:17 am

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 2:26 pm

hippy wrote:
Sat Sep 25, 2021 1:33 pm
Nothing wrong or unusual in your code that I can see and it runs fine for me. Thonny stops it when the "Stop" icon is clicked or Ctrl-C is pressed. The rate of data printed shouldn't be high enough to cause Thonny to clog-up.

My suggestion is to type the following commands at the ">>>" REPL prompt to see what that shows, what version of MicroPython you have -

Code: Select all

import os
os.uname()
(sysname='rp2', nodename='rp2', release='1.17.0', version='v1.17 on 2021-09-02 (GNU 10.2.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')

hippy
Posts: 10751
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 3:23 pm

That is the latest stable build so I can't see there being anything in that which would not have been fixed which might have been causing a problem.

That suggests the issue lies outside the MicroPython firmware itself. Beyond checking the Thonny version ( Help / About Thonny - and it's 3.3.10 for me ) I am not sure what to suggest.

User avatar
B.Goode
Posts: 13004
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry Pico Issue with Thonny

Sat Sep 25, 2021 3:49 pm

Professor_Joe wrote:
Sat Sep 25, 2021 2:26 pm
hippy wrote:
Sat Sep 25, 2021 1:33 pm
Nothing wrong or unusual in your code that I can see and it runs fine for me. Thonny stops it when the "Stop" icon is clicked or Ctrl-C is pressed. The rate of data printed shouldn't be high enough to cause Thonny to clog-up.

My suggestion is to type the following commands at the ">>>" REPL prompt to see what that shows, what version of MicroPython you have -

Code: Select all

import os
os.uname()
(sysname='rp2', nodename='rp2', release='1.17.0', version='v1.17 on 2021-09-02 (GNU 10.2.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')



In an ideal world it probably wouldn't be relevant, but you haven't mentioned what Hardware/OS combination you are using as a workstation to run your Thonny IDE instance.


Aivar, the developer of Thonny, is a member of these forums and might notice your query here and respond. Or you could raise an Issue with him directly on the related GitHub repository - https://github.com/thonny/thonny/issues

Professor_Joe
Posts: 85
Joined: Fri Jul 24, 2020 2:17 am

Re: Raspberry Pico Issue with Thonny

Sun Sep 26, 2021 2:47 am

I'm using Windows 10 to run Thonny IDE

Return to “General”