-->
Page 1 of 3

How dose the OTA work?

PostPosted: Mon Sep 07, 2015 12:53 am
by Mmiscool
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. :-)

Re: How dose the OTA work?

PostPosted: Sun Sep 20, 2015 2:55 am
by Mmiscool
Bump. Any help please.

Re: How dose the OTA work?

PostPosted: Sun Sep 20, 2015 2:24 pm
by zeroK
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;
      }

Re: How dose the OTA work?

PostPosted: Sun Sep 20, 2015 2:44 pm
by freedom2000
I also found this : http://www.wemos.cc/d1/Wireless_Upload

But I didn't test it...

JP