CircuitPython 8 and 9 use a new importable camera module for Espressif ESP32 microcontrollers including the ESP32, the ESP32-S2, and the ESP32-S3. It's just different enough from the adafruit_ov#### modules that different code is needed.
Requirements:
- A compatible board and microcontroller with PSRAM
- A build of CircuitPython 8 or newer with the espcamera built in module enabled
- A supported camera, connected properly
At the moment, we really like the esp32-s3-eye from Espressif since it packs a 2-megapixel camera and LCD into a cute little development kit. The following examples are all coded for this board.
CircuitPython 9 does not require reserving PSRAM: the CIRCUITPYRESERVEDPSRAM= directive is ignored. Read the below only if you are using CircuitPython 8.
Configure reserved PSRAM (CircuitPython 8 only)
The camera captures images to a special region of RAM called "reserved PSRAM". This is a portion of RAM that is set aside and cannot be used for regular Python objects, but can be used by espcamera (as well as other behind the scenes activity such as sockets and networking that are managed by esp-idf). The large size of images, especially bitmap images, are why psram is required for espcamera.
Boards like the esp32-s3-eye that include a camera module built in already reserve a fixed amount of PSRAM, usually 1MiB (1048576 bytes). For other boards, or if you want to fine-tune the default reserved value, you must place a line in the CIRCUITPY/.env file with the amount, such as:
CIRCUITPY_RESERVED_PSRAM=1048576
After updating the .env file, you must hard-reset the board for the change to take effect. You can verify the setting in the repl:
>>> import espidf >>> espidf.get_reserved_psram() 1048576
Continue to the next pages for some examples! First up: LCD Viewfinder.
Text editor powered by tinymce.