Page 1 of 4
Update ESP8266 from SPIFFS file
Posted:
Fri Nov 04, 2016 7:56 am
by RichardS
If you have a .bin file in the SPIFFS file system that you want to upgrade the ESP8266 with... how can this be done?
I see a Update class... I see MD5.h.... in source codes for updates that typically occur over TCP/IP mechanisms and not direct from a file....
How to proceed?
RichardS
Re: Update ESP8266 from SPIFFS file
Posted:
Fri Nov 04, 2016 11:32 am
by mrburnette
I'm embarrassed to say that I have never done a WiFi OTA update, but the mechanism that allows the binary data to stream into flash surely should be capable of being "hooked" so that an existing SPIFFS binary file can be moved from one spot in flash to another (separate pages.)
So... are you thinking that you would have this binary waiting in flash and ready to pounce into action? Like an upgrade of capabilities after someone pays a fee to go from eval to commercial version? It is intriguing.
Ray
Re: Update ESP8266 from SPIFFS file
Posted:
Fri Nov 04, 2016 11:50 am
by rudy
With that ability the ESP8266 could be more like a computer, having the ability to run different application programs.
Re: Update ESP8266 from SPIFFS file
Posted:
Fri Nov 04, 2016 11:52 am
by martinayotte
Yes, it should be doable.
All OTA example in Arduino, either BasicOTA, or HTTPUpdater are using Updater as the base class.
All mechanism is based on an handler which receive the START/WRITE/END/ABORT status and the handler is calling Updater accordingly.
So, in theory, your handler should open the SPIFF file, query its size, pass it to Updater.begin(), then loop some Updater.write() until the end of file, and finally call Updater.end() when finished.