This is the part I was interested in:
#define CAMERA_MODEL_AI_THINKER
The "CameraWebServer" example that comes with the "esp32" boards platform is configured for use with the "ESP Eye", like this:
#define CAMERA_MODEL_ESP_EYE // Has PSRAM
and that configuration doesn't work with the common ESP32-CAM board, and so when the example is used without any modification it causes the "Camera probe failed with error 0x105 (ESP_ERR_NOT_FOUND)" error reported by @learner999. However, I see that your sketch is already configured correctly for use with the ESP32-CAM, so assuming you are using ESP32-CAM board, then your sketch is correctly configured.
I notice you are using a very old version of the example sketch, likely because you have a very old version of the "esp32" boards platform installed. Unless you have a specific reason for using that old platform version, I recommend you update to the latest version. I'll provide instructions you can follow to do that:
A. Update "esp32" Boards Platform
- Open the web page containing Espressif's official installation instructions for the ESP32 boards platform:
https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide - Copy the URL shown under the "Stable release link" section of that page.
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - If there is already a URL for the ESP32 boards platform in the "Additional Boards Manager URLs" field of the "Preferences" dialog, delete it.
- Add the URL you copied from the ESP32 boards platform installation instructions to the "Additional Boards Manager URLs" field.
ⓘ If there are other URLs in the field, separate them with commas (,). - Click the "OK" button on the "Preferences" dialog.
The "Preferences" dialog will close. - You will now see a "Downloading index: ..." notification at the bottom right corner of the IDE window. Wait for that notification to close.
- Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
- Scroll down through the list of boards platforms until you see the "esp32 by Espressif Systems" entry.
- Click the "UPDATE" button at the bottom of the entry.
- Wait for the update process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
Successfully installed platform ...
B. Use Latest Example Sketch
- Select File > Examples > ESP32 > Camera > CameraWebServer from the Arduino IDE menus.
The "CameraWebServer" sketch will open in a new Arduino IDE window. - Change line 17 of the sketch from this:
to this:#define CAMERA_MODEL_ESP_EYE // Has PSRAM#define CAMERA_MODEL_AI_THINKER - Replace the
**********placeholders on lines 39 and 40 of the sketch with your Wi-Fi access point credentials:const char *ssid = "**********"; const char *password = "**********"; - If it isn't already, connect your ESP32-CAM board to the computer with a USB cable.
- Select Tools > Board > ESP32-CAM from the Arduino IDE menus.
- Select the port of the ESP32-CAM board from Arduino IDE's Tools > Port menu.
- If it isn't already open, select Tools > Serial Monitor to open the Serial Monitor panel.
- Select Sketch > Upload from the Arduino IDE menus.
- Wait for the upload to finish successfully.
- Watch the Serial Monitor panel. You should see something like this:
WiFi connecting.. WiFi connected Camera Ready! Use 'http://192.168.254.129' to connect - Type the URL shown in Serial Monitor into the address bar of your browser.
- Press the Enter key.
A web page will open that allows you to configure the camera. - Make any camera configurations you like on the web page.
- Click the "Start Stream" button on the web page.
You should now see the stream from the camera in the web page.