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...
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:
- 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.
- The device must first be programmed through USB with an OTA-compatible partition layout.
- After programming through USB it must be manually reset or power cycled to set the boot mode correctly.
- 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.
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.