Shrink image size #39
Labels
No labels
bug
documentation
duplicate
enhancement
help wanted
invalid
question
v0.1.x
v0.2.x
v0.3.x
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#13 [Webserver:WebUI] Rework WebUI in Javascript with REST API
DeltaLima/CanGrow
Reference
DeltaLima/CanGrow#39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ESP32-C3 cannot upload new firmware .bin because it got too large. Uploading by USB works fine so far
partition schema has to be changed to 2mb
Convert file (best gziped) to C Array, which can be directly used within the code base
xxd -i file.htmlmaybe making custom esp32 partition schema is enough too, see https://thelastoutpostworkshop.github.io/microcontroller_devkit/esp32partitionbuilder/
arduino-cli change partition schema https://github.com/arduino/arduino-cli/issues/698
I think there is a ton of stuff which can be easely put into javascript. Also, there is a lot of stuff, which can be put into PROGMEM variables to get re-used, like some very common html tags:
its a LOT
also .css and .js files should be minified and gzipd. this will also save some kb. put the .gz into a variable with
xxd -iESP32-S2 has no problem,. the firmware fits within the available space, 94% used
https://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript
https://stackoverflow.com/questions/11985156/clone-div-and-change-id
minimized and compressed javascript and css file. also began to use TinyJS https://github.com/victorqribeiro/TinyJS to reduce javascript code to write.
Todo are the grow and system pages have to be remade in javascript
About 4KB of just cutting html strings together
Plus what I have all in PROGMEM in the
_HTML.hfiles I guess this would be a very worthy work to put all those into javascript to save up space on the flash.With the work already done, ESP32-C3 is still unhappy :(
https://johnmu.com/2024-esp32-partition-update/
https://github.com/softplus/Esp32Repartition
i figured out how to change the partition schema with
arduino-cli: https://codeblog.dotsandbrackets.com/arduino-cli-partition-scheme/I chose for esp32 the "min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)" schema from the esp32 arduino-core package.
Added to
cangrow.shwithc06b75c8f0Now the image size can be up to 1.9MB, and space for LITTLEFS is now 190kb, which should be enough
Now all images are building fine and can be updated OTA
The main problem, the image size itself, is solved with using the min_spiffs partition schema.
So this ticket is closed. the WebUI Javascript rework stuff will be followed issue #13 .