I was wondering if we have to partition our esp8266 ota code into an “OTA Mode” and a “normal mode” as described at 2:20 of this video or is this obsolete?
If yes, could someone explain why and also as far as implementation would I just have a variable (boolean maybe) connected to a button widget that send the device into a OTA mode? Maybe an if statement surrounding ArduinoOTA.handle(); possibly?
Just starting with this OTA stuff and already a bit confused so any clarification is much appreciated
Thanks for the info, I am no longer just using the basic OTA sketch now though, I integrated the OTA operation into my full sketch which has many other parts (I parsed the OTA portion from a Blynk forum post and combined with my existing sketch).
I notice that when I try to upload OTA, it gives an error. And yes I did power down the board after the serial flash
Sketch uses 257091 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 35824 bytes (43%) of dynamic memory, leaving 46096 bytes for local variables. Maximum is 81920 bytes.
So I don’t think that is the issue (I also tried a much simpler program and had similar issues). I wouldn’t mind having a blynk button widget that throws it into OTA new firmware listening mode just wondering if it is necessary and if so, a few ideas on how to go about it
I will try both of those. If they do work will this have any affect on the speed of my program (wifi wise)? And also will it continually poll for a new update so new firmware can be uploaded at any time??
Okay that seems to work now, thank you for the help.
Can you (or anyone) answer these questions? Is there also any reason not to use a dedicated button? Other than the fact I am not 100% on implementation yet… (other than just having a button widget control when to go into a method/function that contains all of the OTA stuff)