Dampx
Posts: 1
Joined: Tue Jun 01, 2021 8:09 pm

Trouble downloading micropython on pico

Tue Jun 01, 2021 8:24 pm

I'm just got my pico and it was going great until this. So when i download micropython and drag the file onto the pico it turns off and i thought it would reset like the video guide said but it didn't so i figured it might take a bit so i left it for half an hour and then when i came back it still didn't restart so i unplugged it and turned it on and when i went into thonny and selected micropython and it gave me an error and told me to install micropython. Does anyone know how to fix this?

User avatar
OneMadGypsy
Posts: 326
Joined: Wed Apr 28, 2021 1:57 am
Location: New Orleans, Louisiana
Contact: Website

Re: Trouble downloading micropython on pico

Tue Jun 01, 2021 8:38 pm

If you dragged a .uf2 file onto the Pico, you are ready to go. There is no "reset" as you mention it. It's just ready. I'm not sure what you expect it to do after it disconnects as a drive, but whatever you were expecting, it doesn't do that. There also should never be a time where you have to wait 30 minutes for the Pico to do anything.

Just a fun fact:
I was tempted to tell you if you wait 30 minutes without using the Pico, from a maiden firmware install, it bricks the Pico. However, as hilarious as I might think that is, completely ruining your day is not on my "to do" list. :D
"Focus is a matter of deciding what things you're not going to do." ~ John Carmack

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

Re: Trouble downloading micropython on pico

Wed Jun 02, 2021 11:07 am

OneMadGypsy wrote:
Tue Jun 01, 2021 8:38 pm
I was tempted to tell you if you wait 30 minutes without using the Pico, from a maiden firmware install, it bricks the Pico.
I wasn't aware of that. Have you or anyone raised it as an issue ?

I would give it a go but don't have a Pico which is in factory fresh condition. Do you have precise instructions on how to replicate this bricking ? Is it really bricked or just hung ?

User avatar
OneMadGypsy
Posts: 326
Joined: Wed Apr 28, 2021 1:57 am
Location: New Orleans, Louisiana
Contact: Website

Re: Trouble downloading micropython on pico

Wed Jun 02, 2021 8:14 pm

-hippy

How could you not be aware of this? It's a failsafe. If you wait 30 minutes from a maiden firmware install it's assumed you couldn't possibly be a real person, as a real person would be excited to get started and wouldn't want to wait 30 seconds, much less 30 minutes. So, the only other completely logical explanation is that you must be a cat. Since cats can't read EULA's the Pico bricks to legally protect itself from meowfeasance. :ba-dump-tsss:

:D :D :D You don't have to tell me how terrible that joke is. I wrote it.
"Focus is a matter of deciding what things you're not going to do." ~ John Carmack

dbrion06
Posts: 478
Joined: Tue May 28, 2019 11:57 am

Re: Trouble downloading micropython on pico

Thu Jun 03, 2021 1:33 pm

If you wait 30 minutes from a maiden firmware install it's assumed you couldn't possibly be a real person, as a real person would be excited to get started and wouldn't want to wait 30 seconds, much less 30 minutes
Some real persons have to answer long phone calls (phone are real, too; they should not)
Te ov baxtale.

TechnologyIsNotDull
Posts: 3
Joined: Wed Mar 28, 2018 11:19 am

Re: Trouble downloading micropython on pico

Sat Jun 12, 2021 8:29 am

Ah, amusing but not helpful.

This is a serious question, and one I have encountered recently.

I downloaded the most recent UF2 file from micropython.org, put the Pico into Boot mode, copied the UF2 into the USB device tht is the Pico and it reset.

Started Thonny in Raspberry Pi Pico mode and the shell just sits there....

If I attempt to open or save to the Pico I get an error message saying the device is busy.

This would seem to echo the original poster's situation.

(Okay, actually I have a Pico Explorer board so downloaded the Pimoroni library UF2, then the Pimoroni plus Adafruit one, until finally resorting to the vanilla one from micropython).

I then tried it with one of my previously untouched ones. Same.

Having read the documentation (no really) I came upon the testing via Minicom, so thought I would give it a go.

To access it, the popular Minicom package is used.

Install it on your Pi using:

sudo apt install minicom

Next, identify the serial port.

The Pico should appear as a port of the form /dev/ttyACM.

Use

ls /dev/tty*

If it is unclear which port is the Pico, unplug it and try again, identifying which device disappears.

Connect to the MicroPython running on the Pico using:

minicom -o -D /dev/ttyACM0

This should display the Minicom opening text:

Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyACM0, 07:39:31
Press CTRL-A Z for help on special keys
You now need to soft reboot, press Control and D. This will display information about the installed MicroPython and the prompt >>>.

MPY: soft reboot

MicroPython v1.15 on 2021-04-18; Raspberry Pi Pico with RP2040

Type "help()" for more information.

>>>

To test the MicoPython, try the classic:

>>> print("hello")

hello

>>>

This shows that MicroPython is running successfully on your Pico.

Control A then Z brings up help.

Control X closes Minicom.

This should show whether your MicroPython (micropython? what is the preferred/official form?) is working.
Last edited by TechnologyIsNotDull on Sat Jun 12, 2021 8:56 am, edited 1 time in total.
My external after-market memory is available here:
https://technologyisnotdull.blogspot.com/

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

Re: Trouble downloading micropython on pico

Sat Jun 12, 2021 11:17 am

TechnologyIsNotDull wrote:
Sat Jun 12, 2021 8:29 am
Having read the documentation (no really) I came upon the testing via Minicom, so thought I would give it a go.
The rest of your post after that is written as "what should be expected" -- what were your actual results ?

Also try "ls /dev/ttyACM*" when your Pico is connect -- what does it show ?

User avatar
OneMadGypsy
Posts: 326
Joined: Wed Apr 28, 2021 1:57 am
Location: New Orleans, Louisiana
Contact: Website

Re: Trouble downloading micropython on pico

Sat Jun 12, 2021 11:56 am

For the like one day I used Thonny, when I first got my Pico, I had the hang issue and I was able to fix it by pressing stop.I believe I also toggled the port selection from the specific port to "detect". Lots of updates have been made to Thonny since that day, so I don't know if that still works. I can't honestly say that what I'm claiming worked at all or if it just seemed like it did since it finally connected. I guess the best I can claim is if you click and change a bunch of stuff that doesn't make sense to click or change, it would finally connect.

Personally, I believe some dummy terminal capable of dealing with an MCU and any editor you want to use is the way to go. Heck, you could even use Libra Office to program in if that makes you happy, cause once you have a dummy terminal the rest is just some place to type.
"Focus is a matter of deciding what things you're not going to do." ~ John Carmack

TechnologyIsNotDull
Posts: 3
Joined: Wed Mar 28, 2018 11:19 am

Re: Trouble downloading micropython on pico

Sat Jun 12, 2021 6:02 pm

hippy wrote:
Sat Jun 12, 2021 11:17 am
TechnologyIsNotDull wrote:
Sat Jun 12, 2021 8:29 am
Having read the documentation (no really) I came upon the testing via Minicom, so thought I would give it a go.
The rest of your post after that is written as "what should be expected" -- what were your actual results ?

Also try "ls /dev/ttyACM*" when your Pico is connect -- what does it show ?
Ah sorry, the trouble with copy and pasting from my external memory., the tenses are not quite right...

Using Minicom it works fine (for a REPL value of fine), I had checked for the port by listing (ls) /dev/ttyACM*, and it was the ACM0.
I ran:
minicom -o -D /dev/ttyACM0

Which displayed the Minicom opening text:

Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyACM0, 07:39:31
Press CTRL-A Z for help on special keys

I did a soft reboot, pressing Control and D. This displayed information about the installed MicroPython and the prompt >>>.

MPY: soft reboot

MicroPython v1.15 on 2021-04-18; Raspberry Pi Pico with RP2040

Type "help()" for more information.

>>>

At the prompt I typed:
print("hello")
and got hello back.

Micropython works - the issue appears to be with Thonny.

OneMad Gypsy has suggested that Thonny might be looking at the wrong ports - I had not thought to check that.

That would explain why the Minicom terminal works - I searched for the port, found the port and talked to the port. If Thonny had picked up an incorrect port with a previous run (potentially when running a Circuit Python Trinkey) it might still be trying to talk to the previously used port and complaining the device was busy.

Thanks to both of you for some pointers, I will let you know how it goes.
My external after-market memory is available here:
https://technologyisnotdull.blogspot.com/

TechnologyIsNotDull
Posts: 3
Joined: Wed Mar 28, 2018 11:19 am

Re: Trouble downloading micropython on pico

Sat Jun 12, 2021 6:23 pm

OneMadGypsy wrote:
Sat Jun 12, 2021 11:56 am
I believe I also toggled the port selection from the specific port to "detect".
And that is the answer.

Thank you.
My external after-market memory is available here:
https://technologyisnotdull.blogspot.com/

User avatar
scruss
Posts: 4176
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Trouble downloading micropython on pico

Mon Jun 14, 2021 8:29 pm

If a main.py script is running, you need to hit Stop in Thonny to get access to the REPL and filesystem. It's the same as hitting Ctrl-C in a terminal to get back to the REPL.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “MicroPython”