Where are files stored when building micropython and freezing modules? #12094
-
Hello! I am trying to freeze my project into micropython. This is part of my project structure:
the modules are copied fine, but my main.py imports the config.json. This now fails with |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
When freezing, no file system is created. Only .py files are frozen in to the firmware image and being stored in a special data structure. The json file and other file types are ignored. |
Beta Was this translation helpful? Give feedback.
-
I wrote this utility program that I use to freeze html, css, json, image, etc files to a .py file. I add these .py files to the manifest.py to be frozen in the MicroPython image. On import, the file structure gets mounted as a read only file system on the microcontroller. For read-write files, the file structure can get deployed (copied) to the controllers flash. I have done testing and it's in active use, but probably more testing may be necessary. If you use it, I'd be very happy to get feedback. Here is the link: https://github.com/bixb922/freezeFS/tree/main |
Beta Was this translation helpful? Give feedback.
-
Peter wrote a script for doing this: https://github.com/peterhinch/micropython-samples/blob/master/data_to_py/data_to_py.py |
Beta Was this translation helpful? Give feedback.
I wrote this utility program that I use to freeze html, css, json, image, etc files to a .py file. I add these .py files to the manifest.py to be frozen in the MicroPython image. On import, the file structure gets mounted as a read only file system on the microcontroller. For read-write files, the file structure can get deployed (copied) to the controllers flash. I have done testing and it's in active use, but probably more testing may be necessary. If you use it, I'd be very happy to get feedback. Here is the link: https://github.com/bixb922/freezeFS/tree/main