OTA upload only works once.... why?

When i program my ESP32 WROOM 32 clock with ArduinoOTA/examples/OTAWebUpdater (over the USB) and reboot it i can acces it in my browser with 192.168.178.101... enter name and password, select a bin file (in this case the same OTAWebUpdater, only changed the color for the requester) and update it, the file is tranfered 100% within a few seconds.. but when i repeat that it will only be transfered for about 60% . The ESP32 does a reset and starts the old program (with the old gray color). So the update is not done.
As the OTAWebUpdater uses 60% of program storage, i think it will try to upload in what is left of program memory before that will be activated. That might explain why i can't upload a program for the second time.
Am i right or is there something else, and more important: How can i solve it?

What is the big picture? Why the repeated updates?......

BugFixes, add new features etc...
This repetative uploads are just for testing as i encountered the problem when i wanted to upload a improved version of the clock-program..
First i thought i might have corrupted something but i didn't change much, just one value... The problem is that i have to dismantle the clock to access the programming-plug, hang it on my computer and upload the code..
The code is mine and i don't want to spread it (commercial)
As there are some of these clocks spread over the world, it would be nice if i could send a binairy file that can be uploaded from the computer .

If you suspect that your code is too large to be uploaded OTA, you can verify your suspicion by learning more about partitions. Read this:

https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/tutorials/partition_table.html

One example from the above link:
image

In this example (which may not match the scheme you've selected), sketches must be smaller than 1900 KB.

1 Like

Thanks for the answer. I have read it. There should be 2 "buffers" app0 and app1. Once a program is uploaded in "buffer" app1 succesfully, it will be written in app0, that is what i made of it
The ESP32 i have should be 8MB.
The bin-file i want to upload is only 786kB
This is the bin i created from the OTAWebUpdater.ino which is included as an example in the ArduinoOTA librairy.
Compiled in IDE it says:
Sketch uses 798621 bytes (60%) of program storage space. Maximum is 1310720 bytes.

Still not able to upload a second time...

Post a screenshot like this, showing your selections:


I think i found something: The watchdogtimer was still running in the background, appearently. This force a reset after 8 seconds no "heartbeat" ... Now, as soon as the upload starts i delete the watchdogtimer-task and on it goes.
So i guess this is solved... Now i have to scratch my head over all problems with board and librairy updates...
Thanks anyway :slight_smile:

I would be surprised if you can do OTA with that partition scheme. I believe you need to select a partition scheme that include the words "with OTA", such as the red-circled one in the snip below. If it doesn't say "with OTA," you only get one app "buffer," and you need two for OTA (which is what you get if you select a scheme that includes "with OTA".)

That shines a completely new light on it: With that scheme i have no problem uploading the program.. Will see what it does when i select the one you propose..
...........
Well after compiling i have only 42% used (Was 68%). Uploaded the program over OTA: the clock works and i can also re-upload another program..
(in fact the same as with my default 4MB with SPIFFS)
I will keep this setting for now... there is still a lot to learn, i notice :wink:

It looks like the "default 4MB with SPIFFS" scheme does indeed include two app partitions (so, the name in the IDE is incomplete/misleading).

From the link in #4:

from boards.txt...
image

from https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv
image

0x140000 = 1310720 bytes

Minor bug :sweat_smile:
Better that it does more than told...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.