One of the things missing is the bms averaging stuff. I started it but a house move and stuff got in the way... but yeah if someone wants to try I'll get onto that bit!
So extending the partition size to 6 MB will buy us quite
some time.
Regarding Javascript/DBC vehicles, Michael Geddes' work on this is
quite advanced, and really needs some tester now trying to implement
an actual vehicle, to see what's missing.
Regards,
Michael
Am 08.12.25 um 07:01 schrieb Mark
Webb-Johnson via OvmsDev:
Michael, Carsten,
I think that if targeting things to cull, we would need to be
balance size vs importance. For example, the RE tools mentioned
is just 10KB total size. By comparison TPMS is 9KB, and web
server is 538KB.
We learned with OVMS v2 that the biggest culprits in the
long-run are always the vehicle modules. The core system stays
pretty stable, but the space required for *all* vehicle modules
grows with the number of vehicles supported.
I don’t think we can simply switch to 32MB flash, as that
would abandon the existing users. We would also need to source a
standard certified 32MB module (which I don’t think Espressif
offer themselves).
Looking at the partition table:
# OVMS 16MB flash ESP32
Partition Table
# Name, Type, SubType, Offset,
Size
nvs, data, nvs, 0x9000,
0x4000
otadata, data, ota, 0xd000,
0x2000
phy_init, data, phy, 0xf000,
0x1000
factory, app, factory,
0x10000, 4M
ota_0, app, ota_0, ,
4M
ota_1, app, ota_1, ,
4M
store, data, fat, ,
1M
Assuming we could (and that is a big assumption given our
older SDK) change that at runtime, then a possible migration
path could be:
Have our code support both old and new partition table
formats, and refuse to update to old format if firmware >
4MB. Get that code out into the hands of users.
Provide a migration tool for partition table:
Copy running code to factory (from ota_0 or ota_1,
whichever is current).
Reboot
Change partition table (most likely replacing the entire
table with a binary blob of the new format)
factory 4MB -> ota_0 same offset, 6MB size
ota_0 -> ota_1 6MB offset, 6MB size
Change boot to ota_0.
Reboot
Liase with factory so new modules use new partition format
(and ship with firmware that supports it).
Wait a reasonable time for users to update before
releasing any firmware > 4MB.
That would work more similarly to other more modern ESP
frameworks which don’t bother with ‘factory’. It would allow us
another 50% expansion. But it does run the risk of bricking
(requiring espflash to recover) during the process.
But longer-term, the solution to me seems to be to allow the
vehicle module code to overlay - so only the single vehicle you
choose is loaded. And (absent any dynamic linking of modular
code in freertos), the only straightforward way of doing that I
know of is migrating vehicle support to Javascript (which comes
along with a host of other advantages - most notably not having
to be a C++ embedded developer to add/refine vehicle support).
It was to be expected that we would eventually
run out of flash storage. That’s why I would
immediately question whether we should detach
ourselves from components that aren’t really being
used. We could even start a survey or something like
that.
For example, the RE tools — the idea behind them
is great, but without documentation they’re not easy
to use, and every time I tried to work with them, it
just resulted in crashes.
Then there’s the question of who actually uses
Telnet, SSH, the Duktape framework, the DBC parser,
OBD2ECU, or CANopen (yes, the Twizy integration is
the only one that uses it).
All great ideas, but in the end, how many users
really make use of them?
The fewer active components we have to maintain,
the ‘easier’ it would also be to port the code to a
more current ESP-IDF version — and that would bring
significant benefits such as improved networking
features, including firewall capabilities and a much
more stable switching between LTE and Wi-Fi. I’ve
looked at llanges attempts and it’s extremely tough.
As an example, in my own custom firmware builds,
I don’t enable the components (and of course not all
vehicles, so not 100 percent representative)
mentioned above. This requires small modifications
in the code because, for example, the ESP logger is
missing but referenced in another file, etc. But my
firmware file is only about 2.8 MB.