Skip to content

Add support for ESP32-WROVER-DEV boards with Camera#9233

Merged
tannewt merged 3 commits intoadafruit:mainfrom
gitcnd:add-board-esp32-wrover-dev-cam
May 20, 2024
Merged

Add support for ESP32-WROVER-DEV boards with Camera#9233
tannewt merged 3 commits intoadafruit:mainfrom
gitcnd:add-board-esp32-wrover-dev-cam

Conversation

@gitcnd
Copy link

@gitcnd gitcnd commented May 9, 2024

This adds support for the ESP32-WROVER-DEV boards (alternatively named ESP32-WROVER-CAM by other manufacturers)

Board Feature			Circuitpython Status
=============                   ====================
Take photos with camera		Tested + Working
Wifi				Tested + Working
Inbuilt RED LED                 Tested + Working
ESP32-CAM-MB Button		Tested + Working
Bluetooth			Not tested
Others				There are no other features I know of

Here is my working sample script which takes a photo (and saves it to "out.jpg" in flash)

import io
import os
import board
import espcamera
import socketpool

cam = espcamera.Camera(
    data_pins=board.CAMERA_DATA,
    external_clock_pin=board.CAMERA_XCLK,
    pixel_clock_pin=board.CAMERA_PCLK,
    vsync_pin=board.CAMERA_VSYNC,
    href_pin=board.CAMERA_HREF,
    powerdown_pin=board.CAMERA_PWDN,
    reset_pin=None,
    i2c=board.I2C(),
    external_clock_frequency=20_000_000,
    pixel_format=espcamera.PixelFormat.JPEG,
    frame_size=espcamera.FrameSize.SVGA,
    # jpeg_quality=0,
    # framebuffer_count=0,
    # grab_mode=espcamera.GrabMode.WHEN_EMPTYi
    )

if True:
    frame = cam.take(1)
    fn="out.jpg"
    if isinstance(frame, memoryview):
        jpeg = frame
        print(f"Captured {len(jpeg)} bytes of jpeg data")
        with open(fn, 'wb') as f:
            f.write(jpeg)
        print(f"written to {fn}")

Here is the button test code

import board
import digitalio
import time

# Set up the button pin
button = digitalio.DigitalInOut(board.BUTTON)
button.direction = digitalio.Direction.INPUT
button.pull = digitalio.Pull.UP  

while True:
    button_state = button.value
    if button_state:
        print("Button is released")
    else:
        print("Button is pressed")
    time.sleep(0.7) 

This board uses different camera pins to my previous PR for the ESP32-CAM, however, python code written for either board works on both of these without change.

Here are my notes:-

pic_2024-05-10_03 40 50_562

@gitcnd
Copy link
Author

gitcnd commented May 9, 2024

Be aware of a common hardware fault on some of these - the power regulators are backwards ...

You may need to swap the 2 power regulators (65BX and 54FK) which got soldered in the wrong way around! See pic - cheap copy at top, original at bottom :-

a5d0fe8f1b61a2e39d502354380d51127bafeaae

issue symptoms are undetectable or intermittently failing camera.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the board def. Let's not attribute this board to espressif at all. Instead let's add a separate creator id for freenove.

@gitcnd gitcnd marked this pull request as draft May 14, 2024 23:56
@gitcnd gitcnd marked this pull request as ready for review May 15, 2024 13:30
@gitcnd
Copy link
Author

gitcnd commented May 15, 2024

OK - got a new ID sorted for Freenove, and updated the name and ID in the relevant files.

@gitcnd gitcnd requested a review from tannewt May 15, 2024 13:34
@gitcnd
Copy link
Author

gitcnd commented May 18, 2024

Should be ready to merge now - the PR for the new IDs is creationid/creators#69

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit 2854dbe into adafruit:main May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants