<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Craig,<div><br></div><div>Thanks for discovering this. It is nasty.</div><div><br></div><div>Error 258 is 0x102 and that is ESP_ERR_INVALID_ARG (not ESP_ERR_NOT_SUPPORTED).</div><div><br></div><div>I find it esp_ota_begin (components/app_update/esp_ota_ops.c):</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><font face="Andale Mono" style="font-size: 14px;">    if (!is_ota_partition(partition)) {</font></div><div><font face="Andale Mono" style="font-size: 14px;">        return ESP_ERR_INVALID_ARG;</font></div><div><font face="Andale Mono" style="font-size: 14px;">    }</font></div></div></blockquote><div><div><br></div><div>and that is:</div><div><br></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><div><font face="Andale Mono" style="font-size: 14px;">static bool is_ota_partition(const esp_partition_t *p)</font></div><div><font face="Andale Mono" style="font-size: 14px;">{</font></div><div><font face="Andale Mono" style="font-size: 14px;">    return (p != NULL</font></div><div><font face="Andale Mono" style="font-size: 14px;">            && p->type == ESP_PARTITION_TYPE_APP</font></div><div><font face="Andale Mono" style="font-size: 14px;">            && p->subtype >= ESP_PARTITION_SUBTYPE_APP_OTA_0</font></div><div><font face="Andale Mono" style="font-size: 14px;">            && p->subtype < ESP_PARTITION_SUBTYPE_APP_OTA_MAX);</font></div><div><font face="Andale Mono" style="font-size: 14px;">}</font></div></div></div></blockquote><div><div><br></div><div>It seems we can’t target the factory partition with those ota operations. I guess the problem is the whole ota rollback thing (where if it can’t boot into an ota partition, it falls back to the previous one).</div><div><br></div><div>It is not too onerous to workaround, though. We can simply change to use esp_partition_erase_range and esp_partition_write when targeting the factory. I will try to implement it that way tonight.</div><div><br></div><div>Regards, Mark.</div><div><br><blockquote type="cite"><div>On 25 Feb 2026, at 7:34 AM, Craig Leres <leres@xse.com> wrote:</div><br class="Apple-interchange-newline"><div><div>On 2/24/26 04:40, Mark Webb-Johnson via OvmsDev wrote:<br><blockquote type="cite">OK, I have just committed this. The two new commands are:<br>  * ota partitions list<br>  * ota partitions upgrade [-noconfirm]<br>Rollback is via:<br>  * wget http://api.openvehicles.com/firmware/ota/v3.1/main/<br>    partitions.bin <http://api.openvehicles.com/firmware/ota/v3.1/main/<br>    partitions.bin><br>  * esptool.py -p <path-to-usb> write_flash 0x8000 partitions.bin General approach to manual upgrade:<br> 1. Upgrade to firmware supporting this feature (3.3.005-711-g4feca695<br>    or later)<br> 2. Copy running ota firmware to factory<br> 3. Set to boot from flash and reboot<br> 4. Use â€˜ota partitions upgrade’ to upgrade<br> 5. Reboot<br>Items still to be addressed:<br>  * Documentation (including rollback procedure).<br>  * Modify partitions.csv to use this new format (when ready for<br>    production).<br>  * Web interface (in particular concept of factory vs ota), if<br>    necessary (haven’t checked this).<br>  * OTA flash builds. We will need a way to support 6MB builds for those<br>    that can use them. I suggest to change GetOVMSProduct() to return<br>    v3.5 for these modules that are running this new 6MB capable<br>    partition table. Then on server we can build a production release<br>    final 4MB firmware including this support, and then use v3.5 tree to<br>    build future 6MB only builds. The â€˜ota flash’ system would<br>    automatically support that and give people time to upgrade (as well<br>    as new users with 4MB partition modules for many months).<br>  * Investigate any simple way to make this a simple one-command<br>    (current ota->factory, boot factory, reboot, partitions upgrade,<br>    reboot).<br>For the moment, please try this out and let me know if you find any problems. We can then decide on the items still to be addressed.<br></blockquote><br>I took a run at this with my dev module:<br><br>    OVMS# ota<br>    Hardware:          OVMS WIFI BLE BT cores=2 rev=ESP32/3; MODEM SIM7600<br>    Firmware:          3.3.005-711-g4feca695-dirty/ota_1/main (build idf v3.3.4-854-g9063c8662 Feb 24 2026 15:08:43)<br>    Partition type:    v3-f12 (factory, ota1, ota2)<br>    Partition table:   0x8000<br>    Running partition: ota_1<br>    Boot partition:    ota_1<br>    Factory image:     3.3.005-20-g60be058e<br>    OTA_O image:       3.3.005-700-g0a804e40-dirty<br>    OTA_1 image:       3.3.005-711-g4feca695-dirty<br>    OVMS# ota copy ota_1 factory<br>    OTA copy ota_1 (08454144) -> factory (00010000) size 4194304<br>    Error: ESP32 error #258 starting OTA operation<br>    OVMS#<br><br>I couldn't find 258 so I internet searched it and learned that it is ESP_ERR_NOT_SUPPORTED (from components/esp32/include/esp_err.h, might be worth displaying in hex given that's how it's defined).<br><br>I checked and my esp-idf is up to date.<br><br><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>Craig<br><br>sea 12 % pwd<br>/home/sea/u0/leres/esp/esp-idf<br>sea 13 % git log | head<br>commit 9063c8662ca5d67b5490c1503bd4377b380feed3<br>Author: Michael Balzer <balzer@expeedo.de><br>Date:   Tue Jan 27 17:34:34 2026 +0100<br><br>    Fix mutex priority inheritance bug in spi_flash component:<br>      backport of esp-idf commit aea2fe08162e1ba86ad0189178c1f1cf29238bbd,<br>      see https://github.com/espressif/esp-idf/issues/5116<br>      and https://github.com/espressif/esp-idf/issues/7580<br><br>commit 75bdad1e05dbbfe2ef79e8398749ff6aaa7deb92<br>sea 17 % pwd<br>/home/sea/u0/leres/src/OVMS.V3<br>sea 18 % git log | head<br>commit 4feca695d922f26b5f3864fe43c6855b8f223675<br>Author: Mark Webb-Johnson <mark@webb-johnson.net><br>Date:   Tue Feb 24 20:21:30 2026 +0800<br><br>    Support for ota 0+1 partition table format, and 6MB firmware<br><br>commit 1241912b48628e89947e1600f86365b4b174c6c8<br>Merge: 92f93554 141bad50<br>Author: Michael Balzer <dexter@dexters-web.de><br>Date:   Sun Feb 22 15:57:13 2026 +0100<br><br></div></div></blockquote></div><br></div></body></html>