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'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