esp-idf-http-camera
Take a picture and Publish it via HTTP.
This project use ESP32 Camera Driver.
Server Side
Download the server from here.
ESP32 Side
Software requirements
esp-idf v4.3 or later.
Hardware requirements
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-http-camera
cd esp-idf-http-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.
Wifi Setting
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.
HTTP Server Setting
Attached File Name Setting
You can choose the file name on the HTTP 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.
- Add FrameSize to Remote file Name
When this is enabled, FrameSize is added to remote file name like this.
20210520-165740_800x600.jpg
Select Frame Size
Large frame sizes take longer to take a picture.
Select Shutter
You can choose one of the following shutter methods
- Shutter is the Enter key on the keyboard
For operation check
-
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 |
- Shutter is TCP Socket
You can use tcp_send.py.
python ./tcp_send.py
- Shutter is UDP Socket
You can use udp_send.py.
python ./udp_send.py
- Shutter is HTTP Request
You can use this command.
curl "http://esp32-camera.local:8080/take_picture"
Flash Light
ESP32-CAM by AI-Thinker have flash light on GPIO4.