I now have a solution that will do this "automatically"MostlyHarmless wrote: ↑Wed Dec 04, 2019 9:55 pmIt will help to divide the code into "stable" and "volatile" modules. The stable parts would be deployed as frozen modules (hard to update), the volatile parts would be precompiled .mpy file (slightly easier to update).
Because now i have two kinds of OTA updates... I call it "hard" and "soft":
- The 'soft' OTA is my still existing pure micropython solution
- The 'hard' OTA is via yaota8266 bootloader that will replace the complete firmware
So it's possible to compile and freeze a new firmware and flash it. If i now start my "soft" OTA it will only upload missing files, like *.html and *.css etc.
If i then change one of my python files, it will upload it as compiled .mpy file.
This is possible, because i save the information about the frozen modules in a simple tuple list that looks like this:
Code: Select all
FROZEN_FILE_INFO = (
('http_send_file.py', 1121, '4f19032f29ef4dad0d72d761b710b24926c1ca3645ea02f9e17f0acf2a5d4acf'),
('http_set_dim_level.py', 1239, '431c02802acc39b92518f76b463c031e437406e06f9047f1c4490bf28392a61c'),
('reset.py', 931, '6e6584df3e04fab341c93970b931b6d4f045653c139bf19161a1af030ce683d3'),
...