Advantages and Disadvantages of OTA Upload

this feature by no means is new, is more than 1 year old.

here are the latest docs for esp core:
http://arduino-esp8266.readthedocs.io/en/2.4.0-rc1/ota_updates/readme.html?highlight=ota

and in arduino ide > file > examples > arduino ota you find the example sketches.

the minimal sketch for ota update is:

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>

const char* ssid = "..........";
const char* password = "..........";

void setup()
{
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  ArduinoOTA.begin();
}

void loop()
{
  ArduinoOTA.handle();
}

the first “ota” sketch you have to upload via usb, after that you have to restart the esp (plug out the usb cable then back). also, i observed that if i restart the ide, it will detect faster the new esp network port (in tools > port).

than, if you include the above code in your sketch, you can upload ota as many times as you wish!

after reading the docs and study the example sketches, feel free to experiment, you can not break anything. and if you have any issues you can not find in the docs, ask!

1 Like