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 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.
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.
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 anything but is weak so the cam is easily removed if needed.
https://randomnerdtutorials.com/upload-code-esp32-cam-mb-usb/.

This doesn't allow access to the I/O when connected though. If the pic is triggered using the time from ESPNOW or time from the internet no connections to the I/O are required. This is what I use now. Powered from 2.0 amp USB charger and short micro USB cable. Many ESP32 Cam issues are due to an inadequate power supply.
Once programmed the board can run stand alone with a wired power supply if connections to I/O are needed.
Some newer ESP32 Cam...
Read more »