Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By gambituk
#49271 Hello, I've followed the tutorial http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html which is reasonably easy to follow. But i have a question regarding the sketch to use as an update.

in the tutorial it says:
Note: To be able to upload your sketch over and over again using OTA, you need to embed OTA routines inside. Please use DNS_SD_Arduino_OTA.ino as an example.


Which is fine, but i cannot see if all of the example sketch is required? what can be removed aside from the obvious...?



I guess the tl/dr is:

What is the minimum ota routines i need to add to my sketch to make it continue to be ota compatible, and can anyone share examples that they have working with ota included! :D


Thanks in advance for any and all suggestions
User avatar
By gambituk
#49282 That's more digestible, the mDNS example i guess is older, i've integrated the ota into my sketch and it uploads without problems now! :lol:

Thanks for the pointer!
User avatar
By buchacho
#53008 Should you have some kind of flag or switch to get the device into OTA mode to integrate into a sketch? I saw a couple youtube vids that either use either a physical switch or some flag through a web interface. Right now I am interested in using OTA during development so I can flash from the IDE like I do via usb, but at any time without having to touch the ESP module or remember to flag something.

https://youtu.be/GoQXOLB50HA