Skip to content

Commit c2f68ba

Browse files
author
Eric Thieme-Garmann
committed
update progress on display
1 parent bf72916 commit c2f68ba

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
176 Bytes
Binary file not shown.

variants/sensebox_mcu_esp32s2/APOTA.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,14 @@ void setupOTA() {
220220

221221
if (upload.status == UPLOAD_FILE_START) {
222222
Serial.setDebugOutput(true);
223+
size_t fsize = UPDATE_SIZE_UNKNOWN;
224+
if(server.clientContentLength() > 0){
225+
fsize = server.clientContentLength();
226+
}
227+
Serial.printf("Receiving Update: %s, Size: %d\n", upload.filename.c_str(), fsize);
228+
223229
Serial.printf("Update: %s\n", upload.filename.c_str());
224-
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
230+
if (!Update.begin(fsize)) { //start with max available size
225231
Update.printError(Serial);
226232
}
227233
} else if (upload.status == UPLOAD_FILE_WRITE) {

0 commit comments

Comments
 (0)