ESP32-S3 + OV5640: RGB565 works, but JPEG fails during Camera() initialization #60
Unanswered
Prototype0S
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I'm trying to use an OV5640 camera with an ESP32-S3 WROOM N16R8 using the
micropython-camera-API.I'm using the precompiled firmware:
mpy_cam-v1.27.0-ESP32_GENERIC_S3-SPIRAM_OCTMicroPython reports:
MicroPython v1.27.0-dirty on 2026-01-12
ESP32S3 Generic ESP32S3 module with Octal-SPIRAM
The board has 16 MB flash and 8 MB PSRAM.
esp.flash_size()reports:16777216I can initialize and capture from the OV5640 reliably using RGB565 at QQVGA.
This configuration works:
python
from camera import Camera, PixelFormat, FrameSize
cam = Camera(
data_pins=[11, 9, 8, 10, 12, 18, 17, 16],
vsync_pin=6,
href_pin=7,
sda_pin=4,
scl_pin=5,
pclk_pin=13,
xclk_pin=15,
xclk_freq=20000000,
powerdown_pin=-1,
reset_pin=-1,
pixel_format=PixelFormat.RGB565,
frame_size=FrameSize.QQVGA
)
It reports:
Sensor: OV5640
Pixel format: 0
Frame size: 1
Width: 160
Height: 120
Quality: 85
Grab mode: 1
FB count: 2
RGB565 capture is stable at roughly 20 FPS.
However, if I change only:
python
pixel_format=PixelFormat.RGB565
to:
python
pixel_format=PixelFormat.JPEG
the constructor fails with:
text
OSError: Failed to capture initial frame. Construct a new object with appropriate configuration.
I've also tried:
GrabMode.LATESTGrabMode.WHEN_EMPTYjpeg_quality=85/90fb_count=2With
reconfigure(), the pixel format changes to JPEG successfully, butframe_available()remains false andcapture()returnsNone.The failure therefore appears to be specifically related to JPEG frame acquisition with this OV5640/ESP32-S3 combination, rather than the pin configuration or basic camera initialization.
My
cameramodule contains:['class', 'name', 'Camera', 'FrameSize',
'GainCeiling', 'GrabMode', 'PixelFormat', 'dict']
There is no
camera.Version()in this build.My questions
mpy_cam-v1.27.0-ESP32_GENERIC_S3-SPIRAM_OCT?esp32-cameraversion?I'm happy to provide any additional logs or test results.
Thanks!
All reactions