ESP8266/ESP32: inplace firmware upgrade using the image file stored on the file-system
In practice, it would be very useful to be able to upgrade firmware in place using the firmware image file on the file-system. In fact, all mobile devices (like smartphones), IoT devices (like routers, robot cleaners, smart fans and smart lights), can do firmware upgrade from the firmware image file that is downloaded from the cloud and stored on the file-system.
Thanks to @yaota8266, that ESP8266 MicroPython does have the OTA build, however, it is not very useful but very restrictive. In particular, it requires you:
- to press some button to start upgrade. So if the device is installed on the ceiling fan, ceiling light, or inside some big box appliance, it is very inconvenient to start firmware upgrade
- to set Wifi credentials into his system which should be handled by the software web server part, instead of the OTA module (quite a lot of redundancy)
- Moreover, it has to pre-allocate 2 big flash spaces for the firmware, where only 1 is active at a time. This wastes too much executable flash space (only the 1st 1MB). As MicroPython grows bigger with more functionalities, 1MB cannot fit 2 copies very soon.
Therefore, the most useful way of doing OTA is to do firmware upgrade from the internal flash storage file-system, triggered by calling a function or upon system reboot.
Question: Prepoluate file system on an ESP8266
Hello, this is less an issue but a support request maybe also for some additional documentation.
I'm currently building my custom esp firmware with some extra modules (because of heap issues). I would like to make it as simple as possible later to run my software so I thought that it should be possible to add the main.py (or any other additional file) already inside the firmware. So that later the user has only a single step to get my software running, instead of four or five.
I see that the _boot.py is somewhat executed and copied into the file system. The question for me now is: How can I get this done for other files? Thank you already for any help--