I have a problem with the sketch “module 3” Send Photos via Email on page 170.
Compiling this sketch gives the error
“Send_Photos_Email: 219: 1: error: no return statement in function returning non-void [-Werror = return-type] “at line 219.
I did not modify anything in this sketch…
Can you help me ? Regards,
That error is very weird.Did you install the required libraries?
Did you insert your email settings?
Make sure you’ve copied all the code. It seems some kind of weird syntax error.
Where did you copy the code from?
It is a compilation error, not functioning. In the event of a mail error, I could have
loaded the sketch on the ESP21CAM, which is not the case here. I took the sketch
of the book page 9 “download the ESP32-CAM Projects eBook repository” and compiled it
as is, with the error I described to you. I got it from
with the same error. I have the same problem with the sketch on page 188 (unit 2) while the sketch on page 201 compiles normally.
I have the impression that the error comes from the sendPhoto () function
Thank you for your thoughtful help
I tried to compile those sketches and they are working fine.
Can you tell me the version of the Email library you’re using, version of the ESP32 boards, version of your Arduino IDE and the board you’re selecting when trying to compile the code.
In my case, I have
- Arduino IDE version 1.8.10
- ESP32 Boards Version: 1.04
- ESP32 Mail Client library: 2.1.1
- Board selected: AI-Thinker
Thank you for your continued attention.
What do you mean by ESP32 board Version? I’m using Arduino IDE 1.8.12 ESP32 mailClient :2.1.4 Board selected Al Thinker ESP32.
In the tool menu: AVRISP mkII programmer (the second in the list) Retrieve card information: BN: unknown card VID: 0403 PID 6001
See you soon 🙂
Hello, I come back to my question about unit 1 “send photos via Email” I had a compilation error on the project “as is” … The error occurs on the last line of the sendPhoto () function.
The sendPhoto () function is called on line 128. This function has no arguments. I don’t understand the start of this function: boolean sendPhoto (void) I replaced it with the most classic: void sendPhoto ().
And it works: no more error !! If you have an explanation …
I’m sorry for taking so long to get back to you.
That was our mistake. However, I don’t know why it compiles ok on my side, and it doesn’t for you.
What happens is that we declared the function as boolean and because of that, the function should have returned a boolean value. However, it is not returning anything. That’s why the error.
So, you are right. We should replace it with the void sendPhoto() because that function will only execute tasks and will not return anything.
The code is already fixed on the github version and it will be fixed on the next eBook update.
Thanks for pointing that out.