Esp32 cam Error

Esp32 cam's example code i.e Webserver works fine on Arduino ide but the same when done in cloud , the code compiles and even uploads , the webserver starts too and esp connects to my wifi then to Arduino iot cloud but in the serial monitor the camera shows error

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

The code and output I'll upload in a couple of hours pls explain what I'm doing wrong

I think we'll need the full verbose output from both the compilation in the Arduino IDE and in the Arduino Web Editor. I'll provide specific instructions for both:


Arduino IDE

Please do this:

  1. Select File > Preferences from the Arduino IDE's menus.
  2. Check the box next to "Show verbose output during: compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE's menus.
  5. Wait for the compilation to finish.
  6. Click on the black console pane at the bottom of the Arduino IDE window.
  7. Press Ctrl+A to select all the text.
  8. Press Ctrl+C to copy the selected text to the clipboard.
  9. Open a forum reply here by clicking the Reply button.
  10. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the compilation output is correctly formatted.
    Code block
  11. Press Ctrl+V. This will paste the compilation output into the code block.
  12. Move the cursor outside of the code tags before you add any additional text to your reply.
  13. Click the Reply button to post the output.

Arduino Web Editor

Please do this:

  1. From the menu on the left side of the Arduino Web Editor window, click "Preferences".
  2. Check the box next to " Always show output panel".
  3. Check the box next to " Console: Show verbose output".
  4. In the sketch pane, click the :heavy_check_mark: (verify) button.
  5. After the compilation finishes, click the icon in the top right corner of the black console window at the bottom of the Arduino Web Editor window that looks like two pieces of paper.
  6. In a forum reply here, click on the reply field.
  7. Click the </> button on the forum toolbar. This will add the forum's code block markup (```) to your reply to make sure the compilation output is correctly formatted.
    codetags
  8. Press Ctrl+V. This will paste the compilation output between the code tags.
  9. Move the cursor outside of the code tags before you add any additional text to your reply.
  10. Click the Reply button to post the output.

Code for web editor

#include "esp_camera.h"
#include <WiFi.h>
#include "thingProperties.h"
//
// 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
//

// Select camera model
//define CAMERA_MODEL_WROVER_KIT // Has PSRAM
//#define CAMERA_MODEL_ESP_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_AI_THINKER // Has PSRAM
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM

#include "camera_pins.h"

const char* ssid = "Vijan's";
const char* password = "9323615121";

void startCameraServer();

void setup() {
  Serial.begin(115200);
  delay(1500);
  
   initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  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 = 10000000;
  config.pixel_format = PIXFORMAT_JPEG;
  
  // if PSRAM IC present, init with UXGA resolution and higher JPEG quality
  //                      for larger pre-allocated frame buffer.
  if(psramFound()){
    config.frame_size = FRAMESIZE_UXGA;
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  }

#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
  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

  WiFi.begin(ssid, password);

  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");
 
  
  /*
     The follow
  // Connect to Arduino IoT Cloud
  ing function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(10000);
   ArduinoCloud.update();
}

void onLedChange() {
  if(led ==1){digitalWrite(2,HIGH);}
  else{digitalWrite(2,LOW);}
  // Do something
}

Output

ets Jun  8 2016 00:22:57

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:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

.....
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://192.168.0.106' to connect
***** Arduino IoT Cloud - configuration info *****
Device ID: 6c015ece-bb69-4696-9f4d-d05491cb52ac
Thing ID: 76e76762-a359-4f82-bbf3-3443ca14588e
MQTT Broker: mqtts-up.iot.arduino.cc:8884
WiFi status ESP: 3
Connected to "Vijan's"
Connected to Arduino IoT Cloud
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!
Camera capture failed

problem is as soon as it connects to wifi and iot cloud the stream stops

ets Jun  8 2016 00:22:57

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:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

.......
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://192.168.0.106' to connect
***** Arduino IoT Cloud - configuration info *****
Device ID: 6c015ece-bb69-4696-9f4d-d05491cb52ac
Thing ID: 76e76762-a359-4f82-bbf3-3443ca14588e
MQTT Broker: mqtts-up.iot.arduino.cc:8884
JPG: 4016B 58ms
MJPG: 3624B 4ms (250.0fps), AVG: 4ms (250.0fps), 0+0+0+0=0 0
MJPG: 3719B 42ms (23.8fps), AVG: 23ms (43.5fps), 0+0+0+0=0 0
MJPG: 3602B 34ms (29.4fps), AVG: 26ms (38.5fps), 0+0+0+0=0 0
MJPG: 4800B 40ms (25.0fps), AVG: 30ms (33.3fps), 0+0+0+0=0 0
MJPG: 4143B 39ms (25.6fps), AVG: 31ms (32.3fps), 0+0+0+0=0 0
MJPG: 3797B 47ms (21.3fps), AVG: 34ms (29.4fps), 0+0+0+0=0 0
MJPG: 4121B 32ms (31.2fps), AVG: 34ms (29.4fps), 0+0+0+0=0 0
MJPG: 4013B 45ms (22.2fps), AVG: 35ms (28.6fps), 0+0+0+0=0 0
MJPG: 3977B 34ms (29.4fps), AVG: 35ms (28.6fps), 0+0+0+0=0 0
MJPG: 5366B 714ms (1.4fps), AVG: 103ms (9.7fps), 0+0+0+0=0 0
MJPG: 3601B 2ms (500.0fps), AVG: 93ms (10.8fps), 0+0+0+0=0 0
MJPG: 3606B 46ms (21.7fps), AVG: 89ms (11.2fps), 0+0+0+0=0 0
MJPG: 3592B 34ms (29.4fps), AVG: 85ms (11.8fps), 0+0+0+0=0 0
MJPG: 3609B 68ms (14.7fps), AVG: 84ms (11.9fps), 0+0+0+0=0 0
MJPG: 3603B 11ms (90.9fps), AVG: 79ms (12.7fps), 0+0+0+0=0 0
MJPG: 3613B 49ms (20.4fps), AVG: 77ms (13.0fps), 0+0+0+0=0 0
MJPG: 3591B 30ms (33.3fps), AVG: 74ms (13.5fps), 0+0+0+0=0 0
MJPG: 4000B 43ms (23.3fps), AVG: 73ms (13.7fps), 0+0+0+0=0 0
MJPG: 3593B 35ms (28.6fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3578B 45ms (22.2fps), AVG: 69ms (14.5fps), 0+0+0+0=0 0
MJPG: 3610B 34ms (29.4fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3603B 46ms (21.7fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3606B 33ms (30.3fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3592B 45ms (22.2fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3594B 34ms (29.4fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 4000B 46ms (21.7fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3595B 33ms (30.3fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3577B 47ms (21.3fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3593B 32ms (31.2fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3597B 44ms (22.7fps), AVG: 37ms (27.0fps), 0+0+0+0=0 0
MJPG: 3563B 36ms (27.8fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
MJPG: 3588B 54ms (18.5fps), AVG: 39ms (25.6fps), 0+0+0+0=0 0
MJPG: 3593B 51ms (19.6fps), AVG: 40ms (25.0fps), 0+0+0+0=0 0
MJPG: 3601B 175ms (5.7fps), AVG: 46ms (21.7fps), 0+0+0+0=0 0
MJPG: 3603B 1ms (1000.0fps), AVG: 45ms (22.2fps), 0+0+0+0=0 0
MJPG: 3575B 75ms (13.3fps), AVG: 46ms (21.7fps), 0+0+0+0=0 0
MJPG: 4089B 39ms (25.6fps), AVG: 47ms (21.3fps), 0+0+0+0=0 0
MJPG: 3605B 43ms (23.3fps), AVG: 47ms (21.3fps), 0+0+0+0=0 0
MJPG: 3628B 35ms (28.6fps), AVG: 47ms (21.3fps), 0+0+0+0=0 0
MJPG: 3753B 45ms (22.2fps), AVG: 47ms (21.3fps), 0+0+0+0=0 0
MJPG: 3649B 34ms (29.4fps), AVG: 47ms (21.3fps), 0+0+0+0=0 0
MJPG: 3639B 46ms (21.7fps), AVG: 47ms (21.3fps), 0+0+0+0=0 0
MJPG: 3749B 490ms (2.0fps), AVG: 70ms (14.3fps), 0+0+0+0=0 0
MJPG: 3828B 2ms (500.0fps), AVG: 68ms (14.7fps), 0+0+0+0=0 0
MJPG: 3570B 132ms (7.6fps), AVG: 73ms (13.7fps), 0+0+0+0=0 0
MJPG: 3625B 1ms (1000.0fps), AVG: 70ms (14.3fps), 0+0+0+0=0 0
MJPG: 3433B 71ms (14.1fps), AVG: 72ms (13.9fps), 0+0+0+0=0 0
MJPG: 3534B 14ms (71.4fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3543B 54ms (18.5fps), AVG: 72ms (13.9fps), 0+0+0+0=0 0
MJPG: 3544B 25ms (40.0fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 3565B 84ms (11.9fps), AVG: 73ms (13.7fps), 0+0+0+0=0 0
MJPG: 4951B 10ms (100.0fps), AVG: 71ms (14.1fps), 0+0+0+0=0 0
MJPG: 4408B 76ms (13.2fps), AVG: 72ms (13.9fps), 0+0+0+0=0 0
MJPG: 3726B 28ms (35.7fps), AVG: 65ms (15.4fps), 0+0+0+0=0 0
MJPG: 4000B 59ms (16.9fps), AVG: 68ms (14.7fps), 0+0+0+0=0 0
MJPG: 4000B 20ms (50.0fps), AVG: 65ms (15.4fps), 0+0+0+0=0 0
MJPG: 3697B 43ms (23.3fps), AVG: 65ms (15.4fps), 0+0+0+0=0 0
MJPG: 3717B 36ms (27.8fps), AVG: 65ms (15.4fps), 0+0+0+0=0 0
MJPG: 3723B 49ms (20.4fps), AVG: 65ms (15.4fps), 0+0+0+0=0 0
MJPG: 3730B 30ms (33.3fps), AVG: 65ms (15.4fps), 0+0+0+0=0 0
MJPG: 3784B 63ms (15.9fps), AVG: 66ms (15.2fps), 0+0+0+0=0 0
MJPG: 3921B 59ms (16.9fps), AVG: 67ms (14.9fps), 0+0+0+0=0 0
MJPG: 4069B 3ms (333.3fps), AVG: 42ms (23.8fps), 0+0+0+0=0 0
MJPG: 6275B 117ms (8.5fps), AVG: 48ms (20.8fps), 0+0+0+0=0 0
WiFi status ESP: 3
Connected to "Vijan's"
JPG: 3910B 3ms
MJPG: 3901B 3ms (333.3fps), AVG: 42ms (23.8fps), 0+0+0+0=0 0
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!
Camera capture failed
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!
Camera capture failed
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!
Camera capture failed
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!
Camera capture failed
[E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!
Camera capture failed
Connected to Arduino IoT Cloud

Are you using different code in the Arduino IDE?

Yes in Arduino iot cloud the code takes input from the button widget whereas in IDE it takes it from a io pin, thats the little difference when I just use the example code of CameraWebServer in the web editor it works fine but as soon as thingsproperties.h and arduino_secrets.h is added this starts giving the camera error.

OK, so then it likely has nothing to do with the development software you are using. More likely, the different results you are observing are caused by the differences in the two sketches.

Can you guide me on what to do I want to run the webserver for the camera stream and control 4 motors and 1 led via iot cloud that's why I was adding void onledchange() in the the code .