• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Unit 1: Send Photos via Email (ESP32 CAM)

Q&A Forum › Category: ESP32 › Unit 1: Send Photos via Email (ESP32 CAM)
0 Vote Up Vote Down
marcjeanvandenbril asked 5 years ago

Hello,

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,

6 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
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?
Regards,
Sara

0 Vote Up Vote Down
marcjeanvandenbril answered 5 years ago

Hi,

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
“https://github.com/RuiSantosdotme/ESP32-CAM-eBook/blob/master/Code/Module_3/Send_Photos_Email/Send_Photos_Email.ino”
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

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
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

Regards,
Sara

0 Vote Up Vote Down
marcjeanvandenbril answered 5 years ago

Hi,

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 🙂

0 Vote Up Vote Down
marcjeanvandenbril answered 5 years ago

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 …

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi again.

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.

Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.