toitware / public

Issue tracking for the Toit IoT platform, the Toit language, and the Toit APIs.
8 stars 0 forks source link

Be possible to un-provision or force a provision? #13

Closed marianopeck closed 3 years ago

marianopeck commented 3 years ago

Is your feature request related to a problem? Please describe. I have an ESP32 that I use to demo the whole process of getting started with Toit (and that involves the first step of provision). I also like testing the provision in different operating systems, in Chrome with the web console, etc. Some time ago, I think I was able to re-provision a device. But now it seems I can't. And of course, while they are cheap, I don't want to buy a new one each time I want to run a provision.

Describe the solution you'd like I would like the provision command to allow a -f force kind or argument or a new command unprovision. Whatever that allows me to provision it again just for demoing or testing purposes. Please note that a reinstall is not a workaround for my problem because that's a different command and does different things. I want to be able to run again an exact provision.

Thanks in advance,

jstroem commented 3 years ago

This is intentional from our side. One physical device should only have one hardware id. If you really want to do this, you can use the esptool to erase the flash for the esp32. That way we can't distinguish your device from a new one:

esptool erase_flash

or using the cached esptool installed by toit:

~/.cache/toit/tools/esptool_linux_v3.0 erase_flash
marianopeck commented 3 years ago

Thanks @jstroem I just tried on OSX and Windows and in both platforms it worked perfectly. I was able to erase the flash, unclaim and provision again. Thanks!