espressif / esp32-camera

Apache License 2.0
1.89k stars 637 forks source link

Camera probe failed with error 0x105 #450

Closed lucianobonzatto closed 1 year ago

lucianobonzatto commented 2 years ago

hello, i'm tring to get image form ESP32-CAM using platformio. this is my fededback message:

E (2207) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND) Camera init failed with error 0x105ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:1184 load:0x40078000,len:13132 load:0x40080400,len:3036 entry 0x400805e4

and my platformio.ini:

[env:esp32dev] platform = espressif32 board = esp-wrover-kit framework = arduino monitor_speed = 115200

It's necessary set DBOARD_HAS_PSRAM?

WangYuxin-esp commented 2 years ago

Before officially initializing the camera, ESP32 will send a command to the sensor through the I2C bus. Normally, the sensor should send an ACK, and then ESP32 can initialize the sensor through the I2C bus. The current log shows that the sensor has not sent an ACK. Therefore, the configuration of the ESP32 pin is abnormal, or the sensor is working in an abnormal state.

yashshukla99 commented 2 years ago

I'm also facing the same issue, even after the cam init ok.

err

WangYuxin-esp commented 2 years ago

@yashshukla99 Is the official development board currently used? Which sensor model is used? And it is recommended that you use the example here for testing.

yashshukla99 commented 2 years ago

Thanks @WangYuxin-esp , I will test above code and I am using this one with OV2640 sensor.

Jason2866 commented 1 year ago

@yashshukla99 I have several of this AI-Thinker (or faked clone?). The are borderline.

aroerina commented 1 year ago

I often face this problem, but it is usually due to a poor connection of the FPC connector, which can be solved by inserting the connector all the way to the back.

OmPatel47097 commented 1 year ago

Tried all of the solutions, I think I got scamed or my electrical skills are too bad : /

Jason2866 commented 1 year ago

@OmPatel47097 Probably you have got just bad luck with the one you have. Since i use ESP32-S3 Cam Modells never had any problem.

OmPatel47097 commented 1 year ago

@OmPatel47097 Probably you have got just bad luck with the one you have. Since i use ESP32-S3 Cam Modells never had any problem.

Probably I might need to buy a new one

maboeckx commented 1 year ago

you shoud trie to use the CAMERA_MODEL_AI_THINKER board worked for me when i had this problem

sergioaiello commented 1 year ago

I faced the same issue. With the same log. I solved changing from I2C port#1 (default) to port#0 (and AI_THINKER as noted here above)

durop commented 1 year ago

@sergioaiello what do you mean by changing I2c port 1 to 2? Do you have some sketch?

Tried with .sccb_i2c_port = 0 and also = 1 but no luck.

sergioaiello commented 1 year ago

no, it is very easy. Go to "menuconfig" ("F1" if you use VisualCode editor) and search for "SCCB" (OV camera's interface) You should get the menu "I2C peripheral to use for SCCB" with two choices: "I2C0" and "I2C1" Apparently the default is the latter. Change to the former and compile after a "fullclean". It worked for me. Give it a try and let me know.

durop commented 1 year ago

@sergioaiello, thanks for the response. Im using vscode with PlatafformIO extension. I dont get any result when searching "SCCB".

sergioaiello commented 1 year ago

the trigger is the file Kconfig.projbuild Is that file relevant to platformio extension? I copy-paste the excerpt related to I2C port selection:

choice SCCB_HARDWARE_I2C_PORT
    bool "I2C peripheral to use for SCCB"
    default SCCB_HARDWARE_I2C_PORT1

    config SCCB_HARDWARE_I2C_PORT0
        bool "I2C0"
    config SCCB_HARDWARE_I2C_PORT1
        bool "I2C1"

endchoice

You can check the file https://github.com/espressif/esp32-camera/blob/master/Kconfig

Also you can get the entire github project that refers to the Kconfig.projbuild file. talk to you then

Deewansonic commented 1 year ago

define CAMERA_MODEL_AI_THINKER // Has PSRAM

using/ uncommenting the above worked for me.

psi-4ward commented 1 year ago

define CAMERA_MODEL_AI_THINKER // Has PSRAM using/ uncommenting the above worked for me.

Can you share your sketch (and probably platform.ini)?

Deewansonic commented 1 year ago

define CAMERA_MODEL_AI_THINKER // Has PSRAM using/ uncommenting the above worked for me.

Can you share your sketch (and probably platform.ini)?

include "esp_camera.h"

include 

// // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality //            Ensure ESP32 Wrover Module or other board with PSRAM is selected //            Partial images will be transmitted if image exceeds buffer size // //            You must select partition scheme from the board menu that has at least 3MB APP space. //            Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15  //            seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well

// =================== // Select camera model // =================== //#define CAMERA_MODEL_WROVER_KIT // Has PSRAM // #define CAMERA_MODEL_ESP_EYE // Has PSRAM //#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM //#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM //#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM //#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM //#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM //#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM

define CAMERA_MODEL_AI_THINKER // Has PSRAM

//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM //  Espressif Internal Boards  //#define CAMERA_MODEL_ESP32_CAM_BOARD //#define CAMERA_MODEL_ESP32S2_CAM_BOARD //#define CAMERA_MODEL_ESP32S3_CAM_LCD

include "camera_pins.h"

// =========================== // Enter your WiFi credentials // =========================== const char* ssid = "**"; const char* password = "**";

void startCameraServer(); void setupLedFlash(int pin);

void setup() {   Serial.begin(115200);   Serial.setDebugOutput(true);   Serial.println();

  camera_config_t config;   config.ledc_channel = LEDC_CHANNEL_0;   config.ledc_timer = LEDC_TIMER_0;   config.pin_d0 = Y2_GPIO_NUM;   config.pin_d1 = Y3_GPIO_NUM;   config.pin_d2 = Y4_GPIO_NUM;   config.pin_d3 = Y5_GPIO_NUM;   config.pin_d4 = Y6_GPIO_NUM;   config.pin_d5 = Y7_GPIO_NUM;   config.pin_d6 = Y8_GPIO_NUM;   config.pin_d7 = Y9_GPIO_NUM;   config.pin_xclk = XCLK_GPIO_NUM;   config.pin_pclk = PCLK_GPIO_NUM;   config.pin_vsync = VSYNC_GPIO_NUM;   config.pin_href = HREF_GPIO_NUM;   config.pin_sscb_sda = SIOD_GPIO_NUM;   config.pin_sscb_scl = SIOC_GPIO_NUM;   config.pin_pwdn = PWDN_GPIO_NUM;   config.pin_reset = RESET_GPIO_NUM;   config.xclk_freq_hz = 20000000;   config.frame_size = FRAMESIZE_UXGA;   config.pixel_format = PIXFORMAT_JPEG; // for streaming   //config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition   config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;   config.fb_location = CAMERA_FB_IN_PSRAM;   config.jpeg_quality = 12;   config.fb_count = 1;      // if PSRAM IC present, init with UXGA resolution and higher JPEG quality   //                      for larger pre-allocated frame buffer.   if(config.pixel_format == PIXFORMAT_JPEG){     if(psramFound()){       config.jpeg_quality = 10;       config.fb_count = 2;       config.grab_mode = CAMERA_GRAB_LATEST;     } else {       // Limit the frame size when PSRAM is not available       config.frame_size = FRAMESIZE_SVGA;       config.fb_location = CAMERA_FB_IN_DRAM;     }   } else {     // Best option for face detection/recognition     config.frame_size = FRAMESIZE_240X240;

if CONFIG_IDF_TARGET_ESP32S3

    config.fb_count = 2;

endif

  }

if defined(CAMERA_MODEL_ESP_EYE)

  pinMode(13, INPUT_PULLUP);   pinMode(14, INPUT_PULLUP);

endif

  // camera init   esp_err_t err = esp_camera_init(&config);   if (err != ESP_OK) {     Serial.printf("Camera init failed with error 0x%x", err);     return;   }

  sensor_t * s = esp_camera_sensor_get();   // initial sensors are flipped vertically and colors are a bit saturated   if (s->id.PID == OV3660_PID) {     s->set_vflip(s, 1); // flip it back     s->set_brightness(s, 1); // up the brightness just a bit     s->set_saturation(s, -2); // lower the saturation   }   // drop down frame size for higher initial frame rate   if(config.pixel_format == PIXFORMAT_JPEG){     s->set_framesize(s, FRAMESIZE_QVGA);   }

if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)

  s->set_vflip(s, 1);   s->set_hmirror(s, 1);

endif

if defined(CAMERA_MODEL_ESP32S3_EYE)

  s->set_vflip(s, 1);

endif

// Setup LED FLash if LED pin is defined in camera_pins.h

if defined(LED_GPIO_NUM)

  setupLedFlash(LED_GPIO_NUM);

endif

  WiFi.begin(ssid, password);   WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED) {     delay(500);     Serial.print(".");   }   Serial.println("");   Serial.println("WiFi connected");

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");   Serial.print(WiFi.localIP());   Serial.println("' to connect"); }

void loop() {   // Do nothing. Everything is done in another task by the web server   delay(10000); }

Deewansonic commented 1 year ago

define CAMERA_MODEL_AI_THINKER // Has PSRAM using/ uncommenting the above worked for me.

Can you share your sketch (and probably platform.ini)?

include "esp_camera.h"

include 

// // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality //            Ensure ESP32 Wrover Module or other board with PSRAM is selected //            Partial images will be transmitted if image exceeds buffer size // //            You must select partition scheme from the board menu that has at least 3MB APP space. //            Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15  //            seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well

// =================== // Select camera model // =================== //#define CAMERA_MODEL_WROVER_KIT // Has PSRAM // #define CAMERA_MODEL_ESP_EYE // Has PSRAM //#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM //#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM //#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM //#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM //#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM //#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM

define CAMERA_MODEL_AI_THINKER // Has PSRAM

//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM //  Espressif Internal Boards  //#define CAMERA_MODEL_ESP32_CAM_BOARD //#define CAMERA_MODEL_ESP32S2_CAM_BOARD //#define CAMERA_MODEL_ESP32S3_CAM_LCD

include "camera_pins.h"

// =========================== // Enter your WiFi credentials // =========================== const char* ssid = "**"; const char* password = "**";

void startCameraServer(); void setupLedFlash(int pin);

void setup() {   Serial.begin(115200);   Serial.setDebugOutput(true);   Serial.println();

  camera_config_t config;   config.ledc_channel = LEDC_CHANNEL_0;   config.ledc_timer = LEDC_TIMER_0;   config.pin_d0 = Y2_GPIO_NUM;   config.pin_d1 = Y3_GPIO_NUM;   config.pin_d2 = Y4_GPIO_NUM;   config.pin_d3 = Y5_GPIO_NUM;   config.pin_d4 = Y6_GPIO_NUM;   config.pin_d5 = Y7_GPIO_NUM;   config.pin_d6 = Y8_GPIO_NUM;   config.pin_d7 = Y9_GPIO_NUM;   config.pin_xclk = XCLK_GPIO_NUM;   config.pin_pclk = PCLK_GPIO_NUM;   config.pin_vsync = VSYNC_GPIO_NUM;   config.pin_href = HREF_GPIO_NUM;   config.pin_sscb_sda = SIOD_GPIO_NUM;   config.pin_sscb_scl = SIOC_GPIO_NUM;   config.pin_pwdn = PWDN_GPIO_NUM;   config.pin_reset = RESET_GPIO_NUM;   config.xclk_freq_hz = 20000000;   config.frame_size = FRAMESIZE_UXGA;   config.pixel_format = PIXFORMAT_JPEG; // for streaming   //config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition   config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;   config.fb_location = CAMERA_FB_IN_PSRAM;   config.jpeg_quality = 12;   config.fb_count = 1;      // if PSRAM IC present, init with UXGA resolution and higher JPEG quality   //                      for larger pre-allocated frame buffer.   if(config.pixel_format == PIXFORMAT_JPEG){     if(psramFound()){       config.jpeg_quality = 10;       config.fb_count = 2;       config.grab_mode = CAMERA_GRAB_LATEST;     } else {       // Limit the frame size when PSRAM is not available       config.frame_size = FRAMESIZE_SVGA;       config.fb_location = CAMERA_FB_IN_DRAM;     }   } else {     // Best option for face detection/recognition     config.frame_size = FRAMESIZE_240X240;

if CONFIG_IDF_TARGET_ESP32S3

    config.fb_count = 2;

endif

  }

if defined(CAMERA_MODEL_ESP_EYE)

  pinMode(13, INPUT_PULLUP);   pinMode(14, INPUT_PULLUP);

endif

  // camera init   esp_err_t err = esp_camera_init(&config);   if (err != ESP_OK) {     Serial.printf("Camera init failed with error 0x%x", err);     return;   }

  sensor_t * s = esp_camera_sensor_get();   // initial sensors are flipped vertically and colors are a bit saturated   if (s->id.PID == OV3660_PID) {     s->set_vflip(s, 1); // flip it back     s->set_brightness(s, 1); // up the brightness just a bit     s->set_saturation(s, -2); // lower the saturation   }   // drop down frame size for higher initial frame rate   if(config.pixel_format == PIXFORMAT_JPEG){     s->set_framesize(s, FRAMESIZE_QVGA);   }

if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)

  s->set_vflip(s, 1);   s->set_hmirror(s, 1);

endif

if defined(CAMERA_MODEL_ESP32S3_EYE)

  s->set_vflip(s, 1);

endif

// Setup LED FLash if LED pin is defined in camera_pins.h

if defined(LED_GPIO_NUM)

  setupLedFlash(LED_GPIO_NUM);

endif

  WiFi.begin(ssid, password);   WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED) {     delay(500);     Serial.print(".");   }   Serial.println("");   Serial.println("WiFi connected");

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");   Serial.print(WiFi.localIP());   Serial.println("' to connect"); }

void loop() {   // Do nothing. Everything is done in another task by the web server   delay(10000); }

So far, the modification has been made already. Replace with your code.

psi-4ward commented 1 year ago

Have some success today:

Three devices working, one gives me:

E (541) sccb: SCCB_Write Failed addr:0x30, reg:0x37, data:0xc3, ret:263
E (542) camera: Camera probe failed with error 0xffffffff(ESP_FAIL)
Camera init failed with error 0xffffffff

So this board has a damaged PSRAM?

Deewansonic commented 1 year ago

You only could uncomment one board particularly. Use #define CAMERA_MODEL_AI_THINKER only please. Don't use two boards. It should work. Sent from Yahoo Mail on Android

On Tue, 7 Mar 2023 at 1:45 pm, Christoph @.***> wrote:

Have some success today:

Three devices working, one gives me: E (541) sccb: SCCB_Write Failed addr:0x30, reg:0x37, data:0xc3, ret:263 E (542) camera: Camera probe failed with error 0xffffffff(ESP_FAIL) Camera init failed with error 0xffffffff

So this board has a damaged PSRAM?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

psi-4ward commented 1 year ago

You only could uncomment one board particularly. Use #define CAMERA_MODEL_AI_THINKER only please. Don't use two boards. It should work.

Does not make any difference. Still get the SCCB_Write Failed

Jason2866 commented 1 year ago

@psi-4ward There are clone AI-Thinker Boards where PSRAM is not there or not working.

psi-4ward commented 1 year ago

@psi-4ward There are clone AI-Thinker Boards where PSRAM is not there or not working.

But I've 4 pieces and 3 of them work now - all from the same order.

Rombersoft commented 1 year ago

I've resolved the same problem. I've selected "Ai Thinker ESP-32 cam" board. Flash mode "DIO". Partition Scheme "Huge APP (3Mb...)". And it's all. My Cam works fine. This is my board. photo_2023-04-02_13-59-57

github-actions[bot] commented 1 year ago

This issue appears to be stale. Please close it if its no longer valid.

xstable commented 1 year ago

@Deewansonic

define CAMERA_MODEL_AI_THINKER // Has PSRAM using/ uncommenting the above worked for me.

Can you share your sketch (and probably platform.ini)?

include "esp_camera.h"

include 

// // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality //            Ensure ESP32 Wrover Module or other board with PSRAM is selected //            Partial images will be transmitted if image exceeds buffer size // //            You must select partition scheme from the board menu that has at least 3MB APP space. //            Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15  //            seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well // =================== // Select camera model // =================== //#define CAMERA_MODEL_WROVER_KIT // Has PSRAM // #define CAMERA_MODEL_ESP_EYE // Has PSRAM //#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM //#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM //#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM //#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM //#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM //#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM

define CAMERA_MODEL_AI_THINKER // Has PSRAM

//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM //  Espressif Internal Boards  //#define CAMERA_MODEL_ESP32_CAM_BOARD //#define CAMERA_MODEL_ESP32S2_CAM_BOARD //#define CAMERA_MODEL_ESP32S3_CAM_LCD

include "camera_pins.h"

// =========================== // Enter your WiFi credentials // =========================== const char ssid = "**"; const char password = "**"; void startCameraServer(); void setupLedFlash(int pin); void setup() {   Serial.begin(115200);   Serial.setDebugOutput(true);   Serial.println();   camera_config_t config;   config.ledc_channel = LEDC_CHANNEL_0;   config.ledc_timer = LEDC_TIMER_0;   config.pin_d0 = Y2_GPIO_NUM;   config.pin_d1 = Y3_GPIO_NUM;   config.pin_d2 = Y4_GPIO_NUM;   config.pin_d3 = Y5_GPIO_NUM;   config.pin_d4 = Y6_GPIO_NUM;   config.pin_d5 = Y7_GPIO_NUM;   config.pin_d6 = Y8_GPIO_NUM;   config.pin_d7 = Y9_GPIO_NUM;   config.pin_xclk = XCLK_GPIO_NUM;   config.pin_pclk = PCLK_GPIO_NUM;   config.pin_vsync = VSYNC_GPIO_NUM;   config.pin_href = HREF_GPIO_NUM;   config.pin_sscb_sda = SIOD_GPIO_NUM;   config.pin_sscb_scl = SIOC_GPIO_NUM;   config.pin_pwdn = PWDN_GPIO_NUM;   config.pin_reset = RESET_GPIO_NUM;   config.xclk_freq_hz = 20000000;   config.frame_size = FRAMESIZE_UXGA;   config.pixel_format = PIXFORMAT_JPEG; // for streaming   //config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition   config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;   config.fb_location = CAMERA_FB_IN_PSRAM;   config.jpeg_quality = 12;   config.fb_count = 1;      // if PSRAM IC present, init with UXGA resolution and higher JPEG quality   //                      for larger pre-allocated frame buffer.   if(config.pixel_format == PIXFORMAT_JPEG){     if(psramFound()){       config.jpeg_quality = 10;       config.fb_count = 2;       config.grab_mode = CAMERA_GRAB_LATEST;     } else {       // Limit the frame size when PSRAM is not available       config.frame_size = FRAMESIZE_SVGA;       config.fb_location = CAMERA_FB_IN_DRAM;     }   } else {     // Best option for face detection/recognition     config.frame_size = FRAMESIZE_240X240;

if CONFIG_IDF_TARGET_ESP32S3

    config.fb_count = 2;

endif

  }

if defined(CAMERA_MODEL_ESP_EYE)

  pinMode(13, INPUT_PULLUP);   pinMode(14, INPUT_PULLUP);

endif

  // camera init   esp_err_t err = esp_camera_init(&config);   if (err != ESP_OK) {     Serial.printf("Camera init failed with error 0x%x", err);     return;   }   sensor_t * s = esp_camera_sensor_get();   // initial sensors are flipped vertically and colors are a bit saturated   if (s->id.PID == OV3660_PID) {     s->set_vflip(s, 1); // flip it back     s->set_brightness(s, 1); // up the brightness just a bit     s->set_saturation(s, -2); // lower the saturation   }   // drop down frame size for higher initial frame rate   if(config.pixel_format == PIXFORMAT_JPEG){     s->set_framesize(s, FRAMESIZE_QVGA);   }

if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)

  s->set_vflip(s, 1);   s->set_hmirror(s, 1);

endif

if defined(CAMERA_MODEL_ESP32S3_EYE)

  s->set_vflip(s, 1);

endif

// Setup LED FLash if LED pin is defined in camera_pins.h

if defined(LED_GPIO_NUM)

  setupLedFlash(LED_GPIO_NUM);

endif

  WiFi.begin(ssid, password);   WiFi.setSleep(false);   while (WiFi.status() != WL_CONNECTED) {     delay(500);     Serial.print(".");   }   Serial.println("");   Serial.println("WiFi connected");   startCameraServer();   Serial.print("Camera Ready! Use 'http://");   Serial.print(WiFi.localIP());   Serial.println("' to connect"); } void loop() {   // Do nothing. Everything is done in another task by the web server   delay(10000); }

So far, the modification has been made already. Replace with your code.

You made my day!!! Awesome. With your modification it work for me. Thanks a lot!

aaalvinnn commented 1 year ago

I face the same problem and have managed to fix it: my device is esp32cam from AI-thinker, and it turns out to be that i forgot to set the Pin of it which leads to this problem. error0x105

maralian commented 11 months ago

Hi, the problem is in the programming example camera web server

I modified the programming and managed to fix it

use this in the folder (camerawebserver.ino) if you are using arduino.ide

include "esp_camera.h"

include

include "esp_timer.h"

include "img_converters.h"

include "Arduino.h"

include "fb_gfx.h"

include "soc/soc.h"

include "soc/rtc_cntl_reg.h"

include "esp_http_server.h"

const char ssid = "CASA_DA_MARA"; const char password = "Maralian1234";

define PWDN_GPIO_NUM 32

define RESET_GPIO_NUM -1

define XCLK_GPIO_NUM 0

define SIOD_GPIO_NUM 26

define SIOC_GPIO_NUM 27

define Y9_GPIO_NUM 35

define Y8_GPIO_NUM 34

define Y7_GPIO_NUM 39

define Y6_GPIO_NUM 36

define Y5_GPIO_NUM 21

define Y4_GPIO_NUM 19

define Y3_GPIO_NUM 18

define Y2_GPIO_NUM 5

define VSYNC_GPIO_NUM 25

define HREF_GPIO_NUM 23

define PCLK_GPIO_NUM 22

define PART_BOUNDARY "123456789000000000000987654321"

static const char _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY; static const char _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n"; static const char _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n"; static esp_err_t stream_handler(httpd_req_t req){ camera_fb_t fb = NULL; esp_err_t res = ESP_OK; size_t _jpg_buf_len = 0; uint8_t _jpg_buf = NULL; char part_buf[64]; res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE); if(res != ESP_OK){ return res; } while(true){ fb = esp_camera_fb_get(); if (!fb) { Serial.println("Camera capture failed"); res = ESP_FAIL; } else { if(fb->width > 400){ if(fb->format != PIXFORMAT_JPEG){ bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len); esp_camera_fb_return(fb); fb = NULL; if(!jpeg_converted){ Serial.println("JPEG compression failed"); res = ESP_FAIL; } } else { _jpg_buf_len = fb->len; _jpg_buf = fb->buf; } } } if(res == ESP_OK){ size_t hlen = snprintf((char )part_buf, 64, _STREAM_PART, _jpg_buf_len); res = httpd_resp_send_chunk(req, (const char )part_buf, hlen); } if(res == ESP_OK){ res = httpd_resp_send_chunk(req, (const char )_jpg_buf, _jpg_buf_len); } if(res == ESP_OK){ res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY)); } if(fb){ esp_camera_fb_return(fb); fb = NULL; _jpg_buf = NULL; } else if(_jpg_buf){ free(_jpg_buf); _jpg_buf = NULL; } if(res != ESP_OK){ break; } } return res; } void startCameraServer();

void setup() { WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //desativa o detector de brownout

Serial.begin(115200); Serial.setDebugOutput(false);

camera_config_t config; config.ledc_channel = LEDC_CHANNEL_0; config.ledc_timer = LEDC_TIMER_0; config.pin_d0 = Y2_GPIO_NUM; config.pin_d1 = Y3_GPIO_NUM; config.pin_d2 = Y4_GPIO_NUM; config.pin_d3 = Y5_GPIO_NUM; config.pin_d4 = Y6_GPIO_NUM; config.pin_d5 = Y7_GPIO_NUM; config.pin_d6 = Y8_GPIO_NUM; config.pin_d7 = Y9_GPIO_NUM; config.pin_xclk = XCLK_GPIO_NUM; config.pin_pclk = PCLK_GPIO_NUM; config.pin_vsync = VSYNC_GPIO_NUM; config.pin_href = HREF_GPIO_NUM; config.pin_sscb_sda = SIOD_GPIO_NUM; config.pin_sscb_scl = SIOC_GPIO_NUM; config.pin_pwdn = PWDN_GPIO_NUM; config.pin_reset = RESET_GPIO_NUM; config.xclk_freq_hz = 20000000; config.grab_mode = CAMERA_GRAB_WHEN_EMPTY; config.fb_location = CAMERA_FB_IN_PSRAM; config.frame_size = FRAMESIZE_UXGA; config.jpeg_quality = 12; config.fb_count = 1; if(config.pixel_format == PIXFORMAT_JPEG){ if(psramFound()){ config.jpeg_quality = 10; config.fb_count = 2; config.grab_mode = CAMERA_GRAB_LATEST; } else { config.frame_size = FRAMESIZE_SVGA; config.fb_location = CAMERA_FB_IN_DRAM; } } else { // Best option for face detection/recognition config.frame_size = FRAMESIZE_240X240;

if CONFIG_IDF_TARGET_ESP32S3

config.fb_count = 2;

endif

}

// Inicia a câmera esp_err_t err = esp_camera_init(&config); if (err != ESP_OK) { Serial.printf("Camera init failed with error 0x%x", err); return; } // Conecta o WiFi WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected");

Serial.print("Camera Stream Ready! Go to: http://"); Serial.print(WiFi.localIP());

// Start streaming web server startCameraServer(); } void loop() { delay(1); //nenhuma ação relevante é realizada no loop }

xstable commented 11 months ago

@maralian please always put sourcecode in three backticks : ``` your-code-goes-here ```

sunjialinsun commented 10 months ago

hello, i'm tring to get image form ESP32-CAM using platformio. this is my fededback message:

E (2207) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND) Camera init failed with error 0x105ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:1184 load:0x40078000,len:13132 load:0x40080400,len:3036 entry 0x400805e4

and my platformio.ini:

[env:esp32dev] platform = espressif32 board = esp-wrover-kit framework = arduino monitor_speed = 115200

It's necessary set DBOARD_HAS_PSRAM?

I get the same issue , and figure out is is due to select the worng camera model. you just need update the .ino file with correct cam model.

DNS commented 5 months ago

Camera probe failed with error 0x105

In my case, it's caused by poor quality programmer/uploader (ESP32-CAM-MB). The female pin was bent. Sometimes it cause error 0x105, and sometimes success but show very bad quality videos.

When I changed to the other programmer, the problem was solved.

Hairyloon commented 5 months ago

Is it too late to join in this discussion? I have a similar problem. Curiously, I get a different error if I flash it from a different PC; my guess is that the other one has an older set of libraries, or some such thing, rather than being the difference between machines.

On this one, I get:

E (543) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
Camera init failed with error 0x105

On the other one I get:

[E][camera.c:1113] camera_probe(): Detected camera not supported.
[E][camera.c:1379] esp_camera_init(): Camera probe failed with error 0x20004

I'm also getting these warnings:

W (179) esp_psram: Virtual address not enough for PSRAM, map as much as we can. 4MB is mapped
W (301) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`
dixieflatline42 commented 5 months ago

Is it too late to join in this discussion? I have a similar problem. Curiously, I get a different error if I flash it from a different PC; my guess is that the other one has an older set of libraries, or some such thing, rather than being the difference between machines.

On this one, I get:

E (543) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
Camera init failed with error 0x105

On the other one I get:

[E][camera.c:1113] camera_probe(): Detected camera not supported.
[E][camera.c:1379] esp_camera_init(): Camera probe failed with error 0x20004

I'm also getting these warnings:

W (179) esp_psram: Virtual address not enough for PSRAM, map as much as we can. 4MB is mapped
W (301) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`

Man, I was having the same problem. Use this reference to flash your code:

https://github.com/espressif/esp-iot-solution/tree/master/examples/camera/basic

It's work to me.

Hairyloon commented 5 months ago

Thanks. That doesn't seem to work on mine: maybe my camera is dud. There is another one here somewhere. I'll try swapping them about a bit.

ModderHangout commented 5 months ago

I have the esp32 cam and the first time I got it and used Arduino IDE for it didn't work so I returned it and got a new one and still have the problem but I'm about to try one of the solutions above

Bongumsa commented 4 months ago

The problem is mostly caused by incorrectly defining camera pins. The esp32 wrover kit has a different camera pin configuration that the espcam by AI thinker.

Hairyloon commented 4 months ago

The problem is mostly caused by incorrectly defining camera pins. The esp32 wrover kit has a different camera pin configuration that the espcam by AI thinker.

I would say "Often" rather than "Mostly", and I have tried both. Would it be a lot of work to write a sketch that runs through the options and reports back on which one is right? If it is the most common cause of this problem, then maybe it would be worth doing?

Or has somebody done it already?

Bummbumm6 commented 4 months ago

After checking, I barely didn't provide enough power for the camera to run properly, and it drove me crazy hahaha

Hairyloon commented 4 months ago

After checking, I barely didn't provide enough power for the camera to run properly, and it drove me crazy hahaha

I had one that wouldn't boot without a capacitor across the power rail. I reckoned that was a power issue, but I couldn't fathom the basis for the problem: I'm fairly sure the power supply was more than adequate.

zeta-omega-chi commented 3 months ago
  • Used #define CAMERA_MODEL_AI_THINKER AND #define CAMERA_MODEL_ESP32_CAM_BOARD

This works for esp32-cam with ov2460 from AIThinker

Piyush-GG commented 2 months ago

I have this issue too and I need a solution as soon as possible, I don't really know how to fix this.

my board is the xiao esp32 s3 sense and it keeps on giving the cam init error: Camera init failed with error 0x105

this is the code:

include "esp_camera.h"

include

// // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality // Ensure ESP32 Wrover Module or other board with PSRAM is selected // Partial images will be transmitted if image exceeds buffer size // // You must select partition scheme from the board menu that has at least 3MB APP space. // Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15 // seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well

// =================== // Select camera model // =================== //#define CAMERA_MODEL_WROVER_KIT // Has PSRAM // #define CAMERA_MODEL_ESP_EYE // Has PSRAM //#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM //#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM //#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM //#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM //#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM //#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM //#define CAMERA_MODEL_M5STACK_CAMS3_UNIT // Has PSRAM //#define CAMERA_MODEL_AI_THINKER // Has PSRAM //#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM

define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM

// Espressif Internal Boards //#define CAMERA_MODEL_ESP32_CAM_BOARD //#define CAMERA_MODEL_ESP32S2_CAM_BOARD //#define CAMERA_MODEL_ESP32S3_CAM_LCD //#define CAMERA_MODEL_DFRobot_FireBeetle2_ESP32S3 // Has PSRAM //#define CAMERA_MODEL_DFRobot_Romeo_ESP32S3 // Has PSRAM

include "camera_pins.h"

// =========================== // Enter your WiFi credentials // =========================== const char ssid = ""; const char password = "";

void startCameraServer(); void setupLedFlash(int pin);

void setup() { Serial.begin(115200); Serial.setDebugOutput(true); Serial.println();

camera_config_t config; config.ledc_channel = LEDC_CHANNEL_0; config.ledc_timer = LEDC_TIMER_0; config.pin_d0 = Y2_GPIO_NUM; config.pin_d1 = Y3_GPIO_NUM; config.pin_d2 = Y4_GPIO_NUM; config.pin_d3 = Y5_GPIO_NUM; config.pin_d4 = Y6_GPIO_NUM; config.pin_d5 = Y7_GPIO_NUM; config.pin_d6 = Y8_GPIO_NUM; config.pin_d7 = Y9_GPIO_NUM; config.pin_xclk = XCLK_GPIO_NUM; config.pin_pclk = PCLK_GPIO_NUM; config.pin_vsync = VSYNC_GPIO_NUM; config.pin_href = HREF_GPIO_NUM; config.pin_sccb_sda = SIOD_GPIO_NUM; config.pin_sccb_scl = SIOC_GPIO_NUM; config.pin_pwdn = PWDN_GPIO_NUM; config.pin_reset = RESET_GPIO_NUM; config.xclk_freq_hz = 20000000; config.frame_size = FRAMESIZE_UXGA; config.pixel_format = PIXFORMAT_JPEG; // for streaming //config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition config.grab_mode = CAMERA_GRAB_WHEN_EMPTY; config.fb_location = CAMERA_FB_IN_PSRAM; config.jpeg_quality = 12; config.fb_count = 1;

// if PSRAM IC present, init with UXGA resolution and higher JPEG quality // for larger pre-allocated frame buffer. if (config.pixel_format == PIXFORMAT_JPEG) { if (psramFound()) { config.jpeg_quality = 10; config.fb_count = 2; config.grab_mode = CAMERA_GRAB_LATEST; } else { // Limit the frame size when PSRAM is not available config.frame_size = FRAMESIZE_SVGA; config.fb_location = CAMERA_FB_IN_DRAM; } } else { // Best option for face detection/recognition config.frame_size = FRAMESIZE_240X240;

if CONFIG_IDF_TARGET_ESP32S3

config.fb_count = 2;

endif

}

if defined(CAMERA_MODEL_ESP_EYE)

pinMode(13, INPUT_PULLUP); pinMode(14, INPUT_PULLUP);

endif

// camera init esp_err_t err = esp_camera_init(&config); if (err != ESP_OK) { Serial.printf("Camera init failed with error 0x%x", err); return; }

sensor_t *s = esp_camera_sensor_get(); // initial sensors are flipped vertically and colors are a bit saturated if (s->id.PID == OV3660_PID) { s->set_vflip(s, 1); // flip it back s->set_brightness(s, 1); // up the brightness just a bit s->set_saturation(s, -2); // lower the saturation } // drop down frame size for higher initial frame rate if (config.pixel_format == PIXFORMAT_JPEG) { s->set_framesize(s, FRAMESIZE_QVGA); }

if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)

s->set_vflip(s, 1); s->set_hmirror(s, 1);

endif

if defined(CAMERA_MODEL_ESP32S3_EYE)

s->set_vflip(s, 1);

endif

// Setup LED FLash if LED pin is defined in camera_pins.h

if defined(LED_GPIO_NUM)

setupLedFlash(LED_GPIO_NUM);

endif

WiFi.begin(ssid, password); WiFi.setSleep(false);

while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected");

startCameraServer();

Serial.print("Camera Ready! Use 'http://"); Serial.print(WiFi.localIP()); Serial.println("' to connect"); }

void loop() { // Do nothing. Everything is done in another task by the web server delay(10000); }

thanks a lot!

WangYuxin-esp commented 2 months ago

This may be a hardware issue, check the I2C (SCCB) pins on the baseboard.

Piyush-GG commented 2 months ago

I ran a 12c check and it said nothing was connected to it

WangYuxin-esp commented 2 months ago

Is the power pin of the sensor normal? Two devices with normal power supply and correctly connected I2C pins should be able to communicate with each other.

Piyush-GG commented 2 months ago

how do i check the connections?

saisankeerth40 commented 2 months ago

i got this error please i have to submit my project on 24 august

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0030,len:4832 load:0x40078000,len:16460 load:0x40080400,len:4 load:0x40080404,len:3504 entry 0x400805cc E (358) esp_cor⸮⸮VW }⸮⸮⸮͡⸮ No core dump partition found! E (358) esp_core_dump_flash: No core dump partition found!

E (512) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND) Camera init failed with error 0x105

i use arduino ide

Radmund commented 2 months ago
  • Used #define CAMERA_MODEL_AI_THINKER AND #define CAMERA_MODEL_ESP32_CAM_BOARD

This works for esp32-cam with ov2460 from AIThinker

I also did this hack:

define CAMERA_MODEL_AI_THINKERAND#define CAMERA_MODEL_ESP32_CAM_BOARD`

And it worked for me too. I was searching for days and sent even back some ESP32-CAM back, but now I got one from a good provider and still had the problem. after this hack it worked to my surprise. I must say I use the programmerboard ESP32-CAM-MB and the ESP32-CAM together and connect it to an USB port and now I see an IP address and have acces to the camserver. I must still test it without the programmerboard.Thanks

gpanton commented 6 days ago

This is late to the conversation, however I was experiencing many issues including memory. Strangle I was testing with two AI-thinkers, one working the other not. Compared the boot sequence and nothing apparent. Giving up I replaced the failing espcam. Wow, the same issue. I then out of frustration decided to replace the camera. Bugger me, the problem went away. Maybe I just did not seat the camera correctly, maybe a faulty camera, who cares it's resolved.