Hello everyone, I have been working on a project that includes a microdot web server on an ESP32.
Is still a work in progress but I would like to start freezing some binaries with all the files in it (.html , .js , .css . json).
I already try with data_to_py.py (https://github.com/peterhinch/micropyth ... a_to_py.py) but the files size go way up. Also try to unpack a .tar file with everything in it but I still need to put the file manually.
For now the best solution that I find is the microfreezer tool (https://github.com/insighio/microfreezer) but I need to modify the microwave.py and the files folder to work in a micropython 1.16.
Anyone knows a better way to put all the files in a single bin image.
Here is my project if you want to read the code.
https://github.com/facuver/iSpindel_Repeater
Thanks in advance.
Freeze web files
Re: Freeze web files
=
In which case maybe it would be easier to just make a firmware image that instead of just including the MicroPython firmware, also includes the full device filesystem.
For background -- when you flash micropython.bin to your ESP32, it just writes the first section of flash, leaving the rest of the flash untouched (and this is where teh filesystem lives). But nothing stops you making a single .bin file that contains the entire flash.
By far the easiest way to do this is to set up a device exactly how you want it, and then use esptool.py to download the flash back to your PC.
Is your goal to just be able to create a single firmware image for your device that includes everything?facuver_26 wrote: ↑Wed Jul 07, 2021 12:52 pmAnyone knows a better way to put all the files in a single bin image.
In which case maybe it would be easier to just make a firmware image that instead of just including the MicroPython firmware, also includes the full device filesystem.
For background -- when you flash micropython.bin to your ESP32, it just writes the first section of flash, leaving the rest of the flash untouched (and this is where teh filesystem lives). But nothing stops you making a single .bin file that contains the entire flash.
By far the easiest way to do this is to set up a device exactly how you want it, and then use esptool.py to download the flash back to your PC.
-
- Posts: 3
- Joined: Sun Nov 22, 2020 5:11 pm
Re: Freeze web files
Thanks, I will try that.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Freeze web files
The data_to_py library converts arbitrary data to Python source. This does increase file size. The library's aim is to reduce RAM usage. Converting to Python only makes sense if you freeze the resultant Python code as bytecode. The data can then be accessed directly from flash with minimal RAM usage.facuver_26 wrote: ↑Wed Jul 07, 2021 12:52 pm...
I already try with data_to_py.py (https://github.com/peterhinch/micropyth ... a_to_py.py) but the files size go way up...
If you need to minimise space in your filesystem I'd look at traditional compression techniques.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.