retrieveEsp32Firmware

suspend fun retrieveEsp32Firmware(release: FirmwareRelease, hardware: DeviceHardware, onProgress: (Float) -> Unit): FirmwareArtifact?(source)

Download the ESP32 OTA firmware binary. Tries in order:

  1. .mt.json manifest resolution (2.7.17+) — the authoritative app0 partition image.

  2. firmware-<target>-<version>-update.bin — the bare app image. Preferred over the plain .bin because on pre-2.7.17 releases (which ship no manifest) firmware-<target>-<version>.bin is a merged image (bootloader + partition table + app); flashing that to the app0 partition leaves it misaligned and the device's esp_ota_end rejects it. -update.bin is the OTA-able app image whenever it is published.

  3. firmware-<target>-<version>.bin — the bare app image on 2.7.17+ (which publish no -update.bin).

  4. Any matching .bin from the release zip.

Return

The downloaded .bin FirmwareArtifact, or null if the file could not be resolved.