ESP32 Camera
来自Jack's Lab
目录 |
1 Overview
2 Connections
Interface | Camera Pin | ESP32 Pin | Quantum Pin |
SCCB Block | SIOC | IO27 | D7 |
SCCB Data | SIOD | IO26 | D6 |
Vertical Sync | VSYNC | IO25 | D5 |
Horizontal Reference | HREF | IO23 | D11 |
Pixel Clock | PCLK | IO22 | D8K | IO22 | |
Camera System Clock | XCLK | IO21 | D9 |
Pixel Data Bit 7 | D9 | IO35 | I35 |
Pixel Data Bit 6 | D8 | IO34 | I34 |
Pixel Data Bit 5 | D7 | IO39 | I39 |
Pixel Data Bit 4 | D6 | IO36 | I36 |
Pixel Data Bit 3 | D5 | IO19 | D12 |
Pixel Data Bit 2 | D4 | IO18 | D13 |
Pixel Data Bit 1 | D3 | IO5 | D10 |
Pixel Data Bit 0 | D2 | IO4 | D4 |
Camera Reset | RESET | IO2 | D2 |
Camera Power Down | PWDN | GND | GND |
Power Supply 3.3V | 3V3 | 3V3 | 3V3 |
Ground | GND | GND | GND |
3 Quick Start
In Linux:
3.1 Install ESP-IDF
$ sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial $ wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-59.tar.gz $ mkdir -p toolchain $ tar zxf xtensa-esp32-elf-linux32-1.22.0-59.tar.gz -C toolchain $ export PATH=$PATH:`pwd`/toolchain/xtensa-esp32-elf/bin $ $ git clone --recursive git://github.com/icamgo/esp-idf.git $ export IDF_PATH=`pwd`/esp-idf
3.2 Compile & Upload
$ cd esp-idf/examples/10_camera/ $ make menuconfig $ make flash
3.3 Shoot
ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:QIO, clock div:1 load:0x3ffc0008,len:4 load:0x3ffc000c,len:1544 load:0x40078000,len:3408 ho 0 tail 12 room 4 load:0x40080000,len:260 entry 0x40080034 I (377) heap_alloc_caps: Initializing heap allocator: I (378) heap_alloc_caps: Region 19: 3FFB4830 len 0002B7D0 tag 0 I (378) heap_alloc_caps: Region 25: 3FFE8000 len 00018000 tag 1 I (385) cpu_start: Pro cpu up. I (389) cpu_start: Single core mode I (394) cpu_start: Pro cpu start user code D (420) intr_alloc: Connected src 56 to int 2 (cpu 0) D (422) nvs: nvs_flash_init_custom start=9 count=6 D (438) phy_init: loading PHY init data from application binary D (464) nvs: nvs_open phy 0 D (487) nvs: nvs_get cal_version 4 D (516) nvs: nvs_get_str_or_blob cal_mac D (550) nvs: nvs_get_str_or_blob cal_data D (590) nvs: nvs_close 1 I (773) phy: phy_version: 258, Nov 29 2016, 15:51:07, 0, 0 D (773) nvs: nvs_open phy 1 D (774) nvs: nvs_set cal_version 4 258 D (869) nvs: nvs_set_blob cal_mac 6 D (1635) nvs: nvs_set_blob cal_data 1904 D (1678) nvs: nvs_close 2 I (1679) cpu_start: Starting scheduler on PRO CPU. D (1680) camera: Enabling XCLK output I (1680) ledc: LEDC_PWM CHANNEL 0|GPIO 21|Duty 0004|Time 0 D (1680) camera: Initializing SSCB I (1680) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1690) gpio: GPIO[27]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1700) gpio: GPIO[26]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (1710) gpio: GPIO[27]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 D (1720) camera: Resetting camera D (1730) camera: Searching for camera address E (1730) camera: Camera address not found E (1730) camera_demo: Camera init failed with error = 131073 ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:QIO, clock div:1 load:0x3ffc0008,len:4 load:0x3ffc000c,len:1544 load:0x40078000,len:3408 ho 0 tail 12 room 4 load:0x40080000,len:260 entry 0x40080034 I (377) heap_alloc_caps: Initializing heap allocator: I (378) heap_alloc_caps: Region 19: 3FFB4830 len 0002B7D0 tag 0 I (378) heap_alloc_caps: Region 25: 3FFE8000 len 00018000 tag 1 I (385) cpu_start: Pro cpu up. I (389) cpu_start: Single core mode I (394) cpu_start: Pro cpu start user code D (419) intr_alloc: Connected src 56 to int 2 (cpu 0) D (422) nvs: nvs_flash_init_custom start=9 count=6 D (438) phy_init: loading PHY init data from application binary D (463) nvs: nvs_open phy 0 D (487) nvs: nvs_get cal_version 4 D (516) nvs: nvs_get_str_or_blob cal_mac D (550) nvs: nvs_get_str_or_blob cal_data D (590) nvs: nvs_close 1 I (776) phy: phy_version: 258, Nov 29 2016, 15:51:07, 0, 0 D (776) nvs: nvs_open phy 1 D (777) nvs: nvs_set cal_version 4 258 D (872) nvs: nvs_set_blob cal_mac 6 D (875) nvs: nvs_set_blob cal_data 1904 D (1694) nvs: nvs_close 2 I (1695) cpu_start: Starting scheduler on PRO CPU. D (1696) camera: Enabling XCLK output I (1696) ledc: LEDC_PWM CHANNEL 0|GPIO 21|Duty 0004|Time 0 D (1696) camera: Initializing SSCB I (1696) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1706) gpio: GPIO[27]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1716) gpio: GPIO[26]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (1726) gpio: GPIO[27]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 D (1736) camera: Resetting camera D (1746) camera: Searching for camera address D (1746) camera: Detected camera at address=0x21 D (1746) camera: Camera PID=0x77 VER=0x21 MIDL=0x7f MIDH=0xa2 D (1746) camera: Doing SW reset of sensor D (1806) camera: Setting frame size at 320x240 D (1836) camera: Allocating frame buffer (320x240, 76800 bytes) D (1836) camera: Initializing I2S and DMA I (1836) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1836) gpio: GPIO[34]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1846) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1856) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1866) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1876) gpio: GPIO[18]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1876) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1886) gpio: GPIO[4]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1896) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1906) gpio: GPIO[23]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (1916) gpio: GPIO[22]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 D (1926) intr_alloc: Connected src 32 to int 3 (cpu 0) D (1926) camera: Allocating DMA buffer #0, size=1280 D (1936) camera: Allocating DMA buffer #1, size=1280 D (1956) camera: Init done D (1956) camera: Waiting for positive edge on VSYNC D (1986) camera: Got VSYNC D (1986) camera: Waiting for frame D (2016) camera: Frame done D (2016) camera_demo: Done @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@%%%@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ %%%%%%%%%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ %%%%%%%@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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