Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By acca
#38752 Yes i have tested various OTA sketches and there is no problem connecting to wifi.

I have to restart windows to see ota port in arduino IDE.

If i restart windows, i see ota port, if i select COM port and restart IDE, i don't see OTA port anymore.
User avatar
By Maxi Belino
#40908 Hi,
I've done OTA (Classic) without problems! excellent! 8-)

Now i will move to Arduino 1.6.7 to try ArduinoOTA and use "BasicOTA.ino".

I want to use OTA for my sketches, so my question is, will i have to use the code in BasicOTA.ino ? or BasicOTA has more code than i need? (i would like to have the minimum code for re use it)

(sorry if my question is duplicated, i didn't find the answer for the ArduinoOTA method and not really tested yet)

Thank you very much!
Maxi
Last edited by Maxi Belino on Thu Feb 11, 2016 11:41 am, edited 1 time in total.
User avatar
By krzychb
#40918 Hi Maxi,

You can treat BasicOTA.ino as an initial template that covers typical application.
Then just add or remove OTA functionality depending on specifics of your application.

For instance, if you do not need to visualize OTA progress, you can remove onProgress(OTA_CALLBACK_PROGRESS(fn)) event.
To improve security I would add setPassword(const char* password).
If you do not care about reason of possible OTA upload failures, you can even ditch onError(OTA_CALLBACK_ERROR (fn)) :shock:

As a matter of fact you can remove OTA at all as the last step of your application development, if you are not planning to perform frequent code updates and occasional upload using a serial cable will not be a pain :D

You can check sample implementation tutorial of OTA to an existing application here

I am also a big fan of OTA because it is far quicker and convenient comparing to serial cable :D


Krzysztof