I would like to use OTA in some of my less accessible esp's. I am using the examples/BasicOTA and BasicOTA_test. My esp is a -01 model with 1Mb of flash.

I upload the BasicOTA to my esp through the COM port, then upload the BasicOTA_test over WiFi. Everything appears to go OK, but the test sketch doesn't run until I press reset on the esp.

If I upload BasicOTA over the com port then upload a simple blink sketch over WiFi without the OTA code, it uploads fine then runs without a reset. But then, I can't upload over WiFi anymore.

If I have to hit reset every time I upload a new sketch that contains the OTA code, then why bother?

Tips would be appreciated.

  • Why bother? it's still FAR easier to power cycle an installed device than it is to wire uart to a built-out thing... fwiw, this doesn't seem to happen each time anyway; i suspect it happens most upon the first OTA. – dandavis Sep 4 '17 at 20:16

You can add ESP.restart() in the following line to make it restart.

ArduinoOTA.onEnd([]() {

Now you can upload code each time without hitting reset.

  • the ArduinoOTA library does the reset. but who knows now what was the state of the library in 9/2017 – Juraj Feb 22 at 10:50

I've done some research and this appears to be a common problem while using OTA to update the ESP8266. In fact, this bug has been reported on their GitHub and it's due to the watchdog timer resetting after the ESP8266 is flashed via OTA.

It appears the problem can be solved by manually resetting (once) after you upload it via serial BEFORE you can upload it via OTA. After that, you shouldn't have any problems.

  • That is a different issue, that issues is when you have to reset before upload via OTA. OTA not running the new sketch untill after manual reset as described above is another. Did you solve both? – AndrewT Dec 7 '18 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.