This commit is contained in:
Brendan O'Leary 2025-12-17 20:42:42 -05:00
parent abb3dc3d43
commit 71fc35845b
3 changed files with 28 additions and 25 deletions

View File

@ -521,7 +521,8 @@ void CrossPointWebServer::handleUpload() {
if (written != upload.currentSize) { if (written != upload.currentSize) {
uploadError = "Failed to write to SD card - disk may be full"; uploadError = "Failed to write to SD card - disk may be full";
uploadFile.close(); uploadFile.close();
Serial.printf("[%lu] [WEB] [UPLOAD] WRITE ERROR - expected %d, wrote %d\n", millis(), upload.currentSize, written); Serial.printf("[%lu] [WEB] [UPLOAD] WRITE ERROR - expected %d, wrote %d\n", millis(), upload.currentSize,
written);
} else { } else {
uploadSize += written; uploadSize += written;
@ -531,7 +532,9 @@ void CrossPointWebServer::handleUpload() {
unsigned long timeSinceLastWrite = millis() - lastWriteTime; unsigned long timeSinceLastWrite = millis() - lastWriteTime;
float kbps = (uploadSize / 1024.0) / (timeSinceStart / 1000.0); float kbps = (uploadSize / 1024.0) / (timeSinceStart / 1000.0);
Serial.printf("[%lu] [WEB] [UPLOAD] Progress: %d bytes (%.1f KB), %.1f KB/s, write took %lu ms, gap since last: %lu ms\n", Serial.printf(
"[%lu] [WEB] [UPLOAD] Progress: %d bytes (%.1f KB), %.1f KB/s, write took %lu ms, gap since last: %lu "
"ms\n",
millis(), uploadSize, uploadSize / 1024.0, kbps, writeDuration, timeSinceLastWrite); millis(), uploadSize, uploadSize / 1024.0, kbps, writeDuration, timeSinceLastWrite);
lastLoggedSize = uploadSize; lastLoggedSize = uploadSize;
} }

View File

@ -257,8 +257,8 @@ void loop() {
// Log if there's a significant gap between handleClient calls (>100ms) // Log if there's a significant gap between handleClient calls (>100ms)
if (lastHandleClientTime > 0 && timeSinceLastHandleClient > 100) { if (lastHandleClientTime > 0 && timeSinceLastHandleClient > 100) {
Serial.printf("[%lu] [LOOP] WARNING: %lu ms gap since last handleClient (activity took %lu ms)\n", Serial.printf("[%lu] [LOOP] WARNING: %lu ms gap since last handleClient (activity took %lu ms)\n", millis(),
millis(), timeSinceLastHandleClient, activityDuration); timeSinceLastHandleClient, activityDuration);
} }
crossPointWebServer.handleClient(); crossPointWebServer.handleClient();
@ -269,8 +269,8 @@ void loop() {
if (loopDuration > maxLoopDuration) { if (loopDuration > maxLoopDuration) {
maxLoopDuration = loopDuration; maxLoopDuration = loopDuration;
if (maxLoopDuration > 50) { if (maxLoopDuration > 50) {
Serial.printf("[%lu] [LOOP] New max loop duration: %lu ms (activity: %lu ms)\n", Serial.printf("[%lu] [LOOP] New max loop duration: %lu ms (activity: %lu ms)\n", millis(), maxLoopDuration,
millis(), maxLoopDuration, activityDuration); activityDuration);
} }
} }