Skip to content

Commit 6d82527

Browse files
committed
Fail if no PSRAM, fix #196
1 parent de01547 commit 6d82527

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

esp32-cam-webserver.ino

+14-13
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,6 @@ void WifiSetup() {
478478
}
479479

480480
void setup() {
481-
// This might reduce boot loops caused by camera init failures when soft rebooting
482-
// See, for instance, https://esp32.com/viewtopic.php?t=3152
483481
Serial.begin(115200);
484482
Serial.setDebugOutput(true);
485483
Serial.println();
@@ -491,12 +489,21 @@ void setup() {
491489
Serial.print("Base Release: ");
492490
Serial.println(baseVersion);
493491

492+
// Warn if no PSRAM is detected (typically user error with board selection in the IDE)
493+
if(!psramFound()){
494+
Serial.println("\r\nFatal Error; Halting");
495+
while (true) {
496+
Serial.println("No PSRAM found; camera cannot be initialised: Please check the board config for your module.");
497+
delay(5000);
498+
}
499+
}
500+
494501
if (stationCount == 0) {
495-
Serial.println("\r\nFatal Error; Halting");
496-
while (true) {
497-
Serial.println("No wifi details have been configured; we cannot connect to existing WiFi or start our own AccessPoint, there is no point in proceeding.");
498-
delay(5000);
499-
}
502+
Serial.println("\r\nFatal Error; Halting");
503+
while (true) {
504+
Serial.println("No wifi details have been configured; we cannot connect to existing WiFi or start our own AccessPoint, there is no point in proceeding.");
505+
delay(5000);
506+
}
500507
}
501508

502509
#if defined(LED_PIN) // If we have a notification LED, set it to output
@@ -747,12 +754,6 @@ void setup() {
747754
// As a final init step chomp out the serial buffer in case we have recieved mis-keys or garbage during startup
748755
while (Serial.available()) Serial.read();
749756

750-
// Warn if no PSRAM is detected (typically user error with board selection in the IDE)
751-
if(!psramFound()){
752-
Serial.printf("\r\nNo PSRAM found.\r\nPlease check the board config for your module.\r\n");
753-
Serial.printf("High resolution/quality images & streams will show incomplete frames due to low memory.\r\n");
754-
}
755-
756757
// While in Beta; Warn!
757758
Serial.print("\r\nThis is the 4.0 alpha\r\n - Face detection has been removed!\r\n");
758759
}

0 commit comments

Comments
 (0)