Hi,
https://randomnerdtutorials.com/esp32-cam-send-photos-email/
I am trying to compile (the code from the pdf v1.1) and I have this complain
In function 'boolean sendPhoto()':
motionDetectorEmailRuis:237:1: error: no return statement in function returning non-void [-Werror=return-type]tart your code here
Regards,
JPD
Ok, I wrote a return true; and it works.
Except for the flash… does not flash.
Regards,
JPD
Did you copy/paste the code exactly from the web page? On the page the return type for sendPhoto() is void whereas your error message says it’s expecting a return type of boolean. Seeing as the function doesn’t return anything you get the error message (ie. it’s expecting a return of boolean and the function doesn’t have a return statement).
If you have modified the code in any way make sure that you return something if you tell the compiler there is a return type.
Maybe the PDF is different from the web page?
In the pdf
boolean sendPhoto()
In the github file linked by the pdf
https://raw.githubusercontent.com/RuiSantosdotme/ESP32-CAM-eBook/master/Code/Module_3/Motion_Detector_Photo_Email/Motion_Detector_Photo_Email.ino
In the web page void sendPhoto()
void sendPhoto()
And still:
The flash… does not flash.
Not surprisingly, there is no #include “SD_MMC.h” and code lines associated goes with it.
Another thing
SPIFFS mounted successfully IP Address: http://189.143.0.115 Taking a photo... Picture file name: /photo.jpg The picture has been saved in /photo.jpg - Size: 0 bytes Taking a photo... Picture file name: /photo.jpg The picture has been saved in /photo.jpg - Size: 0 bytes Taking a photo... Picture file name: /photo.jpg The picture has been saved in /photo.jpg - Size: 0 bytes Taking a photo... Picture file name: /photo.jpg The picture has been saved in /photo.jpg - Size: 123008 bytes Sending email...
I tried to put a delay in the do-whiles loop unsuccessfully.
Regards
JPD
You are right.
I believe Rui/Sara should review the code in the three places; test and update so they are all the same and that it works. The code at the link would definitely not work.
Hi.
I’m sorry about that issue.
I don’t know how that happened.
The function doesn’t return anything, so it should be void.
The code on the link was updated. Can you try it?
Regards,
Sara
Hi,
I guess you are talking about codeThe void sendPhoto( void ) was a lesser problem.
Connecting to WiFi.....WiFi.RSSI: -45
SPIFFS mounted successfully
IP Address: http://189.143.0.115
Taking a photo...
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg - Size: 0 bytes
Taking a photo...
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg - Size: 0 bytes
Taking a photo...
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg - Size: 0 bytes
Taking a photo...
Picture file name: /photo.jpg
The picture has been saved in /photo.jpg - Size: 135680 bytes
Sending email...
Connecting to SMTP server...
SMTP server connected, wait for response...
Identification...
Authentication...
Sign in...
Sending Email header...
Sending Email body...
Sending attachments...
/photo.jpg
Finalize...
Finished
Email sent successfully
Going to sleep now
Hi.
That result means that the camera couldn’t get the photo at the first try. Only at the fourth try. That’s why there’s an if statement checking if the photo was successfully taken and saved.
However, I don’t know how to solve that issue to get things always at the first try..
Regards,
Sara
Maybe the spiff writing is too slow or too fast, or else.
A problem of memory formating between spiff memory, flash, etc?
A part of it could be written in assembly….
…
I dont know either ;o)