Esp32-s3 cam n16r8 using esp-idf in esphome

After much testing and reading many articles here, I’ve managed to configure my ESP32-S3-Wroom-1 N16R8 camera with the PSRAM working and using the ESP-IDF framework.

I bought the board on AliExpress:

https://es.aliexpress.com/item/1005007308040075.html?spm=a2g0o.order_list.order_list_main.5.21ef194dxPKxh9&gatewayAdapt=glo2esp
And the code to configure it is as follows
:

esphome:
  name: camara-prueba
  friendly_name: Cámara Prueba
esp32:
  board: esp32-s3-devkitc1-n16r8
  framework:
    type: esp-idf
psram:
  mode: octal
  speed: 80MHz

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: !secret api_key_cam

ota:
  - platform: esphome
    password: !secret pass_ota_cam

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: True
  power_save_mode: NONE
  manual_ip: 
    static_ip: xxx.xxx.xxx.xxx
    gateway: xxx.xxx.xxx.xxx
    subnet: xxx.xxx.xxx.xxx

mdns:
  disabled: False  
  
#captive_portal:

# Configuración i2c  
i2c:
  - id: cam_i2c
    sda: GPIO4
    scl: GPIO5
camera_encoder:
  type: esp32_camera
  quality: 70
  buffer_size: 2097152

# make sure to use the correct GPIO pins for your particular ESP32 model
esp32_camera:
  id: espcam
  name: Cámara Prueba
  external_clock:
    pin: GPIO15
    frequency: 20MHz
  i2c_id: cam_i2c
  data_pins: [GPIO11, GPIO9, GPIO8, GPIO10, GPIO12, GPIO18, GPIO17, GPIO16]
  vsync_pin: GPIO6
  href_pin: GPIO7
  pixel_clock_pin: GPIO13
  resolution: 1024X768 # my default
  jpeg_quality: 10
  max_framerate: 30fps
  idle_framerate: 0.1fps
  frame_buffer_count: 2
  vertical_flip: false
  horizontal_mirror: false
  aec_mode: AUTO
  aec2: True

# Intensidad de la señal WiFi y Temperatura de la Cámara
sensor:
  - platform: wifi_signal
    name: WiFi Signal Cámara Prueba
    update_interval: 60s
  - platform: internal_temperature
    name: Internal Temperature Cámara Prueba

# Configuración del servidor web
esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot
    
# Botón para resetear el módulo
switch:
  - platform: restart
    name: esp-cam restart

I hope this can be of help to someone.

I’ve also posted it on:
https://github.com/JVRMTS/ESP32S3-CAMERA-N16R8

1 Like

Wasn’t there an option for PSRAM size for the compiler in recent changes for certain ESP32 chips?

I’m already specifying it by selecting esp32s3 n16r8 as the board; if I’m wrong and someone knows, please tell me.