Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Mmiscool
#27984 Hello.

I am very interested in using ota as a method of flashing.
Specificaly i would like to have the esp have a setti gs page that has a button on it that when clicked will have the device download the update from a server and wite it to the correct flash location.

Is this possible for the device to request the update or must it be pushed to the device. Any information on this would be helpfull.

Thank you. :-)
User avatar
By zeroK
#29515 HI,

I just implemented the OTA from the github example where you can use the Arduino IDE to do a wireless upload.

You need the staging version I think:
https://github.com/esp8266/Arduino/

I used this example:
https://github.com/esp8266/Arduino/tree ... rduino_OTA

There is also an httpUpdate example somewhere. Here you can store your binary image on a webserver "example.com/image.bin". I tried it but it does not work reliably 1/5 it is successful.

Code Snippet:
Code: Select all#include <ESP8266httpUpdate.h>

....

t_httpUpdate_return  ret = ESPhttpUpdate.update("example.com", 80, "/image.bin", "");
      switch(ret){
        case HTTP_UPDATE_FAILD:
        Serial.println("HTTP_UPDATE_FAILD");
        break;
       
        case HTTP_UPDATE_NO_UPDATES:
        Serial.println("HTTP_UPDATE_NO_UPDATES");
        break;
       
        case HTTP_UPDATE_OK:
        Serial.println("HTTP_UPDATE_OK");
        break;
      }