Arbitrary file in the FS

  • Is it possible to include arbitrary file in the File System located on the Flash during firmware build process?

    In my case I would like to include json file with config parameters of my application.

    I tried to put it into "esp32/frozen" as "_config.json" but it did not make it into the built firmware. This folder is probably intended only for Python scripts.

  • @robert-hh
    I was thinking about that however I am not aware of a straightforward way how individual parameters could be updated by the application. The script would be frozen anyway.

    I was also thinking to move all parameters to NVS however the config also contains few strings which are not directly supported by the NVS right now.

    I think that the best solution will be to put default parameter values into Python script which will be frozen during build process. After boot it will be tested if NVS contains "init" flag and if not an initialization method will be called. Within this method individual parameters will be loaded from Python script to a dictionary which will then be dumped into json file stored in the internal file system. This will happen only during first boot after last firmware flashing.

  • @danielm You could put you config parameters in a Python script and just import it.

Pycom on Twitter