Skip to content
This repository was archived by the owner on Jun 15, 2020. It is now read-only.

Support of OV7670 and IDF 4.1 #130

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS ../../../components)

# (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(esp32-cam-demo)
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
PROJECT_NAME := esp32-cam-demo

EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common

include $(IDF_PATH)/make/project.mk

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ESP32 Camera Demo

Code provided in this repository gets the image from camera and prints it out as ASCII art to the serial port.
Code provided in this repository use the esp32-camera componet of idf for get the image using a webserver.
The demonstration was carried out with the OV7670 sensor and the IDF 4.1 version. Use RGB565 mode (two bytes) to reduce the RAM used in the ISR.

## Build Status

Expand Down Expand Up @@ -32,6 +33,7 @@ To make this code work, you need the following components:
* [ESP32](https://espressif.com/en/products/hardware/esp32/overview) module
* Camera module
* PC with [esp-idf](https://github.com/espressif/esp-idf)
* Camera lib [esp32-camera](https://github.com/jjsch-dev/esp32-camera)

See the following sections for more details.

Expand All @@ -43,14 +45,16 @@ If you are an owner of [ESP-WROVER V1 (aka DevKitJ)](http://dl.espressif.com/dl/

### Camera

This example has been tested with OV7725 camera module. Use it, if this is your first exposure to interfacing a microcontroller with a camera.
This example has been tested with OV7670 camera module. Use it, if this is your first exposure to interfacing a microcontroller with a camera.

Other OV7xxx series should work as well, with some changes to camera configuration code. OV5xxx can work too, but it is advisable to choose the ones which support RGB or YUV 8-bit wide output bus. The ones which only output 10-bit raw data may be a bit harder to work with. Also choose the camera which can output a scaled down (QVGA or VGA) image. Use of larger frame buffers will require external SPI RAM.

### ESP-IDF

Configure your PC according to [ESP32 Documentation](http://esp-idf.readthedocs.io/en/latest/?badge=latest). [Windows](http://esp-idf.readthedocs.io/en/latest/windows-setup.html), [Linux](http://esp-idf.readthedocs.io/en/latest/linux-setup.html) and [Mac OS](http://esp-idf.readthedocs.io/en/latest/macos-setup.html) are supported. If this is you first exposure to ESP32 and [esp-idf](https://github.com/espressif/esp-idf), then get familiar with [01_hello_world](https://github.com/espressif/esp-idf/tree/master/examples/01_hello_world) and [02_blink](https://github.com/espressif/esp-idf/tree/master/examples/02_blink) examples. Make them work and understand before proceeding further.

Don't forget to copy the lib [esp32-camera](https://github.com/jjsch-dev/esp32-camera) to the IDF components folder.

## Quick Start

If you have your components ready, follow this section to [connect](#connect) the camera to ESP32 module, [flash](#flash) application to the ESP32 and finally [shoot](#shoot) and display the image.
Expand Down Expand Up @@ -211,7 +215,7 @@ D (1887) camera_demo: Done

### Software

The core of camera software is contained in `camera` folder and consists of the following files.
The core of camera software is contained in `esp32-camera` folder and consists of the following files.

* [camera.c](components/camera/camera.c) and [include/camera.h](components/camera/include/camera.h) - main file responsible for configuration of ESP32's GPIO, clock, I2S and DMA to interface with camera module. Once interface is established, it perfroms camera configuration to then retrieve image and save it in ESP32 memory. Access to camera is executed using lower level routines in the following files.

Expand Down
7 changes: 7 additions & 0 deletions components/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(COMPONENT_SRCS
bitmap.c
)

set(COMPONENT_ADD_INCLUDEDIRS include)

register_component()
28 changes: 0 additions & 28 deletions components/camera/Kconfig

This file was deleted.

3 changes: 2 additions & 1 deletion components/camera/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ bitmap_header_t *bmp_create_header(int w, int h)
bitmap_header_t *pbitmap = (bitmap_header_t*)calloc(1, sizeof(bitmap_header_t));
int _pixelbytesize = w * h * _bitsperpixel/8;
int _filesize = _pixelbytesize+sizeof(bitmap_header_t);
strcpy((char*)pbitmap->fileheader.signature, "BM");
pbitmap->fileheader.signature[0] = 'B';
pbitmap->fileheader.signature[1] = 'M';
pbitmap->fileheader.filesize = _filesize;
pbitmap->fileheader.fileoffset_to_pixelarray = sizeof(bitmap_header_t);
pbitmap->bitmapinfoheader.dibheadersize = sizeof(bitmapinfoheader);
Expand Down
Loading