|
| 1 | +# Updating |
| 2 | + |
| 3 | +## The supported way: over-the-air updates |
| 4 | + |
| 5 | +The only supported way to update MicroPythonOS is the built-in **OSUpdate** |
| 6 | +app (over-the-air updates). OTA updates write the new OS to the inactive |
| 7 | +system partition and leave your storage partition untouched: installed |
| 8 | +apps, preferences (WiFi credentials, wallet-display configs, Nostr keys), |
| 9 | +and user data are all preserved. |
| 10 | + |
| 11 | +When an update is available, the notification bar offers it, or you can |
| 12 | +open the OSUpdate app directly. |
| 13 | + |
| 14 | +## Reinstalling with the web installer is not an update |
| 15 | + |
| 16 | +The [WebSerial installer](https://install.micropythonos.com) performs a |
| 17 | +**clean install**, and reflashing a device that already has MicroPythonOS |
| 18 | +on it can cost you your data: |
| 19 | + |
| 20 | +- If you select **"Erase device"** during installation, your storage |
| 21 | + partition — all apps, settings, and keys — is **certainly** erased. |
| 22 | +- Even without erasing, a newer version **may use a different partition |
| 23 | + layout** than the one on your device (this can happen from time to time |
| 24 | + as MicroPythonOS evolves). In that case the storage partition is |
| 25 | + reformatted on first boot, **without any prompt**. |
| 26 | + |
| 27 | +So, just like for any electronics device: **make a backup of important |
| 28 | +files before reinstalling the software.** For example, over USB with |
| 29 | +[mpremote](https://docs.micropython.org/en/latest/reference/mpremote.html): |
| 30 | + |
| 31 | +```bash |
| 32 | +mpremote fs cp -r :/apps :/prefs :/data ./mpos-backup/ |
| 33 | +``` |
| 34 | + |
| 35 | +## Advanced: manual offline update |
| 36 | + |
| 37 | +If a device has no network access, you can apply an update manually by |
| 38 | +writing the over-the-air update file (for example |
| 39 | +`MicroPythonOS_esp32s3_0.17.3.ota` from the |
| 40 | +[releases](https://github.com/MicroPythonOS/MicroPythonOS/releases)) to |
| 41 | +the OTA application offsets in flash with esptool. For the esp32s3 build, |
| 42 | +for example, the two OTA slots are at `0x20000` and `0x3A0000`: |
| 43 | + |
| 44 | +```bash |
| 45 | +python3 -m esptool --chip esp32s3 write_flash 0x20000 MicroPythonOS_esp32s3_0.17.3.ota |
| 46 | +``` |
| 47 | + |
| 48 | +This writes the same bytes an OTA update would, so the storage partition |
| 49 | +is left alone — but it is an advanced action: the offsets differ per |
| 50 | +board/build, and writing to the wrong offset can corrupt the device's |
| 51 | +filesystem. Making a backup first is strongly advised. |
0 commit comments