Skip to content

Commit 76f8c1a

Browse files
committed
Change to espressif camera repo. Improved Readme and example
1 parent 680411a commit 76f8c1a

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.github/workflows/ESP32.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ jobs:
7878
cd esp-idf
7979
./install.sh all
8080
cd components
81-
# latest_cam_driver=$(curl -s https://api.github.com/repos/espressif/esp32-camera/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
82-
# git clone --depth 1 --branch $latest_tag https://github.com/espressif/esp32-camera.git
83-
git clone https://github.com/cnadler86/esp32-camera.git
81+
latest_cam_driver=$(curl -s https://api.github.com/repos/espressif/esp32-camera/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
82+
git clone --depth 1 --branch $latest_tag https://github.com/espressif/esp32-camera.git
83+
# git clone https://github.com/cnadler86/esp32-camera.git
8484
cd ~/esp-idf/
8585
source ./export.sh
8686

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![ESP32 Port](https://github.com/cnadler86/micropython-camera-API/actions/workflows/ESP32.yml/badge.svg)](https://github.com/cnadler86/micropython-camera-API/actions/workflows/ESP32.yml)
44

5-
This project aims to support various cameras on different MicroPython ports, starting with the ESP32 port and Omnivision (OV2640 & OV5640) cameras. The project implements a general API for cameras in micropython (such as circuitpython have done).
5+
This project aims to support various cameras (e.g. OV2640, OV5640) on different MicroPython ports, starting with the ESP32 port. The project implements a general API, has precompiled FW images and supports a lot of cameras out of the box.
66
At the moment, this is a micropython user module, but it might get in the micropython repo in the future.
77
The API is stable, but it might change without previous announce.
88

@@ -141,6 +141,10 @@ import camera
141141
vers = camera.Version()
142142
```
143143

144+
### Additional information
145+
146+
The FW images support the following cameras out of the box, but is therefore big: OV7670, OV7725, OV2640, OV3660, OV5640, NT99141, GC2145, GC032A, GC0308, BF3005, BF20A6, SC030IOT
147+
144148
## Build your custom FW
145149

146150
### Setting up the build environment (DIY method)
@@ -149,11 +153,11 @@ To build the project, follow these instructions:
149153

150154
- [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/v5.2.3/esp32/get-started/index.html): I used version 5.2.3, but it might work with other versions (see notes).
151155
- Clone the micropython repo and this repo in a folder, e.g. "MyESPCam". MicroPython version 1.24 or higher is required (at least commit 92484d8).
152-
- You will have to add the ESP32-Camera driver (I used v2.0.13). To do this, add the following to the respective idf_component.yml file (e.g. in micropython/ports/esp32/main_esp32s3/idf_component.yml):
156+
- You will have to add the ESP32-Camera driver (I used v2.0.15). To do this, add the following to the respective idf_component.yml file (e.g. in micropython/ports/esp32/main_esp32s3/idf_component.yml):
153157

154158
```yml
155159
espressif/esp32-camera:
156-
git: https://github.com/cnadler86/esp32-camera #At the moment I maintain a fork because of some unsolved bugs and conveniance.
160+
git: https://github.com/espressif/esp32-camera.git
157161
```
158162
159163
Alternatively, you can clone the <https://github.com/cnadler86/esp32-camera> repository inside the esp-idf/components folder instead of altering the idf_component.yml file.
@@ -221,6 +225,9 @@ Example for Xiao sense:
221225
#define MICROPY_CAMERA_GRAB_MODE (1) // 0=WHEN_EMPTY (might have old data, but less resources), 1=LATEST (best, but more resources)
222226

223227
```
228+
#### Customize additional camera settings
229+
230+
If you want to customize additional camera setting or reduce the FW size by removing support for unused camera sensors, then take a look at the kconfig file of the esp32-camera driver and specify these on the sdkconfig file of your board.
224231

225232
### Build the API
226233

@@ -268,6 +275,14 @@ Using fb_count=2 theoretically can double the FPS (see JPEG with fb_count=2). Th
268275

269276

270277
Looking at the results: image conversion make only sense for frame sized below QVGA or if capturing the image in the intended pixelformat and frame size combination fails.
278+
279+
## Troubleshoot
280+
281+
You can find information on the following sites:
282+
- [ESP-FAQ](https://docs.espressif.com/projects/esp-faq/en/latest/application-solution/camera-application.html)
283+
- [ChatGPT](https://chatgpt.com/)
284+
- [Issues in here](https://github.com/cnadler86/micropython-camera-API/issues?q=is%3Aissue)
285+
271286
## Future Plans
272287

273288
- Edge case: enable usage of pins such as i2c for other applications

examples/CameraSettings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ async def stream_camera(writer):
2828
cam.init()
2929
if not cam.get_bmp_out() and cam.get_pixel_format() != PixelFormat.JPEG:
3030
cam.set_bmp_out(True)
31-
31+
await asyncio.sleep(1)
32+
3233
writer.write(b'HTTP/1.1 200 OK\r\nContent-Type: multipart/x-mixed-replace; boundary=frame\r\n\r\n')
3334
await writer.drain()
3435

0 commit comments

Comments
 (0)