当前位置:   article > 正文

ESP32 SDK 开发(四)——ESP32-CAM局域网视频监控_esp-cam sdk idf 开发 ap模式

esp-cam sdk idf 开发 ap模式

ESP32 CAMERA QR使用教程

环境要求:

  • ESP_IDF 版本:V4.3
    • 环境搭建参考教程: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

  • 电脑系统:Ubuntu18.04
  • esp32 开发板:安信可ESP32——cam模块

一. 下载源代码

https://gitee.com/llls15679003191/esp32_sdk_learn.git
  • 1

一定要加–recursive, 因为有相应的组件

二. 编译和下载

  • 打开shell/cmd窗口,cd到源代码根目录:
cd ~/file/esp/esp32_sdk_learm/ESP32_CAMERA_QR
根据你的电脑路径来
  • 1
  • 2
  • 硬件连接(安心可的cam模组可以不进行这一步)
摄像头接口摄像头模组对应ESP32 DevKitJ对应安信可cam开发板接口
SCCB ClockSIOCIO27IO27
SCCB DataSIODIO26IO26
System ClockXCLKIO21IO0
Vertical SyncVSYNCIO25IO25
Horizontal ReferenceHREFIO23IO23
Pixel ClockPCLKIO22IO22
Pixel Data Bit 0D2IO4IO5
Pixel Data Bit 1D3IO5IO18
Pixel Data Bit 2D4IO18IO19
Pixel Data Bit 3D5IO19IO21
Pixel Data Bit 4D6IO36IO36
Pixel Data Bit 5D7IO39IO39
Pixel Data Bit 6D8IO34IO34
Pixel Data Bit 7D9IO35IO35
Camera ResetRESETIO23.3V
Camera Power DownPWDNsee Note 1GND
Power Supply 3.3V3V33V3IO32
GroundGNDGNDGND
  • 配置参数

运行

make menuconfig
  • 1

需要配置以下参数:

  1. WIFI账号和密码
  2. 串口下载波特率:建议设置为460800
  3. 串口号:默认是dev/ttyUSB0,请修改为你的串口号
    注意:如果出现以下错误:
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

则应该把波特率再减减。

  • 编译程序
make 
  • 1

出现以下信息,表示编译成功,否则按照出错原因进行修改

Generating esp32.project.ld
LD build/esp32-cam-demo.elf
  • 1
  • 2
  • 下载程序
make flash
  • 1

出现以下表示下载成功

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...
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

下载出错时请注意您的下载管教是否有对应的电平,或者您的串口号是否正确。

  • 运行程序
    使用普通的串口或者自带的串口监视器查看日志都可以。以下是使用自带的串口监视器
make monitor
  • 1

注意记得打开您设置的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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

打开:http://192.168.43.37/jpg_stream 就可以看视频流了

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/896404
推荐阅读
相关标签
  

闽ICP备14008679号