[New Feature] OTA support
DusKing1 opened this issue · 2 comments
DusKing1 commented
There should be an "Update via OTA" option in the firmware, so for ppl who don't wanna mess with the code environment can just update the firmware in an easier way.
The whole workload around this feature is too heavy that I think I can't finish it in one day or two, so just try to set up a simple road map for OTA feature here.
- Support AP mode and an option to enable/disable it on running
#28
#29 - Allow user to type ssid and password in this AP web, later update the content to wlan.dat file
#60
#65 - Allow user to select source and channel when connected
#61 - Add an "OTA update" menu after the channel menu
- Clean those repos up
DusKing1 commented
Below is my proposed OTA mechanism/process:
- When the user set "check update", ESP32 firstly download a
sha.json
from the repo and store it astmp_sha.json
- diff the MD5 result of
sha.json
(in the ESP32) andtmp_sha.json
- If the same then no change, else look into the content:
- If there are fields with the same file name in the two jsons, check the corresponding sha1.
- If they are the same, they do not need to be updated.
- Else if they are different, they need to be updated (overwritten), add to them to the delete list and download list.
- Else if there is a file name that does not exist in
tmp_sha.json
, the corresponding file needs to be deleted, add it to the delete list. - Else if there is a new file in
tmp_sha.json
, the file needs to be downloaded, add it to the download list. - Then download files in the download list and store them in
/tmp
directory - After the download is finished, OLED tells the user "please reboot to update".
- During update, delete files in the delete list, move all files in the
/tmp
to.
- If there are fields with the same file name in the two jsons, check the corresponding sha1.
oddwatcher commented
Hello! I've Working on a similar porject as yours using esp32-c3 , i saw your code is written in python, Should the framework of this project micropython?