Skip to content

Commit fb2fc1b

Browse files
committed
Better feedback for no psram/filesystem errors
1 parent d1928a2 commit fb2fc1b

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

app_httpd.cpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,18 @@ void serialDump() {
145145
Serial.printf("Freq: %i MHz\r\n", ESP.getCpuFreqMHz());
146146
Serial.printf("MCU temperature : %i C, %i F (approximate)\r\n", McuTc, McuTf);
147147
Serial.printf("Heap: %i, free: %i, min free: %i, max block: %i\r\n", ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getMaxAllocHeap());
148-
Serial.printf("Psram: %i, free: %i, min free: %i, max block: %i\r\n", ESP.getPsramSize(), ESP.getFreePsram(), ESP.getMinFreePsram(), ESP.getMaxAllocPsram());
148+
if(psramFound()) {
149+
Serial.printf("Psram: %i, free: %i, min free: %i, max block: %i\r\n", ESP.getPsramSize(), ESP.getFreePsram(), ESP.getMinFreePsram(), ESP.getMaxAllocPsram());
150+
} else {
151+
Serial.printf("Psram: Not found; please check your board configuration.\r\n");
152+
Serial.printf("- High resolution/quality settings will show incomplete frames to low memory.\r\n");
153+
}
149154
// Filesystems
150-
if (filesystem) {
155+
if (filesystem && (SPIFFS.totalBytes() > 0)) {
151156
Serial.printf("Spiffs: %i, used: %i\r\n", SPIFFS.totalBytes(), SPIFFS.usedBytes());
157+
} else {
158+
Serial.printf("Spiffs: No filesystem found, please check your board configuration.\r\n");
159+
Serial.printf("- Saving and restoring camera settings will not function without this.\r\n");
152160
}
153161
Serial.println("Preferences file: ");
154162
dumpPrefs(SPIFFS);
@@ -493,8 +501,8 @@ static esp_err_t dump_handler(httpd_req_t *req){
493501
d+= sprintf(d,"<body>\n");
494502
d+= sprintf(d,"<img src=\"/logo.svg\" style=\"position: relative; float: right;\">\n");
495503
if (critERR.length() > 0) {
496-
d+= sprintf(d,"Hardware Error Detected!\n(the serial log may give more information)\n");
497-
d+= sprintf(d,"%s<hr>\n", critERR.c_str());
504+
d+= sprintf(d,"<span style=\"color:red;\">%s<hr></span>\n", critERR.c_str());
505+
d+= sprintf(d,"<h2 style=\"color:red;\">(the serial log may give more information)</h2><br>\n");
498506
}
499507
d+= sprintf(d,"<h1>ESP32 Cam Webserver</h1>\n");
500508
// Module
@@ -556,9 +564,17 @@ static esp_err_t dump_handler(httpd_req_t *req){
556564
d+= sprintf(d,"<span title=\"NOTE: Internal temperature sensor readings can be innacurate on the ESP32-c1 chipset, and may vary significantly between devices!\">");
557565
d+= sprintf(d,"MCU temperature : %i &deg;C, %i &deg;F</span>\n<br>", McuTc, McuTf);
558566
d+= sprintf(d,"Heap: %i, free: %i, min free: %i, max block: %i<br>\n", ESP.getHeapSize(), ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getMaxAllocHeap());
559-
d+= sprintf(d,"Psram: %i, free: %i, min free: %i, max block: %i<br>\n", ESP.getPsramSize(), ESP.getFreePsram(), ESP.getMinFreePsram(), ESP.getMaxAllocPsram());
560-
if (filesystem) {
567+
if (psramFound()) {
568+
d+= sprintf(d,"Psram: %i, free: %i, min free: %i, max block: %i<br>\n", ESP.getPsramSize(), ESP.getFreePsram(), ESP.getMinFreePsram(), ESP.getMaxAllocPsram());
569+
} else {
570+
d+= sprintf(d,"Psram: <span style=\"color:red;\">Not found</span>, please check your board configuration.<br>\n");
571+
d+= sprintf(d,"- High resolution/quality images & streams will show incomplete frames due to low memory.<br>\n");
572+
}
573+
if (filesystem && (SPIFFS.totalBytes() > 0)) {
561574
d+= sprintf(d,"Spiffs: %i, used: %i<br>\n", SPIFFS.totalBytes(), SPIFFS.usedBytes());
575+
} else {
576+
d+= sprintf(d,"Spiffs: <span style=\"color:red;\">No filesystem found</span>, please check your board configuration.<br>\n");
577+
d+= sprintf(d,"- saving and restoring camera settings will not function without this.<br>\n");
562578
}
563579

564580
// Footer

esp32-cam-webserver.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ void setup() {
636636
filesystemStart();
637637
loadPrefs(SPIFFS);
638638
} else {
639-
Serial.println("No Internal Filesystem, cannot save preferences");
639+
Serial.println("No Internal Filesystem, cannot load or save preferences");
640640
}
641641
}
642642

0 commit comments

Comments
 (0)