flowshutter
flowshutter copied to clipboard
[New Feature] OTA support
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.
- [x] Support AP mode and an option to enable/disable it on running https://github.com/gyroflow/flowshutter/pull/28 https://github.com/gyroflow/flowshutter/pull/29
- [x] Allow user to type ssid and password in this AP web, later update the content to wlan.dat file https://github.com/gyroflow/flowshutter/pull/60 https://github.com/gyroflow/flowshutter/pull/65
- [x] Allow user to select source and channel when connected https://github.com/gyroflow/flowshutter/pull/61
- [ ] Add an "OTA update" menu after the channel menu
- [ ] Clean those repos up
Below is my proposed OTA mechanism/process:
- When the user set "check update", ESP32 firstly download a
sha.jsonfrom 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
/tmpdirectory - 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
/tmpto.
- If there are fields with the same file name in the two jsons, check the corresponding sha1.
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?