I was able to fix the issue by editing the boards.txt file and adding the following lines:
lolin32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
This will add a "Huge APP" partition scheme to WEMOS ...
The basic problem is that when you upload over OTA you don't upload the partition structure.
The ESP32's flash is split into a number of "partitions" or areas. It might look something like:
|BOOT|P|OTA Program 1|OTA Program 2| SPIFFS |
0x1000 is the "second stage" bootloader. This is the code that is responsible for loading the code according to the layout specified in the partition table.
In ESP-IDF, the binary image which resides at offset 0x1000 in flash is the second stage bootloader. Second stage bootloader source code is available in components/bootloader directory of ESP-...
The boards.txt file configures what can be configured in the Arduino IDE for each board.
On my installation, this is found at
I found the section esp32cam.name=AI Thinker ESP32-CAM and changed the lines:
As stated in the comments by @Codebreaker007 using the ESP32 Wrover Module works and if you put the pin definitions inline in the app there isn't a problem
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
You do not have to go through the hassle with editing the boards.txt if you want to have OTA only if you do not need it or you want a custom partition scheme.
That said the OTA partition is always what is left so e.g. Med Spiffs App 1.9MB, Spiffs 190KB means 1.9 MB OTA partiton.The caveat is if you want to OTA a 1.8 MB App with 1 MB Spiffs that will NOT work....