CE432 Robotics II Fall 2022
Homework 2 - ESP32-CAM Practice
Name: Ryan Jeanes
Email: rejeanes@fortlewis.edu
Homework 2 - ESP32-CAM Practice
Introduction
For this assignment, we are practicing with the ESP32-CAM by exploring various ways to take and share photos.

Task 1
Task 1 was completed. Despite having lights on in my room the pictures were really dark with flash, so I tried pointing the cam at my desktop instead.


Figure 1 - Five pictures taken by camera pointed at top of desk with flash, since the lighting in my room is far from optimal.

Task 2


Figure 2 - Five pictures taken with the picture names including the time.

Task 3
Task 3 was able to capture the camera, but not able to write the photo to the file. When file.open() was called, the ESP32 crashed due to an "IntegerDivideByZero" exception thrown. I tried moving the path variable to be global, but the result remained the same. I don't know why this happens as the code to capture and write the photo to the microSD is an exact copy paste from the previous tasks which worked without a problem.


Figure 3 - Crash and core dump that happened when file.open() was called.

Task 4


Figure 4 - Picture taken using the webserver.

Task 5


Figure 5 - Webserver SD card manager showing saved photo named with timestamp.

Task 6
The ESP32 was able to take the photo and send the email, but the email was sent without the photo attached. There was an issue with one of the functions havivng a different parameter type than used in the code provided by the text (const unsigned int* instead of the parameter's required const time_t*), which I'm assuming is due to the text using much older library versions than what I got from github. A reinterpret_cast alone didn't fix it, unfortunately.


Figure 6 - Email received from ESP32 that is missing the attachment.

Task 7
I ran into a similar problem with this task; the same issue persisted with the same parameter datatype mismatch with the same function. This caused the email to be sent, but without the attachment. However, this also had an additional issue where after sending the email and disconnecting from the email server the ESP32 would crash due to stack heap corruption.


Figure 7 - Picture of webserver page used to send commands to ESP32 and serial output showing the same problem as seen in task 6 but with an additional crash due to heap corruption that wasn't seen in the previous task.

Task 8
Task 8 was completed succesfullly.


Figure 8 - Screenshot of the commands being sent to the ESP32 bot using thead telegram app.


Figure 9 - Serial monitor showing the ESP32 receiving and executing commands sent by the telegram app.
Appendix
Task 3 Code that crashed when writing to microSD card.