I have tried to make the sketch as easy to follow/modify as possible with lots of comments etc. and no additional libraries used, as I found it quiet confusing as an ameteur trying to do much with this module and difficult to find easy to understand examples/explanations of what I wanted to do, so I am publishing this sketch in the hope it will encourage/help others to have a try with these powerful and VERY affordable modules.
BTW - Even if you do not require the camera I think these modules have some uses in many projects as they are very cheap, have a built in sd card reader,
bright LED and the 4mb psram could prove useful for storing large amounts of temp data etc? (see the RGB section of the code to see how it can be used).
The module is not the easiest to use as it does not have a usb socket on board so you will need an in circuit programmer to program it, these can be bought on eBay very cheaply or you can use an Arduino as one: https://pre-processing.com/how-to-configure-the-esp32-cam-with-arduino-uno/
I built myself a simple "shield" which I can plug the esp32cam module in to and program it using a couple of toggle switches to the ESP32Cam on and off and select programming mode, this makes using these boards much more convenient.
BTW: Turns out Bitluni has created one here: https://www.hackster.io/news/bitluni-aims-to-simplify-esp32-cam-development-with-the-cam-prog-usb-programming-add-on-board-a3ba3193b618
created using the Arduino IDE with ESP32 module installed (See https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/)
This looks like it may contain useful info. on another way of getting RGB data from the camera: https://eloquentarduino.github.io/2020/01/image-recognition-with-esp32-and-arduino/
These modules require a good power supply. I find it best to put a good sized smoothing capacitor across the supply as the wifi especially can put lots
of spikes on the line.
If you get strange error messages, random reboots, wifi dropping out etc. first thing to do is make sure it is not just a power problem.
I have heard reports of these modules getting very warm when in use although I have not experienced this myself, I suspect it may be when streaming video for long periods? May be worth bearing in mind.