ESP32-Cam开发环境搭建过程

本机环境:ubuntu16.04

一、搭建ESP32编译环境的步骤:

1、建源码工作目录

mkdir ~/esp32

cd ~/esp32

 

2、拉代码

 git clone --recursive https://github.com/espressif/esp-idf.git

 

3、设置工具

cd ~/esp/esp-idf

./install.sh

 

4、执行命令

. ./export.sh

 

5、开始一个简单范例

cd ~/esp

cp -r $IDF_PATH/examples/get-started/hello_world .

 

6、usb口连接板卡、查询设备

lsusb

 

7、检查串口名称

bo@bo-HP-ZBook-15-G3:~/workspace/esp32$ ls /dev/ttyUSB0 

/dev/ttyUSB0
 

8、编译工程

cd ~/esp/hello_world

idf.py menuconfig

idf.py build

 

9、烧录

idf.py -p PORT [-b BAUD] flash

 

二、搭建ESP32-Cam开发环境

1、下载esp-who

cd ~/esp

git clone --recursive https://github.com/espressif/esp-who.git

 

2、下载esp-idf v3.3

wget https://github.com/espressif/esp-idf/releases/download/v3.3/esp-idf-v3.3.zip

unzip esp-idf-v3.3.zip

mv esp-idf-v3.3 esp-idf

在 ~/.profile 添加环境变量

export IDF_PATH=~/workspace/esp32/esp-idf

export PATH="$IDF_PATH/tools:$PATH"
 

3、下载工具链

wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz

tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz

PATH="$HOME/bin:$HOME/.local/bin:$PATH:/home/bo/workspace/esp32/xtensa-esp32-elf/bin"

 

4、编译

cd /ext_sys/1~5_mp3_player/esp-who/examples/single_chip/camera_web_server/

source ~/.profile

4.1、配置编译选项

idf.py menuconfig

.→ Camera Web Server → Camera Pins 

选择 (X) ESP_EYE DevKit 

→ Component config → Camera configuration

仅选择

[*] OV2640 Support  

4.2、修改pin定义

代码中的一个坑(代码分支中的任何pin定义与https://docs.m5stack.com/#/en/unit/esp32cam中的pinmap都不一致),需要修改文件中的pin

vim /ext_sys/1~5_mp3_player/esp-who/examples/single_chip/camera_web_server/main/include/app_camera.h

的分支#elif CONFIG_CAMERA_MODEL_ESP_EYE

#define PWDN_GPIO_NUM     -1

#define RESET_GPIO_NUM    15

#define XCLK_GPIO_NUM     27

#define SIOD_GPIO_NUM     25

#define SIOC_GPIO_NUM     23

#define Y9_GPIO_NUM       19

#define Y8_GPIO_NUM       36

#define Y7_GPIO_NUM       18

#define Y6_GPIO_NUM       39

#define Y5_GPIO_NUM       5

#define Y4_GPIO_NUM       34

#define Y3_GPIO_NUM       35

#define Y2_GPIO_NUM       17

#define VSYNC_GPIO_NUM    22

#define HREF_GPIO_NUM     26

#define PCLK_GPIO_NUM     21

4.3、编译

idf.py build

4.4、烧录

idf.py -p /dev/ttyUSB0 flash

4.6、uart打印看log

idf.py -p /dev/ttyUSB0 monitor

 

参考:

1、快速入门 ESP-IDF编程指南  

https://docs.espressif.com/projects/esp-idf/zh_CN/latest/get-started/index.html

https://docs.espressif.com/projects/esp-idf/zh_CN/latest/get-started/index.html#esp-idf

 

2、esp-who下载,和esp-idf v3.3下载

https://github.com/espressif/esp-who

https://github.com/espressif/esp-idf/releases/v3.3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值