Open
Description
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.1-39-g3032d4e7d5 on 2023-09-13; M5Stack Timer Camera X with ESP32
Code/REPL
import espcamera, board
a = espcamera.Camera(data_pins=board.D, pixel_clock_pin=board.PCLK, vsync_pin=board.VSYNC, href_pin=board.HREF, i2c=board.SSCB_I2C(), external_clock_pin=board.XCLK, external_clock_frequency=20_000_000, powerdown_pin=None, reset_pin=board.RESET, pixel_format=espcamera.PixelFormat.JPEG, frame_size=espcamera.FrameSize.QXGA, jpeg_quality=2, framebuffer_count=1, grab_mode=espcamera.GrabMode.LATEST)
try:
while True:
b = a.take(1)
print(type(b))
del b
except KeyboardInterrupt:
pass
Behavior
<class 'memoryview'>
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
<class 'NoneType'>
Description
If I cover the lens, this makes the photos really tiny in terms of data and it always succeeds.
This leads me to believe lower qualities need more proccessing and lead to failure even if they get a bigger timeout.
(I tried giving it 20s, docs state the time is in ms, but it's not, it's actually seconds, I will correct that later)
If I also just raise the quality slowly, the success rate increases.
Around 12 it becomes almost 100% regardless of what is in the frame.
Sharp contrasts, like 50% of the lens being black and the other 50% staring at my ceiling light make it fail a lot more.
If I just set the quality to 55 which is the max, it never fails or lags.
Additional information
ov3660