How to modify the total % of OnProgress ? (SOLVED)

Hi Class,

When I do OTA I see progress evolve in the serial monitor according to the code below:

// Callback - Progress
Update.onProgress([](size_t progresso, size_t total) {
Serial.print(progresso * 100 / total);
});

But the 100% is relative to the maximum size of the selected partition (in my case ESP DEV MODULE). This way when the count % is at 52% (relative size of my code) it's already finished. To be more correct, I would like 100% to be relative to the maximum size of my code, so the count would end at 100%. It's not important but I'd like to know if it's possible and how the code would look.

Thanks

progresso * 52 / total

Just set total to the full size of the sketch instead of the size of the partition.

Perfect
Worked well
Grateful

And is there any code snippet that shows me the size of the code in the serial monitor without having to compile ?

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