I'm curious if there is a way to "factory-reset" a board (ESP32 in my case) to the original state of a fresh Micropython installation, typically found in commercial hardware solutions. This often involves pressing a button for some time while restoring power, or other techniques.
What I want to achieve basically is that someone without deeper know-how in Micropython can reset their chip to the firmware state as it was when freshly flashed. So basically it would need to:
- delete any WiFi credentials
- delete files created beginning first boot
Second idea I've had would be to put some code in main.py at the beginning that checks for i.e. a reboot reason (don't know if I can somehow determine if i.e. a button was pressed during startup)