The email ESP32 Cam was sending only a partial or no pic so also added a SPIFFS format statement in the setup to correct this. Sends photo every 1/2 hr if bright enough. Removes photo from SPIFFS after email sent.
Code added to example from : https://randomnerdtutorials.com/esp32-cam-send-photos-email/#comment-715842
bool formatted = SPIFFS.format(); //formats SPIFFS if corrupt and only partial picture
void loop() {
if (digitalRead(2) == LOW) digitalWrite(33, LOW); // TURN on LED if dark
if (digitalRead(2) == HIGH) {
digitalWrite(33, HIGH);
capturePhotoSaveSpiffs();
sendPhoto();
SPIFFS.remove("FILE_PHOTO"); // remove photo after email sent
delay (1800000);
}
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.