Skip to content

Commit ccf93da

Browse files
committed
Update examples with async camera capture and update workflow to use forked version of camera package.
1 parent eb3bccb commit ccf93da

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.github/workflows/ESP32.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ jobs:
8282
cd esp-idf
8383
./install.sh all
8484
cd components
85-
latest_cam_driver=$(curl -s https://api.github.com/repos/espressif/esp32-camera/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
86-
git clone --depth 1 --branch $latest_cam_driver https://github.com/espressif/esp32-camera.git
87-
# git clone https://github.com/cnadler86/esp32-camera.git
85+
# latest_cam_driver=$(curl -s https://api.github.com/repos/espressif/esp32-camera/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
86+
# git clone --depth 1 --branch $latest_cam_driver https://github.com/espressif/esp32-camera.git
87+
git clone https://github.com/cnadler86/esp32-camera.git
8888
cd ~/esp-idf/
8989
source ./export.sh
9090
@@ -183,6 +183,6 @@ jobs:
183183
- name: Upload firmware artifact
184184
uses: actions/upload-artifact@v4
185185
with:
186-
name: firmware-${{ env.FW_NAME }}
186+
name: mpy_cam-${{ env.MPY_RELEASE }}-${{ env.FW_NAME }}
187187
path: ~/artifacts/**
188188
retention-days: 5

examples/CameraSettings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import network
22
import asyncio
33
import time
4-
from camera import Camera, FrameSize, PixelFormat
4+
from acamera import Camera, FrameSize, PixelFormat # Import the async version of the Camera class, you can also use the sync version (camera.Camera)
55

66
cam = Camera(frame_size=FrameSize.VGA, pixel_format=PixelFormat.JPEG, jpeg_quality=85, init=False)
77
# WLAN config
@@ -34,7 +34,7 @@ async def stream_camera(writer):
3434
await writer.drain()
3535

3636
while True:
37-
frame = cam.capture()
37+
frame = await cam.acapture() # This is the async version of capture, you can also use frame = cam.capture() instead
3838
if frame:
3939
if cam.get_pixel_format() == PixelFormat.JPEG:
4040
writer.write(b'--frame\r\nContent-Type: image/jpeg\r\n\r\n')

src/micropython.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include(${MICROPY_DIR}/py/py.cmake)
2-
message (STATUS "Current manifest file: ${MICROPY_FROZEN_MANIFEST}")
32

43
set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py)
54

0 commit comments

Comments
 (0)