Apr 4, 2023 Worked out the issues with ESP32Cam and Google email. Now includes servo to move cam every 5 minutes for much wider views.
For the price of a servo and power supply you could have a bunch of fixed cams @$5 each arranged in a circle instead. Most servos won't give 360 degree views. Program them to send pics at different times. If you buy the cams with the USB shield that's all you need. Trigger the pics based on time from the internet between sunrise and sunset, and/or PIR sensor and/or on demand remotely from a webpage dashboard button in MQTT. For MQTT info go to https://io.adafruit.com/
Sunrise and sunset times depend on which month it is. Year, month, day and time comes from the internet. Corrected for daylight savings time or not. This project shows how to get the time from the internet. https://hackaday.io/project/174577-esp8266-time-and-date-from-internet
It's nice to be able to look around the house and outside while we are away for peanuts cost.
See test rig pic and code in files. The ESP32Cam shield is only needed for easy programming. If the email doesn't show up in Gmail just wait 1/2 hr or so. Once Google decides to accept the email it usually keeps working. Also Gmail stops temporarily if you send more than 500 emails in one day.
Servo version is powered from USB charger and cable with 5 volts split out to power the ESP32Cam. I use orange wires for 5V so it's not mixed up with red 3.3V. Yellow is the PWM command to the servo. The servo is separately powered from a 6V power supply on the white + and blue - wires in the last pic. Grounds connected.
Different wire colours are so I don't mix them up. ESP32Cam is a 3.3V device. 5V on most pins can destroy it.
I could use a number of 3.3V AM312 PIRs to detect which zone has activity, move the cam to that zone and email a pic.
I found the WiFi on ESP boards gives a lot of PIR false triggers if it's mounted nearby so I put an aluminum tube around the base of the PIR to shield it. Side shields are needed for multiple zones as well.
Note!! Jan 2023: There are now many issues with emailing a picture from ESP32 Cam including Google requires 2-step verification and the libraries have changed. Good luck sorting out all the new changes.
Also it seems on ESP32 WiFi and ESPNOW can't coexist. One or the other. I can get time from an existing NodeMCU with a clock. Pic capture and send based on time.
With my ESP8266/NodeMCUs it's not a problem at all. I still prefer NodeMCU over ESP32.
My solution is to only connect to wifi, WiFi.begin("wifi name", "wifi password"); based on time from ESPNOW, capture and send pic then disconnect using WiFi.disconnect(); . This works OK but ESPNOW seems flaky on ESP32.
It's better to use time from the internet instead. Then wifi can remain connected. If you have multiple cameras make sure pics are emailed at different times. See code for this in files. And/or Subscribe to a button on MQTT and trigger a pic and email remotely from anywhere.
https://hackaday.io/project/174577-esp8266-time-and-date-from-internet
The original ESP32 Cam board doesn't have a micro USB socket for programming so many temporary connections are needed to program it. OTA programming should work like it does with NodeMCU but no luck so far. With OTA you don't need the USB socket.
Program it using an Arduino Uno or a FTDI board. Correct wiring is at 1:00.
Or get a ESP32 Cam shield with a micro USB socket. For this one you don't need to hold a button to program.
Much, much easier. The shield can be removed after programming. Or left on and used to power the ESP32-Cam . The cam with the shield is only around a dollar more. Make sure you buy a few cams as they are easily damaged. Don't waste hours trying to get a reluctant board working. Just switch boards and the same code works fine. I use clear silicone to stick the camera to the SD card holder. Silicone sticks to...
Read more »