{"id":16239230,"url":"https://github.com/nopnop2002/esp-idf-http-camera","last_synced_at":"2025-08-23T10:02:59.219Z","repository":{"id":53618970,"uuid":"314462743","full_name":"nopnop2002/esp-idf-http-camera","owner":"nopnop2002","description":"Take a picture and Publish it via HTTP","archived":false,"fork":false,"pushed_at":"2025-03-01T01:11:20.000Z","size":112,"stargazers_count":27,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T02:14:11.753Z","etag":null,"topics":["eap32","esp-idf","esp32-cam","http","http-requests"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-20T06:10:08.000Z","updated_at":"2025-03-01T01:11:23.000Z","dependencies_parsed_at":"2024-02-11T05:27:33.337Z","dependency_job_id":"9fff054c-d5d2-455c-8c51-6ea0f03b4959","html_url":"https://github.com/nopnop2002/esp-idf-http-camera","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-http-camera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-http-camera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-http-camera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-http-camera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp-idf-http-camera/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243869318,"owners_count":20360993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eap32","esp-idf","esp32-cam","http","http-requests"],"created_at":"2024-10-10T13:42:49.246Z","updated_at":"2025-08-23T10:02:59.206Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-http-camera\nTake a picture and Publish it via HTTP.   \nThis project use [this](https://components.espressif.com/components/espressif/esp32-camera) Camera Driver.   \n\n![slide-0001](https://user-images.githubusercontent.com/6020549/119491922-7a092e00-bd99-11eb-8260-a52e9f5bddc2.jpg)\n![slide-0002](https://user-images.githubusercontent.com/6020549/119491927-7bd2f180-bd99-11eb-88aa-a4c4c9ab6c84.jpg)\n\n# Hardware requirements\nESP32 development board with OV2640 camera.   \nIf you use other camera, edit sdkconfig.default.   \nFrom the left:   \n- Aithinker ESP32-CAM   \n- Freenove ESP32-WROVER CAM   \n- UICPAL ESPS3 CAM   \n- Freenove ESP32S3-WROVER CAM (Clone)   \n\n![es32-camera](https://github.com/nopnop2002/esp-idf-websocket-camera/assets/6020549/38dbef9a-ed85-4df2-8d22-499b2b497278)\n\n## Software requirements\nESP-IDF V5.0 or later.   \nESP-IDF V4.4 release branch reached EOL in July 2024.   \n\n# Start HTTP Server\nYou can use a server using flask or a simple server.   \n\n## flask HTTP server   \n```\nsudo apt update\nsudo apt install python3-pip python3-setuptools libimage-exiftool-perl jhead\npython3 -m pip install -U pip\npython3 -m pip install -U wheel\npython3 -m pip install -U Werkzeug\npython3 -m pip install -U pillow\npython3 -m pip install -U python-magic\npython3 -m pip install -U requests\npython3 -m pip install -U flask\npython3 -m pip install -U piexif\ngit clone https://github.com/nopnop2002/esp-idf-http-camera\ncd esp-idf-http-camera/flask\npython3 main.py\n```\n\nOpen your browser and enter the host address in the address bar.   \n![Image](https://github.com/user-attachments/assets/01427bcf-e51d-40cd-a6cf-03fa41a2912f)\n\nWhen you start ESP32, a list of ESP32 will be displayed.   \n![Image](https://github.com/user-attachments/assets/4b42727e-5afc-4d95-bbec-d57b9131ca45)\n\nSelect ESP32 and then press the Take Picture button.   \nYou can add Exif to JPEG.   \n![Image](https://github.com/user-attachments/assets/62d4a56e-226b-4131-8d96-de8185e5441c)\n\nESP32 takes a photo and transmits it to the server.   \nYou can see the photos.   \n![Image](https://github.com/user-attachments/assets/885a06e4-50d0-42dd-a475-29ec8b24a85d)\n![Image](https://github.com/user-attachments/assets/5d7207c9-a4f0-448e-9e76-5c16dd87b8be)\n![Image](https://github.com/user-attachments/assets/898c799f-4c6a-4416-9452-2d0fab5ec94a)\n![Image](https://github.com/user-attachments/assets/fae46e75-7f57-4807-b425-cfd206162a81)\n\n- Directory to save photos   \n\tThis project will save photos in the following directory:   \n\t`esp-idf-http-camera/flask/uploaded`   \n\t```\n\t$ pwd\n\t/home/nop/esp-idf-http-camera/flask/uploaded\n\t$ ls\n\tpicture0_1024x768.jpg  picture2_800x600.jpg\n\tpicture1_1280x720.jpg\n\t```\n\n- About Exif tags   \n\tIn this project, we will use exiftool to add Exif tags to JPG files.   \n\tThe name of the tag to be added is `UserComment`.   \n\tYou can view the Exif content with the following command:   \n\t`jhead *.jpg`   \n\t![Image](https://github.com/user-attachments/assets/7506b9b3-bbbf-414b-b5f3-2ee665fcf7d2)\n\n\tYou can use exiftool to modify the Exif tags.   \n\tExiftool will save the file with the original Exif tag changes under a different name.   \n\t```\n\t$ jhead picture2_800x600.jpg\n\tFile name    : picture2_800x600.jpg\n\tFile size    : 15020 bytes\n\tFile date    : 2025:04:23 03:47:27\n\tResolution   : 800 x 600\n\tJPEG Quality : 62\n\tComment      : test-03\n\n\t$ exiftool -usercomment=test-03-01 picture2_800x600.jpg\n\t    1 image files updated\n\n\t$ jhead picture2_800x600.jpg\n\tFile name    : picture2_800x600.jpg\n\tFile size    : 15022 bytes\n\tFile date    : 2025:04:23 04:11:26\n\tResolution   : 800 x 600\n\tJPEG Quality : 62\n\tComment      : test-03-01\n\n\t$ ls picture2_800x600*\n\tpicture2_800x600.jpg  picture2_800x600.jpg_original\n\t```\n\n\tjhead treats UserComment tags the same as Comment tags.   \n\texiftool distinguishes between UserComment and Comment tags.   \n\tAn explanation of the difference between UserComment tags and Comment tags can be found [here](https://exiftool.org/forum/index.php?topic=12466.0).   \n\n\n## Simple HTTP server\n```\npython3 -m pip install -U wheel\npython3 -m pip install opencv-python\ngit clone https://github.com/nopnop2002/esp-idf-http-camera\npython3 ./http_server.py --help\nusage: http_server.py [-h] [--port PORT] [--timeout TIMEOUT]\n\noptions:\n  -h, --help         show this help message and exit\n  --port PORT        http port\n  --timeout TIMEOUT  wait time for keyboard input[sec]\n```\nWhen timeout is specified, display the image for the specified number of seconds.   \nWhen timeout is not specified, the image will be displayed until the ESC key is pressed.   \nNew requests are queued while the image is displayed.   \n__Close the image window with the ESC key. Do not use the close button.__   \n![opencv](https://github.com/nopnop2002/esp-idf-mqtt-camera/assets/6020549/516b2f25-d285-47d6-ae56-ee1cceed5c58)   \nThis script works not only on Linux but also on Windows 10.   \nI used Python 3.9.13 for Windows.   \n![Image](https://github.com/user-attachments/assets/b1d4f037-3be3-4b02-bea7-6856aa2e1f8e)\n\n\n## Installation for ESP32\nFor AiThinker ESP32-CAM, you need to use a USB-TTL converter and connect GPIO0 to GND.   \n\n|ESP-32|USB-TTL|\n|:-:|:-:|\n|U0TXD|RXD|\n|U0RXD|TXD|\n|GPIO0|GND|\n|5V|5V|\n|GND|GND|\n\n\n```\ngit clone https://github.com/nopnop2002/esp-idf-http-camera\ncd esp-idf-http-camera\nidf.py set-target {esp32/esp32s3}\nidf.py menuconfig\nidf.py flash monitor\n```\n\n## Start firmware\nFor AiThinker ESP32-CAM, Change GPIO0 to open and press the RESET button.\n\n## Configuration\n![config-main](https://github.com/user-attachments/assets/3bdb6876-d47c-4396-88d1-395ffaeda2cc)\n![config-app](https://user-images.githubusercontent.com/6020549/200204471-35b658fc-40b7-47aa-b0ba-86979049eba4.jpg)\n\n### Wifi Setting\nSet the information of your access point.   \n![config-wifi-1](https://user-images.githubusercontent.com/6020549/119243503-529c4080-bba2-11eb-92c5-b59f66f9fea6.jpg)   \nYou can connect using the mDNS hostname instead of the IP address.   \n![config-wifi-2](https://user-images.githubusercontent.com/6020549/119243504-5334d700-bba2-11eb-8c77-f958251d8611.jpg)   \nYou can use static IP.   \n![config-wifi-3](https://user-images.githubusercontent.com/6020549/119243505-5334d700-bba2-11eb-9677-47cb6d1f9536.jpg)   \n\n\n### HTTP Server Setting\nSpecify the IP address and port number of the http server.   \nYou can use mDNS hostnames instead of IP addresses.   \n![Image](https://github.com/user-attachments/assets/1d8ddb66-9442-4dac-a214-87ea6b2c4ca6)\n\n### Attached File Name Setting\nYou can select the file name to send to the HTTP server from the following.   \n- Always the same file name   \n\t![config-filename-1](https://user-images.githubusercontent.com/6020549/119243498-5203aa00-bba2-11eb-87d5-053636dbb85a.jpg)\n- File name based on date and time   \n\tWhen you choose date and time file name, you will need an NTP server.   \n\tThe file name will be YYYYMMDD-hhmmss.jpg.   \n\t![config-filename-2](https://user-images.githubusercontent.com/6020549/119243499-5203aa00-bba2-11eb-8c0f-6bb42d125d64.jpg)\n\n- Add FrameSize to Remote file Name   \n\tWhen this is enabled, FrameSize is added to remote file name like this.   \n\t`picture_800x600.jpg`   \n\t`20210520-165740_800x600.jpg`   \n\t![config-filename-3](https://user-images.githubusercontent.com/6020549/119243501-529c4080-bba2-11eb-8ba4-85cdd764b0fc.jpg)\n\n\n### Select Board\n![config-board](https://github.com/nopnop2002/esp-idf-http-camera/assets/6020549/732c9574-68df-4e52-9b9e-6071d7ce5737)\n\n\n### Select Frame Size\nLarge frame sizes take longer to take a picture.   \n![config-framesize-1](https://user-images.githubusercontent.com/6020549/118947689-8bfe6180-b992-11eb-8657-b4e86d3acc70.jpg)\n![config-framesize-2](https://user-images.githubusercontent.com/6020549/118947692-8d2f8e80-b992-11eb-9caa-1f6b6cb2210e.jpg)\n\n### Select Shutter\nESP32 acts as a HTTP server and listens for requests from HTTP clients.   \nYou can use this command as shutter.   \n`curl -X POST http://{ESP32's IP Address}:8080/post`   \nIf your ESP32's IP address is `192.168.10.157`, it will look like this.   \n`curl -X POST http://192.168.10.157:8080/post`   \n\nIn addition to this, you can select the following triggers:   \n\n- Shutter is the Enter key on the keyboard   \n\tFor operation check.   \n\tWhen using the USB port provided by the USB Serial/JTAG Controller Console, you need to enable the following line in sdkconfig.\n\t```\n\tCONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y\n\t```\n\t![config-shutter-1](https://user-images.githubusercontent.com/6020549/99890068-db432e00-2c9e-11eb-84e2-4e6c5f05fb7a.jpg)\n\n\n- Shutter is a GPIO toggle   \n\n\t- Initial Sate is PULLDOWN   \n\tThe shutter is prepared when it is turned from OFF to ON, and a picture is taken when it is turned from ON to OFF.   \n\n\t- Initial Sate is PULLUP   \n\tThe shutter is prepared when it is turned from ON to OFF, and a picture is taken when it is turned from OFF to ON.   \n\n\tI confirmed that the following GPIO can be used.   \n\n\t|GPIO|PullDown|PullUp|\n\t|:-:|:-:|:-:|\n\t|GPIO12|OK|NG|\n\t|GPIO13|OK|OK|\n\t|GPIO14|OK|OK|\n\t|GPIO15|OK|OK|\n\t|GPIO16|NG|NG|\n\n\t![config-shutter-2](https://user-images.githubusercontent.com/6020549/99897437-d2714d00-2cdc-11eb-8e59-c8bf4ef25d62.jpg)\n\n- Shutter is TCP Socket   \n\tESP32 acts as a TCP server and listens for requests from TCP clients.   \n\tYou can use tcp_send.py as shutter.   \n\t`python3 ./tcp_send.py`\n\t![Image](https://github.com/user-attachments/assets/4c301018-2f8c-4644-be3f-417222fb1842)\n\n- Shutter is UDP Socket   \n\tESP32 acts as a UDP listener and listens for requests from UDP clients.   \n\tYou can use this command as shutter.   \n\t`echo -n \"take\" | socat - UDP-DATAGRAM:255.255.255.255:49876,broadcast`   \n\tYou can use udp_send.py as shutter.   \n\tRequires netifaces.   \n\t`python3 ./udp_send.py`   \n\t![Image](https://github.com/user-attachments/assets/3dcd72be-d0ef-4bd9-9273-f420ca88f11b)   \n\tYou can use these devices as shutters.   \n\t![Image](https://github.com/user-attachments/assets/cc97da4e-6c06-4604-8362-f81c6fb6eb58)   \n\tClick [here](https://github.com/nopnop2002/esp-idf-selfie-trigger) for details.   \n\n\n### Flash Light   \nESP32-CAM by AI-Thinker have flash light on GPIO4.\n\n![config-flash](https://user-images.githubusercontent.com/6020549/99890190-0b3f0100-2ca0-11eb-94c6-ba7e2cfe1727.jpg)\n\n## PSRAM   \nWhen you use ESP32S3-WROVER CAM, you need to change the PSRAM type.   \n\n![config-psram](https://github.com/nopnop2002/esp-idf-websocket-camera/assets/6020549/ba04f088-c628-46ac-bc5b-2968032753e0)\n\n# View picture using Built-in WEB Server\nESP32 works as a web server.   \nYou can view the pictures taken using the built-in WEB server.   \nEnter the ESP32's IP address and port number in the address bar of your browser.   \nYou can connect using mDNS hostname instead of IP address.   \n\n![browser](https://user-images.githubusercontent.com/6020549/124227364-837a7880-db45-11eb-9d8b-fa15c676adac.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-http-camera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp-idf-http-camera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-http-camera/lists"}