0

I'am asking this question, because in my ESP-01 OTA upload always fail. In fact update won't even start. When update was triggered esp wifi led(build in blue) indicates "working" , but after cca one second esp reset itself. And The original program remains and starts again...

4
  • what Flash size did you select in Tools menu?
    – Juraj
    Oct 17 '20 at 10:21
  • 1MB(FS:none, OTA:~502KB).... according as I read in tutorial, that OTA has to be at least half of memory for propper running...
    – Sahasrar
    Oct 17 '20 at 11:35
  • try to turn off firewall on PC
    – Juraj
    Oct 17 '20 at 11:52
  • I tried, but with no effect...
    – Sahasrar
    Oct 17 '20 at 13:07
3

Yes, 1MB is fine for OTA. There are, though, a few caveats when working with OTA that you must observe regardless of the flash size:

  1. The maximum OTA program size is less than half the available flash size. Typically it is about 500kB. Two copies need to be stored in flash, plus the partition table and NVRAM. The rest of the flash on larger chips is most often dedicated to FS storage.
  2. The device must first be programmed through USB with an OTA-compatible partition layout.
  3. After programming through USB it must be manually reset or power cycled to set the boot mode correctly.
  4. You can not change the partition layout over OTA programming. You need to make sure you have the same partition layout selected as when you originally programmed through USB.
  5. ArduinoOTA.handle(); has to be called very regularly to handle the programming request. You can't have any blocking code in your sketch that might stop that from being called.

Observe all those and you should be able to program over WiFi with no problems.

5
  • I programmed it via USB, program works, OTA was shown in Tools>port options. Program still running... LED blinking... But when I press Upload code to device via OTA port ESP freeze and after few second IDE report error: No Answer, but very strange thing is that original program crashes and esp is unprogrammed... Than i have to upload code again with USB
    – Sahasrar
    Oct 17 '20 at 18:57
  • And have you taken point 5 into account?
    – Majenko
    Oct 17 '20 at 18:58
  • every point of your advice is fulfilled... My code is about 210 KB
    – Sahasrar
    Oct 17 '20 at 18:59
  • In my void loop is only ArduinoOTA.handle(); no more rows...
    – Sahasrar
    Oct 17 '20 at 19:00
  • @Sahasrar, point 3.?
    – Juraj
    Oct 18 '20 at 5:29
-1

Yes. 1 MB flash is enough for OTA update.

1
  • This has already been pointed out in the very first sentence of the existing answer. Oct 18 '20 at 10:41

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.