Coder Social home page Coder Social logo

esp-idf-ftp-camera's Introduction

esp-idf-ftp-camera

Take a picture and Publish it via FTP.
This project use ESP32 Camera Driver.
This project use ESP32-FTP-Client.

slide1 slide2

Hardware requirements

ESP32-CAM Development board.
Support for OV2640 camera.
If you use other camera, edit sdkconfig.default.
ESP32-CAM-1 ESP32-CAM-2

Software requirements

esp-idf v4.3 or later.

Installation

Use a USB-TTL converter.

ESP-32 USB-TTL
U0TXD RXD
U0RXD TXD
GPIO0 GND
5V 5V
GND GND
git clone https://github.com/nopnop2002/esp-idf-ftp-camera
cd esp-idf-ftp-camera
git clone https://github.com/espressif/esp32-camera components/esp32-camera
idf.py set-target esp32
idf.py menuconfig
idf.py flash monitor

Start firmware

Change GPIO0 to open and press the RESET button.

Configuration

Set the following items using menuconfig.

config-main config-app

File system Selection

ESP32 supports the following file systems.

  • SPIFFS file system on FLASH
  • FAT file system on FLASH
  • FAT file system on SPI peripheral SDCARD
  • FAT file system on SDMMC peripheral SDCARD

You can select any one using menuconfig.

config-filesystem

Using FAT file system on SPI peripheral SDCARD

Must be formatted with FAT32 before use

ESP32 pin SPI pin Notes
GPIO14(MTMS) SCK
GPIO15(MTDO) MOSI 10k pull up if can't mount
GPIO2 MISO
GPIO13(MTCK) CS
3.3V VCC Can't use 5V supply
GND GND

Using FAT file system on SDMMC peripheral SDCARD

Must be formatted with FAT32 before use

ESP32 pin SD card pin Notes
GPIO14(MTMS) CLK 10k pullup
GPIO15(MTDO) CMD 10k pullup
GPIO2 D0 10k pullup
GPIO4 D1 not used in 1-line SD mode; 10k pullup in 4-line SD mode
GPIO12(MTDI) D2 not used in 1-line SD mode; 10k pullup in 4-line SD mode
GPIO13 (MTCK) D3 not used in 1-line SD mode, but card's D3 pin must have a 10k pullup
N/C CD optional, not used in the example
N/C WP optional, not used in the example

Wifi Setting

config-wifi-1

You can use the mDNS hostname instead of the IP address.

  • esp-idf V4.3 or earlier
    You will need to manually change the mDNS strict mode according to this instruction.
  • esp-idf V4.4 or later
    If you set CONFIG_MDNS_STRICT_MODE = y in sdkconfig.default, the firmware will be built with MDNS_STRICT_MODE = 1.

config-wifi-2

You can use static IP.
config-wifi-3

FTP server Setting

config-ftpserver

You can specify mDNS hostname for the FTP server.

Remote File Name Setting

You can choose the file name on the FTP server side from the following.

  • Always the same file name
  • File name based on date and time
    When you choose date and time file name, you will need an NTP server.
    The file name will be YYYYMMDD-hhmmss.jpg.

config-remote-file-1 config-remote-file-2

  • Add FrameSize to Remote file Name
    When this is enabled, FrameSize is added to remote file name like this.
    20210520-165740_800x600.jpg

config-remote-file-3

Select Frame Size

Large frame sizes take longer to take a picture.
config-framesize-1 config-framesize-2

Select Shutter

You can choose one of the following shutter methods

  • Shutter is the Enter key on the keyboard
    For operation check

config-shutter-1

  • Shutter is a GPIO toggle

    • Initial Sate is PULLDOWN
      The shutter is prepared when it is turned from OFF to ON, and a picture is taken when it is turned from ON to OFF.

    • Initial Sate is PULLUP
      The shutter is prepared when it is turned from ON to OFF, and a picture is taken when it is turned from OFF to ON.

I confirmed that the following GPIO can be used.

GPIO PullDown PullUp
GPIO12 OK NG
GPIO13 OK OK
GPIO14 OK OK
GPIO15 OK OK
GPIO16 NG NG

config-shutter-2

  • Shutter is TCP Socket
    You can use tcp_send.py.
    python ./tcp_send.py

config-shutter-3

  • Shutter is UDP Socket
    You can use udp_send.py.
    Requires netifaces.
    python ./udp_send.py

config-shutter-4

  • Shutter is HTTP Request
    You can use this command.
    curl "http://esp32-camera.local:8080/take_picture"

config-shutter-5

Flash Light

ESP32-CAM by AI-Thinker has a flash light on GPIO4.

config-flash

Built-in WEB Server

You can check the photos taken using the built-in WEB server.
Enter the ESP32's IP address and port number in the address bar of your browser.

browser

References

https://github.com/nopnop2002/esp-idf-ftpServer

https://github.com/nopnop2002/esp-idf-ftpClient

esp-idf-ftp-camera's People

Contributors

nopnop2002 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.