Thank you, Michael.  I’m trying to test, but I’m having trouble getting <partitioning.htm> into OVMS/store/plugin.  Tried “curl”, but getting what appears to be a “security” error in accessing the source file.  Apologies if this is a naive error on my part.

Chip Cangialose

On Apr 30, 2026, at 2:20 PM, Michael Balzer via OvmsDev <ovmsdev@lists.openvehicles.com> wrote:

Everyone,

please test the attached upgrade UI draft in combination with the latest firmware changes (just pushed).

Install the development version as a web plugin for now (will be included as a standard page after collecting feedback):
  - Type: Page
  - Page: /dev/partitioning
  - Label: Partitioning (dev)
  - Menu: Config
  - Auth: Cookie

I've taken care to especially support the case of a failure in the store migration step. You can trigger that case by unplugging the module when in store migration.

There are now two options to recover from that situation without USB reflashing: retry the store migration or perform a factory reset.

The factory reset will automatically reboot into upgrade mode while running on the intermediate setup, and store2 will be erased to get a clean start. This should basically work in any case. The module will then boot into the upgraded system in setup mode, so the user can restore the backup or configure from scratch.

Retrying the store migration may be sufficient if the process was aborted due to some other issue (e.g. power loss), or if the user did a config restore.

Feedback is welcome.

Regards,
Michael


Am 28.04.26 um 19:22 schrieb Michael Balzer via OvmsDev:
Am 27.04.26 um 07:38 schrieb Mark Webb-Johnson:
OK, I’ve implemented by parts.

Firstly, I adopted Michael’s “-5” naming suffix on the version. So if you are running a production OVMS server, with firmware downloads enabled, then please make sure you enable the ‘-5’ variants (presumably with symlinks for the moment). My server has:

/firmware/ota/…

v3.0
v3.0-5 -> v3.0
v3.1
v3.1-5 -> v3.1
v3.2
v3.2-5 -> v3.2
v3.3
v3.3-5 -> v3.3

Similar on ovms.dexters-web.de now.

Later on (as 4MB firmware is obsoleted) we will have to stop deploying to the directories without the ‘-5’ suffix, but for the moment we can simply symlink them both together.

I am not happy with the implementation. Certainly not the most ugly code I’ve written, but it just seems messy at the moment. I did implement a FileWriter, which seemed neat as it simply records to disk and supports the command Writer interface - and even hooked it in so it correctly and neatly swaps from /store/… to /store2/… during the store migration. But it just doesn’t seem very elegant at the moment.

I see what you mean, but don't have a better idea yet. Maybe something like `GetPath()` & `SetPath()`?

I've added a log option, so we can monitor via USB, and also don't lose the output parts after unmounting /store2 when monitoring via USB.

I've also added a test command, which shows how slow the continuous close/open calls make this. Shouldn't matter for the update process, but if we're going to use this for other things, that needs to be optimized.

The other hacky ugly bit is doing this startup work in housekeeping. Seemed ok at the time, and really can’t find anywhere better (tried peripherals, but that was worse). It could be moved to MyOTA, I guess.

Done so. I also added a reboot on failures, as the module would otherwise need a manual reboot, and changed the main call to the locking version.

I've done a migration test run with these changes, will think about the UI next.

Regards,
Michael


It is complete, functional, and works on my test bench. But very open to anyone who can suggest / implement improvements.

OVMS# ota partitions list 
Partition table:
Label            Type Subtype         Address Size      
nvs              data nvs          0x00009000 16 KB
otadata          data ota          0x0000d000 8 KB
phy_init         data phy          0x0000f000 4 KB
ota_0            app  ota_0        0x00010000 7 MB
ota_1            app  ota_1        0x00710000 7 MB
store            data fat          0x00e10000 1984 KB
Digest:          520877a00f2b1f7506844246b950ab23 pass

OVMS# vfs df
/store:  Size:   1936 kB  Avail:   1800 kB  Used:   8%
/sd   :  Size:   3802 MB  Avail:   3787 MB  Used:   1%

Regards, Mark.

On 24 Apr 2026, at 6:33 PM, Michael Balzer via OvmsDev <ovmsdev@lists.openvehicles.com> wrote:


Am 22.04.26 um 08:22 schrieb Mark Webb-Johnson:
1) Making it simple
   1.1) Automate the steps
   1.2) Provide a user interface
   1.3) Module informing servers of status (so we can see progress)

2) 4MB vs 7MB firmware
   2.1) Server support builds
   2.2) Module downloads correct build
   2.3) Firmware fitting in the partition

3) Notifying users
   3.1) Developers
   3.2) End users

4) Versioning
   4.1) Firmware versions

5) Factory
   5.1) Factory production support

So let's look at each of these, and I make a proposal how to solve.

1) Making it simple
1.1) Automate the steps

The current approach is overly complex for non-technical end-users. They simply either won't do it, or will mess it up.

My suggestion here is to:

a) Introduce a new 'ovms partitions upgrade auto -noconfirm' command. This command will initiate a fully automatic upgrade.

b) At the ovms_partitions.{h,cpp} level, introduce a 'ovms_partition_table_upgrade' command that will look at the current state, perform the required actions, and reboot as necessary.

c) Extend boot.{h,cpp} to support a new BR_PartitionUpgrade boot state (used by ovms_partition_table_upgrade during reboot).

d) Extend the initial boot code so that if the BR_PartitionUpgrade flag is set then re-run ovms_partition_table_upgrade and only continue with the system init if that indicates failure.

I think in that way we can reduce the boot time (by not initialising modem, etc) and also avoid the SD CARD mounting issue. It would be one command the user runs, and monitors the output on USB console (or not).

My primary issue here still is most users won't monitor the process via USB, so will not be able to see or copy details of the process log in case something goes wrong.

OTOH, these users will need to reflash the module anyway in that case, catching the details would only help us in post-mortem analysis and maybe improving the process.

I expect corruption of /store to be the primary source of severe issues, and that would now (hopefully) be detected by the store migration step. The auto upgrade process could then do a store downgrade and set a config variable to reflect the abort cause (should do so as well on other issues encountered, so we can inform the user).


1.2) Provide a user interface

Presumably this could simply be done by the admin web interface. If the ovms_partition_table_get_type() is not OVMS_FlashPartition_35 (or perhaps introduce a new ovms_partition_table_isuptodate() call), then prompt to update.

I'll take care of that, extending this by the feedback about a failure of the process.

1.3) Module informing servers of status (so we can see progress)

In OvmsOTA::AutoFlash() we build the URL as api.openvehicles.com/firmware/ota + GetOVMSProduct() + tag + ovms3.bin. That GetOVMSProduct() is in ovms_utils.{h,cpp} and returns v3.0, v3.1, or v3.3.

In ovms_version.{h,cpp} it uses GetOVMSVersion() + " (build " + GetOVMSBuild() + ")" to build the version and set as m.version.

It seems that we can quite simply:

a) Change GetOVMSProduct() to return v3.5 for a v3.3 hardware running the upgraded partition layout.

b) Change ovms_version to add "product " + GetOVMSProduct() before the build in the version string.

The server would then receive that in the version string, and we could use it for status and statistical deployment purposes. I don't think it affects the buildverscmp() comparison.

That means we'd abandon the notion of the product code reflecting the hardware version, not sure about that: v3.0 & 3.1 modules could also be upgraded to the new partitioning.

Maybe we could rather add a minor version level or suffix for the new partitioning scheme:
  • "v3.3" = hardware 3.3, original partitioning
  • "v3.3.5" or "v3.3-5" = hw 3.3, new partitioning
That would work just as good for the server / build side differentiation, but keep hardware versions distinguishable.

2) 4MB vs 7MB firmware
2.1) Server support builds

We would need to add a v3.5 directory to the servers, and presumably do new nightly 7MB builds as well as a cut-down 4MB builds. These presumably would be simple and only have different sdkconfig files (plus perhaps a sanity check to ensure that the 4MB file is <4MB before deployment).

2.2) Module downloads correct build

The GetOVMSProduct() change in 1.3(a) above should resolve this.

2.3) Firmware fitting in the partition

This seems to have already been resolved in Michael's a5843037a503a61ec116e4ab46e05883545f7a48 commit.

Yes.

3) Notifying users
3.1) Developers

I suggest we prioritise developers to get this tested. Once the firmware is ready we can push on ovmsdev mailing list to deploy for wider testing.

I think we should release that on "edge", but first with an additional warning in the UI, that this isn't yet meant for end users ("proceed at own risk" + link to the factory reset guide).

When closing 3.3.006 we can remove that warning.

3.2) End users

I can think of two approaches:

a) A pop-up on web interface main screen if partition table upgrade is available.

b) Push notifications when they connect using the App.

Some users now only use V3 connections.

I suggest we generally send the push notification once after each OTA update, and additionally when an OTA update detects a firmware too large to be installable. That case wouldn't happen normally from an auto update applying the server directory scheme, but it will happen when users flash directly from a URL or a downloaded firmware, for example when told to try the current edge build.

4) Versioning
4.1) Firmware versions

If we follow the approach in 1.3 above, no change to current versioning scheme is needed.

There was a suggestion that once this is ready for production deployment we make that the 3.3-006 version.

I still think we should do so, as we're already close to the 4MB limit.

5) Factory
5.1) Factory production support

Once this is in production we would need to change the default partitions.csv to reflect the new arrangement, build new production firmware, and release to factory.

I am happy to do 1.1, 1.3, 2.1 (for api.openvehicles.com), 2.2, 3.1, 4.1, and 5.1.


I've done 2.3, will audit 1.1 when ready, will do 1.2 once the feedback variable has been defined, and 2.1 for ovms.dexters-web.de once we've agreed on the version scheme.

Regards,
Michael

-- 
Michael Balzer * Am Rahmen 5 * D-58313 Herdecke
Fon 02330 9104094 * Handy 0176 20698926

_______________________________________________
OvmsDev mailing list -- ovmsdev@lists.openvehicles.com
To unsubscribe send an email to ovmsdev-leave@lists.openvehicles.com


-- 
Michael Balzer * Am Rahmen 5 * D-58313 Herdecke
Fon 02330 9104094 * Handy 0176 20698926


_______________________________________________
OvmsDev mailing list -- ovmsdev@lists.openvehicles.com
To unsubscribe send an email to ovmsdev-leave@lists.openvehicles.com

-- 
Michael Balzer * Am Rahmen 5 * D-58313 Herdecke
Fon 02330 9104094 * Handy 0176 20698926

<Bildschirmfoto vom 2026-04-30 21-47-17.png><Bildschirmfoto vom 2026-04-30 22-07-17.png><partitioning.htm>_______________________________________________
OvmsDev mailing list -- ovmsdev@lists.openvehicles.com
To unsubscribe send an email to ovmsdev-leave@lists.openvehicles.com