I'm trying to add function in main.py to do something.
Accidentally, I put machine.reset() right under if __name__ == "__main__":
instant brick...... its repaired, but all works on the pico w were lost.
great lesson.
1. be very careful on running main.py
2. backup files.
Great Lesson, don't mess up with main.py
Re: Great Lesson, don't mess up with main.py
Would totally recommend including a safety override — like a killswitch to stop execution, or an emergency inhibitor checked once every startup.
And yes, save all your work (preferably version it up) somewhere else every time.
And yes, save all your work (preferably version it up) somewhere else every time.
Re: Great Lesson, don't mess up with main.py
Please use Github Discussions - this site is no longer read by people who know what they're doing.
There's no substitute for backups, but MicroPython_RenameMainDotPy.uf2 can often get your files back
There's no substitute for backups, but MicroPython_RenameMainDotPy.uf2 can often get your files back
Re: Great Lesson, don't mess up with main.py
I don't much like the format of github for discussions of subjects. There doesn't seem to be a familiar "thread" or "topic" layout which is easy to follow. Instead, to me, it looks more like a free-for-all random approach. A bit like Facebook, but much less organised and intuitive.scruss wrote: ↑Sat Oct 08, 2022 6:26 pmPlease use Github Discussions - this site is no longer read by people who know what they're doing.
I guess it could be a case of an old dog having to learn new tricks. Resistant at first, but forced to adapt.......eventually.
ooh, i'll have to check this out.scruss wrote: ↑Sat Oct 08, 2022 6:26 pmThere's no substitute for backups, but MicroPython_RenameMainDotPy.uf2 can often get your files back
I thought i'd bricked my Pico W in a very similar way last week. My only solution was to re-uf2 it, first with flash_nuke, then rebuild it. I never lost anything because I always have my laptop file copies in sync with what's on the Pico. Plus. An additional "superseded" folder containing archives in case i lose the plot and need to go back to a previous revision. Basic housekeeping and redundancy stuff this.
Re: Great Lesson, don't mess up with main.py
Here is a user, who has used since year 2000 phpBB2, phpBB3, woltlab and vBulletin.Rissy wrote: ↑Mon Nov 14, 2022 1:33 pmI don't much like the format of github for discussions of subjects. There doesn't seem to be a familiar "thread" or "topic" layout which is easy to follow. Instead, to me, it looks more like a free-for-all random approach. A bit like Facebook, but much less organised and intuitive.
The user experience on Git-Hub-Discussions is in my opinion more than worse.
It is a little bit better as Facebook and Reddit, but not like real boards.
@ontopic
Depending on the board, you have the option to activate the boot mode.
RP2: Hold boot mode when connecting
Then use the image that erases the flash.
ESP32: Hold the boot button, press the reset button and then release the boot button.
Use the esptool.py to delete the flash.