Can't interrupt Pi Pico

December 31, 2023, 21:52

sikewerld

I'm trying to write a new program for my pi pico that I have not used in months, but Thonny is probably the worst software to ever exist and will not interrupt the program and I can't find any other button to stop the program. I can't open the files because it's "in use" or whatever. Any ideas?

k9t33n

I was about to say to use pkill to kill the program but remembered the Pico doesn't actually have a terminal

k9t33n

uhm, press the bootsel button?

sikewerld

nothin

k9t33n

idk enough about the pico

k9t33n

can you reboot it at all? because I would just reboot it

sikewerld

I mean it's been unplugged for months if thats what you mean

sikewerld

but as for like a factory reset I have no idea

k9t33n

not a factory reset, a reboot. on a different pi you would normally use sudo reboot now

sikewerld

well I don't think so I don't know

sikewerld

like I said I can't run any code at all because I can't interrupt what's already running

k9t33n

is it a while loop?

sikewerld

probably

sikewerld

I haven't seen the code in months and I can't open it because it's "in use"

k9t33n

wait it's been unplugged and it's still running?

sikewerld

no it's only running when it's plugged in

k9t33n

like unplug and replug for me

sikewerld

I have a bunch of times

sikewerld

As soon as it starts it starts running the main script

k9t33n

no I know that

k9t33n

ok so it must be set to run after boot

sikewerld

yes lol it's a microcontroller

sikewerld

I think you're thinking of it like a single board computer more than a microcontroller

k9t33n

yeah sorry I know how they work I'm just not thinking straight

sikewerld

no worries it's tough to think about if you haven't used them before

k9t33n

too used to actual computers and no microcontrollers

sikewerld

they're really aids to work with since they have no OS and no real interface

sikewerld

not to mention thonny (the python ide) is awful

k9t33n

especially when I want to run commands really badly but can't

k9t33n

like if I could do that this problem would be over by now

k9t33n

anyway, try removing the file

sikewerld

lol I can't

sikewerld

I can't even view the file

sikewerld

it just says it's in use

k9t33n

figured that

k9t33n

damn, I need to think now

k9t33n

you fine with a factory reset?

sikewerld

yup

k9t33n

ok first connect the run pin to a ground pin

k9t33n

this should "reset" the Pico, I have a feeling it will just re run the script again but if it actually works this is better than a factory reset

k9t33n

factory reset shall be the backup option

sikewerld

doesn't seem to be doing anything

sikewerld

do I need to hit the button?

k9t33n

bootsel? possibly

k9t33n

try it

sikewerld

didn't seem to work

sikewerld

I found this file that should rename the main.py file so I'm trying that atm

k9t33n

yeah I was just about to say to do that

k9t33n

MicroPython_RenameMainDotPy.uf2.zip right?

k9t33n

https://forums.raspberrypi.com/download/file.php?id=45227&sid=0f009ae87782b728201af0c42cf83be6 this one, finally if this doesn't work we will try the factory reset

sikewerld

I can't figure out how to copy it into the pico

sikewerld

it just keeps throwing an error

sikewerld


k9t33n

ok I'm just gonna say this step although it probs isn't needed

k9t33n

unplug the Pico from your computer, hold bootsel then put it back in, now when you download the file download it directly into the pis root. I'm guessing you don't have to hold bootsel throughout all of that just when you plug it in

sikewerld

yup that's what I did

sikewerld

i even tried it holding it the whole time once too

k9t33n

damn, I'm not even sure the factory reset will work then because it uses the same concept

sikewerld

maybe I'm not copying it to the right place?

k9t33n

possibly

sikewerld

I'm copying it to the folder that pops up when I plug it in, D:, it's RPI-RP2

sikewerld

I can't think of anywhere else it would go though

k9t33n

yeah thats right I think

sikewerld

I ordered a Pi 5 hopefully when that arrives it's not complete aids to work with like this

k9t33n

no it isn't

sikewerld

is the factory reset the same thing, copying a file?

k9t33n

it's got an actual terminal

k9t33n

yup

sikewerld

oof

k9t33n

ok well im lost

k9t33n

I don't have any more ideas

sikewerld

same

k9t33n

Welp I'm sorry I couldn't help

sikewerld

you did by talking it out and just yknow making sure the process was at least correct

sikewerld

I actually just fixed it btw

sikewerld

I had to leave right after that to go to a New Years Party but basically the problem with me not being able to copy the file was actually the USB slot it was plugged into

sikewerld

something is wrong with my keyboard's USB port apparently, it can read the data just fine but it seems to struggle with writing data through it

k9t33n

thx ❤️

k9t33n

wait wth how?

k9t33n

omg that is unbelievable annoying

k9t33n

well thanks ig, I help out around here because I end up learning myself and this has been a big learning moment for me so I can thank you for that

sikewerld

no problem just making sure for future reference if you have a dumb problem to find a dumb solution <:missydoge:601220301312884766>

k9t33n

couldn't have said it better myself