Closed AthenasArch closed 11 months ago
Hello, @AthenasArch , Can it work properly when configured as VGA ?
Hello i'am also getting same error , i'am uisng OV5640 camera and trying to use PIXFORMAT_YUV422
pixel format with frame size FRAMESIZE_HVGA
below is the camera configuration
esp_err_t initCameraSettings(void)
{
//Camera configuration
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 = 24000000;
config.pixel_format = PIXFORMAT_YUV422;
if (psramFound())
{
config.frame_size = FRAMESIZE_HVGA;
config.jpeg_quality = 20;
config.fb_count = 2;
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
config.fb_location = CAMERA_FB_IN_PSRAM;
}
else
{
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 12;
config.fb_count = 1;
}
and i'am getting below logs
E (50637) cam_hal: FB-SIZE: 294400 != 960000
E (51459) cam_hal: FB-SIZE: 294400 != 960000
E (52281) cam_hal: FB-SIZE: 294400 != 960000
E (53103) cam_hal: FB-SIZE: 294400 != 960000
E (53925) cam_hal: FB-SIZE: 294400 != 960000
and an important thing to be noted is PIXFORMAT_JPEG
works fine its not throwing any error and when i try to use PIXFORMAT_YUV422
IN Arduino IDE it's work fine
Man, this could be your camera's resolution size setting. I adjusted the settings to what the datasheet says and it worked.
This software has been tested on the camera BF3005.
void setup() {
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
Serial.begin(115200);
delay(7000);
Serial.setDebugOutput(true);
Serial.println();
Serial.println("V1.0.16 - Inicializa comunicacao Serial");
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_RGB565; // PIXFORMAT_GRAYSCALE; //PIXFORMAT_YUV422; // PIXFORMAT_YUV420; // PIXFORMAT_RGB565;
// config.sccb_i2c_port = 1;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if(psramFound()){
Serial.println("SIM - ENCONTROU PSRAM");
config.frame_size = FRAMESIZE_HQVGA;
config.jpeg_quality = 4;
config.fb_count = 6;
config.grab_mode = CAMERA_GRAB_LATEST;
config.fb_location = CAMERA_FB_IN_PSRAM;
} else {
Serial.println("NAO - find PSRAM");
config.frame_size = FRAMESIZE_VGA;
config.jpeg_quality = 12;
config.fb_count = 2;
}
#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;
} else {
Serial.println("Camera init OK.");
}
sensor_t * s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
Serial.println("Modelo da camera 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
} else if (s->id.PID == BF3005_PID){
Serial.println("Modelo da camera BF3005_PID");
}
// 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");
}
hello @AthenasArch what about ov5640 its not suporting yuv422 format in esp idf but when i run same code in arduino ide and flash it it works perfectly do i need to change any menuconfig settings can you tell me and what's this error mean E (53925) cam_hal: FB-SIZE: 294400 != 960000
and why this 960000
is constant i think i need to change this but i donno how to
This error occurs when the format you are trying to send to the camera is different from the ideal format for the camera. It is usually related to camera resolution and frequency. I recommend you set a lower frequency, closer to 10000000
config.xclk_freq_hz = 10000000;
// see datasheet to configure this: pixel_format.
config.pixel_format=PIXFORMAT_RGB565; //PIXFORMAT_GRAYSCALE; //PIXFORMAT_YUV422; //PIXFORMAT_YUV420; //PIXFORMAT_RGB565;
// if PSRAM IC is present, boot with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
config.frame_size=FRAMESIZE_HQVGA;
config.jpeg_quality = 4; // See ddatasheet
config.fb_count = 6; // See ddatasheet
config.grab_mode = CAMERA_GRAB_LATEST;
config.fb_location = CAMERA_FB_IN_PSRAM; // if you use PSRAM.
Hello @AthenasArch, I appreciate your response. Regarding the YUV422 format, I understand that a frequency of 24MHz is required. I have successfully implemented the same configuration in the Arduino IDE, and I am able to view photos. Therefore, I believe that there might be some adjustments needed in the menuconfig settings. If you require any additional information, please let me know. Thank you.
Hello @AthenasArch i have tested what you have suggested by lowering the frequency still im getting same error no change
This issue appears to be stale. Please close it if its no longer valid.
I'm having trouble configuring the BF3005 camera on the Arduino IDE with ESP32.
It returns the log: E (8433) cam_hal: FB-SIZE: 149760 != 153600
And, if I understand correctly, the calculation is FRAMESIZE_QVGA = 320 x 240 x 565bits color
then 320 x 240 x 2 = 153600, is that correct?
but I don't know why the camera is returning me: 149760, can you help me?
E (8061) cam_hal: FB-SIZE: 149760 != 153600 E (8095) cam_hal: FB-SIZE: 149760 != 153600 E (8129) cam_hal: FB-SIZE: 149760 != 153600 E (8163) cam_hal: FB-SIZE: 149760 != 153600 E (8196) cam_hal: FB-SIZE: 149760 != 153600 E (8230) cam_hal: FB-SIZE: 149760 != 153600 E (8264) cam_hal: FB-SIZE: 149760 != 153600 E (8298) cam_hal: FB-SIZE: 149760 != 153600 E (8331) cam_hal: FB-SIZE: 149760 != 153600 E (8365) cam_hal: FB-SIZE: 149760 != 153600 E (8399) cam_hal: FB-SIZE: 149760 != 153600 E (8433) cam_hal: FB-SIZE: 149760 != 153600 E (8466) cam_hal: FB-SIZE: 149760 != 153600 E (8500) cam_hal: FB-SIZE: 149760 != 153600 E (8534) cam_hal: FB-SIZE: 149760 != 153600 E (8568) cam_hal: FB-SIZE: 149760 != 153600 E (8601) cam_hal: FB-SIZE: 149760 != 153600