On Linux (presumably Mac too), the header of the library
could not be included, caps changed to match the filename.
The line 'architectures=ESP8266' in library.properties caused:
WARNING: library ESP8266httpUpdate claims to run on [ESP8266] architecture(s) and may be incompatible with your current board which runs on [esp8266] architecture(s).
I rewrote digitalWrite because the existing version was breaking
functionality as compared to how it behaves on the AVR,. specifically, I
could not use digitalWrite for a library that works fine on the AVR.
Instead I had to resort to fiddling with GPOC and GPOS and bit masks,
but this rewrite made all of that unnecessary, for whatever reason, it
just works better.
This version borrows a little from the AVR library in the sense that the
same logic is applied to determine whether a pin should be high or low
as the AVR version, and yes, it does appear to make a difference.
Because eboot first erases the space required for the new sketch, and
if the new sketch is larger then the old one, with the old way, part of
the beginning of new sketch will be deleted. Therefore for now I opted
to keep the max update size either half the available space for
sketches or what's left from the first one, whichever is smaller.
To be able to create a simple post mechanism for updates, I needed to
have a way to write the new binary, without knowing it's final size, so
I added an option to the end() method. Example in the WebServer
examples.
Proper error handling in the uploading python script
Much faster OTA example sketch with better results
New Update class that simplifies updating the firmware from any source
Updated Esp.updateSketch() to use the new class