赞
踩
环境搭建参考教程:https://blog.csdn.net/FourLeafCloverLLLS/article/details/119849565?spm=1001.2014.3001.5501
下载子模块参考:https://gitee.com/EspressifSystems/esp-gitee-tools/blob/master/docs/README-submodule-update.md
https://gitee.com/llls15679003191/esp32_sdk_learn.git
一定要加–recursive, 因为有相应的组件
cd ~/file/esp/esp32_sdk_learm/ESP32_CAMERA_QR
根据你的电脑路径来
摄像头接口 | 摄像头模组 | 对应ESP32 DevKitJ | 对应安信可cam开发板接口 |
---|---|---|---|
SCCB Clock | SIOC | IO27 | IO27 |
SCCB Data | SIOD | IO26 | IO26 |
System Clock | XCLK | IO21 | IO0 |
Vertical Sync | VSYNC | IO25 | IO25 |
Horizontal Reference | HREF | IO23 | IO23 |
Pixel Clock | PCLK | IO22 | IO22 |
Pixel Data Bit 0 | D2 | IO4 | IO5 |
Pixel Data Bit 1 | D3 | IO5 | IO18 |
Pixel Data Bit 2 | D4 | IO18 | IO19 |
Pixel Data Bit 3 | D5 | IO19 | IO21 |
Pixel Data Bit 4 | D6 | IO36 | IO36 |
Pixel Data Bit 5 | D7 | IO39 | IO39 |
Pixel Data Bit 6 | D8 | IO34 | IO34 |
Pixel Data Bit 7 | D9 | IO35 | IO35 |
Camera Reset | RESET | IO2 | 3.3V |
Camera Power Down | PWDN | see Note 1 | GND |
Power Supply 3.3V | 3V3 | 3V3 | IO32 |
Ground | GND | GND | GND |
运行
make menuconfig
需要配置以下参数:
Arduino:1.8.12 (Mac OS X), 开发板:"ESP32 Wrover Module, Huge APP (3MB No OTA/1MB SPIFFS), QIO, 80MHz, 921600, None" 项目使用了 2612056 字节,占用了 (83%) 程序存储空间。最大为 3145728 字节。 全局变量使用了54068字节,(16%)的动态内存,余留273612字节局部变量。最大为327680字节。 esptool.py v2.6 Serial port /dev/cu.usbserial-14310 Connecting..... Chip is ESP32D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None MAC: 8c:aa:b5:86:72:0c Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... A fatal error occurred: Timed out waiting for packet content A fatal error occurred: Timed out waiting for packet content
则应该把波特率再减减。
make
出现以下信息,表示编译成功,否则按照出错原因进行修改
Generating esp32.project.ld
LD build/esp32-cam-demo.elf
make flash
出现以下表示下载成功
Flashing binaries to serial port '/dev/ttyUSB0' (app at offset 0x10000)... esptool.py v3.1-dev Serial port /dev/ttyUSB0 Connecting........__ Chip is ESP32-D0WD (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None WARNING: Detected crystal freq 41.01MHz is quite different to normalized freq 40MHz. Unsupported crystal in use? Crystal is 40MHz MAC: 94:3c:c6:12:b6:00 Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Auto-detected Flash size: 4MB Flash will be erased from 0x00001000 to 0x00007fff... Flash will be erased from 0x00010000 to 0x000c7fff... Flash will be erased from 0x00008000 to 0x00008fff... Compressed 24896 bytes to 15331... Wrote 24896 bytes (15331 compressed) at 0x00001000 in 0.9 seconds (effective 227.2 kbit/s)... Hash of data verified. Compressed 750544 bytes to 474132... Wrote 750544 bytes (474132 compressed) at 0x00010000 in 11.4 seconds (effective 526.9 kbit/s)... Hash of data verified. Compressed 3072 bytes to 103... Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 311.8 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin...
下载出错时请注意您的下载管教是否有对应的电平,或者您的串口号是否正确。
make monitor
注意记得打开您设置的wifi, 以下信息是wifi相关的,涉及到链接wifi日志,和esp32 ip
I (5408) camera_demo: Connecting to "XiaoLuo"
W (23668) wifi:<ba-add>idx:0 (ifx:0, 34:d7:12:9b:6e:e0), tid:0, ssn:0, winSize:64
I (24668) esp_netif_handlers: sta ip: 192.168.43.37, mask: 255.255.255.0, gw: 192.168.43.1
I (24668) camera_demo: Connected
I (24668) camera_demo: Open http://192.168.43.37/jpg for single image/jpg image
I (24678) camera_demo: Open http://192.168.43.37/jpg_stream for multipart/x-mixed-replace stream of JPEGs
I (24688) camera_demo: Free heap: 70812
I (24688) camera_demo: Camera demo ready
打开:http://192.168.43.37/jpg_stream 就可以看视频流了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。