ESP32 wrover b connected to ov 2640 camera , is it is supported bz edgeimpulse

Question/Issue:
[i have a project to detect emergency vehicles, for this i have esp32 wrover b and ov 2640 camera , i have trained a model in edge impulse studio and exported this trained model as ardunio library when training the model i have chosen esp32 eye as the target model but once i open in ardunio ide i found the entire trained model is based on esp 32 eye …so i have modified the code according to the esp32wrover and its camera pin connections.but when i compile the code its showing in serial monitor as guru meditation error and some times the flash memory problem . so i would highly appreciate the suggestions which would be better esp32 micro controller to do emergency vehicle detection …should i use the actual esp 32 eye and also how can i resolve the flash memory problem in esp 32 wrover b

Project ID:
[Provide the project ID]

Context/Use case:
]

Steps Taken:

  1. [Step 1]
  2. [Step 2]
  3. [Step 3]

Expected Outcome:
[Describe what you expected to happen]

Actual Outcome:
[Describe what actually happened]

Reproducibility:

  • [ ] Always
  • [ ] Sometimes
  • [ ] Rarely

Environment:

  • Platform: [e.g., Raspberry Pi, nRF9160 DK, etc.]
  • Build Environment Details: [e.g., Arduino IDE 1.8.19 ESP32 Core for Arduino 2.0.4]
  • OS Version: [e.g., Ubuntu 20.04, Windows 10]
  • Edge Impulse Version (Firmware): [e.g., 1.2.3]
  • To find out Edge Impulse Version:
  • if you have pre-compiled firmware: run edge-impulse-run-impulse --raw and type AT+INFO. Look for Edge Impulse version in the output.
  • if you have a library deployment: inside the unarchived deployment, open model-parameters/model_metadata.h and look for EI_STUDIO_VERSION_MAJOR, EI_STUDIO_VERSION_MINOR, EI_STUDIO_VERSION_PATCH
  • Edge Impulse CLI Version: [e.g., 1.5.0]
  • Project Version: [e.g., 1.0.0]
  • Custom Blocks / Impulse Configuration: [Describe custom blocks used or impulse configuration]
    Logs/Attachments:
    [Include any logs or screenshots that may help in diagnosing the issue]

Additional Information:
[Any other information that might be relevant]

Hi, @husna123
Which exact ESP32 dev kit do you have? Can you send the link to its specs perhaps?

Hai,
thanks for the response. im using esp 32 wrover b development board connected to ov 2640 camera . and the following is my code that i uploaded in ardunio ide #include <WiFi.h>
#include “esp_camera.h”
#include <Emergency_Vehicle_detection_inferencing.h> // Edge Impulse model header

// — OV2640 CAMERA PINS FOR ESP32-WROVER-B —
#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 VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22

#define Y2_GPIO_NUM 5
#define Y3_GPIO_NUM 18
#define Y4_GPIO_NUM 19
#define Y5_GPIO_NUM 21
#define Y6_GPIO_NUM 36
#define Y7_GPIO_NUM 39
#define Y8_GPIO_NUM 34
#define Y9_GPIO_NUM 35

camera_fb_t *fb = NULL;
uint8_t *resized_image = NULL;

// Convert RGB565 to Grayscale and resize
bool convert_rgb565_to_grayscale(camera_fb_t *fb, uint8_t *out_buf) {
if (!fb || fb->format != PIXFORMAT_RGB565) return false;

uint32_t in_w = fb->width;
uint32_t in_h = fb->height;
uint32_t out_w = EI_CLASSIFIER_INPUT_WIDTH;
uint32_t out_h = EI_CLASSIFIER_INPUT_HEIGHT;

for (uint32_t y = 0; y < out_h; y++) {
for (uint32_t x = 0; x < out_w; x++) {
uint32_t src_x = x * in_w / out_w;
uint32_t src_y = y * in_h / out_h;
uint32_t src_index = (src_y * in_w + src_x) * 2;

  uint8_t byte1 = fb->buf[src_index];
  uint8_t byte2 = fb->buf[src_index + 1];
  uint16_t pixel = (byte2 << 8) | byte1;

  uint8_t r = ((pixel >> 11) & 0x1F) << 3;
  uint8_t g = ((pixel >> 5) & 0x3F) << 2;
  uint8_t b = (pixel & 0x1F) << 3;

  uint8_t gray = (uint8_t)(0.299f * r + 0.587f * g + 0.114f * b);
  out_buf[y * out_w + x] = gray;
}

}
return true;
}

int get_signal_data(size_t offset, size_t length, float *out_ptr) {
for (size_t i = 0; i < length; i++) {
out_ptr[i] = resized_image[offset + i] / 255.0f;
}
return 0;
}

void setupCamera() {
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.pixel_format = PIXFORMAT_RGB565;
config.frame_size = FRAMESIZE_QVGA; // 320x240
config.fb_location = CAMERA_FB_IN_PSRAM;
config.jpeg_quality = 12;
config.fb_count = 1;
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY; // Helps prevent initialization issues

esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf(“Camera init failed with error 0x%x\n”, err);
while (true);
}
}

void setup() {
Serial.begin(115200);
delay(1000);

setupCamera();

resized_image = (uint8_t *)malloc(EI_CLASSIFIER_INPUT_WIDTH * EI_CLASSIFIER_INPUT_HEIGHT);
if (!resized_image) {
Serial.println(“Memory allocation failed for resized image”);
while (true);
}

Serial.println(“Camera and model initialized. Point the camera at emergency vehicles.”);
}

void loop() {
fb = esp_camera_fb_get();
if (!fb) {
Serial.println(“Camera capture failed”);
delay(1000);
return;
}

if (!convert_rgb565_to_grayscale(fb, resized_image)) {
Serial.println(“Image format conversion failed”);
esp_camera_fb_return(fb);
delay(1000);
return;
}

esp_camera_fb_return(fb);

ei::signal_t signal;
signal.total_length = EI_CLASSIFIER_INPUT_WIDTH * EI_CLASSIFIER_INPUT_HEIGHT;
signal.get_data = &get_signal_data;

ei_impulse_result_t result = { 0 };
EI_IMPULSE_ERROR res = run_classifier(&signal, &result, false);
if (res != EI_IMPULSE_OK) {
Serial.println(“Inference failed”);
delay(1000);
return;
}

Serial.println(“Predictions:”);
for (size_t ix = 0; ix < EI_CLASSIFIER_LABEL_COUNT; ix++) {
Serial.print(" “);
Serial.print(result.classification[ix].label);
Serial.print(”: ");
Serial.println(result.classification[ix].value, 3);
}

delay(1000);
} and this is what the output i got
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:0x3fff0030,len:4980
load:0x40078000,len:16612
load:0x40080400,len:3480
entry 0x400805b4
E (1060) camera: Detected camera not supported.
E (1060) camera: Camera probe failed with error 0x106(ESP_ERR_NOT_SUPPORTED)
Camera init failed with error 0x106.
and this is what the output i got in serial monitor

This is all not very useful. esp 32 wrover b is not the name of the development kit, it’s the name of the SoM.
Do you know which exact dev kit do you use? Can you send a link to where you bought it?
Usually there is some documentation and examples coming with the board, where you can see the pins used.