diff --git a/README.md b/README.md index 64769d6..8595b00 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,81 @@ -## Pruebas de esp32cam con esp-idf +Sure! Let's add those instructions and acknowledgements into the README.md. -Versión básica funcionando. +--- + +# ESP32CAM Streaming Project + +![ESP32CAM](img/sample_image.png) +This project enables the ESP32CAM to stream images from its camera over a Wi-Fi connection. The setup initializes the NVS (non-volatile storage), connects to Wi-Fi, initializes the camera, and sets up the web server to serve the video stream. + +## Requirements +![ESP32CAM](img/esp32_cam.png) + +- ESP32CAM board. +- Development environment with PlatformIO and ESP-IDF. + +## Features + +- Initialize and setup NVS. +- Connect to a specified Wi-Fi network. +- Initialize and stream video from the ESP32CAM's camera. +- Web server to serve the video stream. + +## Installation and Setup + +### 1. Clone the Repository + +```bash +git clone git@github.com:clausqr/esp32cam-webstream.git +cd esp32cam-webstream +``` + +### 2. Configuration + +**WiFi Credentials:** In the repository, there is a file named `secrets.h.example`. Rename it to `secrets.h` and replace the placeholders with your Wi-Fi network credentials. + +```c +#ifndef SECRETS_H +#define SECRETS_H + +#define WIFI_SSID "replace_with_your_ssid" +#define WIFI_PASSWORD "replace_with_your_password" + +#endif /* SECRETS_H */ +``` + +### 3. PlatformIO Setup + +Refer to the project's `platformio.ini` configuration provided earlier. + +### 4. Compile and Upload + +Compile and upload the code using the following commands: + +```bash +platformio run --target upload +``` + +After the code is uploaded, open the Serial Monitor to view logs: + +```bash +platformio device monitor +``` + +### 5. Accessing the Stream + +Once the ESP32CAM is up and running, look for the IP address in the console output. Open that IP address in a web browser to watch the live stream. + +## Troubleshooting + +1. **Failed to connect with Wi-Fi**: Ensure that you've entered the correct Wi-Fi credentials and that the network is available and operational. +2. **Camera initialization error**: Ensure that the camera is properly connected and working. + +## Contributing + +If you'd like to contribute to this project, please fork the repository, make your changes, and submit a pull request. + +**Issues and Pull Requests:** Feel free to open issues and submit pull requests to enhance the project. Your contributions are valued and will be reviewed. + +## Acknowledgements + +This code is a concoction of sources from several different online examples and repositories. The credit goes to all the original creators, mainly [https://github.com/espressif/esp32-camera](https://github.com/espressif/esp32-camera). clausqr has merged these sources but takes no credit for the actual code. diff --git a/img/esp32_cam.png b/img/esp32_cam.png new file mode 100644 index 0000000..8005c31 Binary files /dev/null and b/img/esp32_cam.png differ diff --git a/img/sample_image.png b/img/sample_image.png new file mode 100644 index 0000000..214e6a1 Binary files /dev/null and b/img/sample_image.png differ diff --git a/platformio.ini b/platformio.ini index 1047ce9..8ccd429 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ [env:esp32cam] #platform = espressif32 -platform = https://github.com/platformio/platform-espressif32.git#develop +platform = https://github.com/platformio/platform-espressif32.git#a9b9d094688a4ffeeca1da28d3e77e74df6d4430 board = esp32cam framework = espidf @@ -22,5 +22,4 @@ extra_scripts = ignore_no_rtti.py build_flags = -I../lib/esp32-camera -serial_port = /dev/ttyUSB0 monitor_speed = 115200 \ No newline at end of file diff --git a/src/main.c b/src/main.c index ea4a2a2..8a8f786 100644 --- a/src/main.c +++ b/src/main.c @@ -138,10 +138,10 @@ static camera_config_t camera_config = { // .pixel_format = PIXFORMAT_RGB565, //YUV422,GRAYSCALE,RGB565,JPEG .pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG // .frame_size = FRAMESIZE_QVGA, //QQVGA-UXGA, For ESP32, do not use sizes above QVGA when not JPEG. The performance of the ESP32-S series has improved a lot, but JPEG mode always gives better frame rates. - .frame_size = FRAMESIZE_240X240, //QQVGA-UXGA, For ESP32, do not use sizes above QVGA when not JPEG. The performance of the ESP32-S series has improved a lot, but JPEG mode always gives better frame rates. + .frame_size = FRAMESIZE_QVGA, //QQVGA-UXGA, For ESP32, do not use sizes above QVGA when not JPEG. The performance of the ESP32-S series has improved a lot, but JPEG mode always gives better frame rates. // .jpeg_quality = 12, //0-63, for OV series camera sensors, lower number means higher quality - .jpeg_quality = 12, //0-63, for OV series camera sensors, lower number means higher quality + .jpeg_quality = 64, //0-63, for OV series camera sensors, lower number means higher quality .fb_count = 2, //When jpeg mode is used, if fb_count more than one, the driver will work in continuous mode. // .grab_mode = CAMERA_GRAB_WHEN_EMPTY, .grab_mode = CAMERA_GRAB_LATEST, diff --git a/src/secrets.h.example b/src/secrets.h.example index 1a27a49..ff45a29 100644 --- a/src/secrets.h.example +++ b/src/secrets.h.example @@ -1,5 +1,3 @@ -#ifndef SECRETS_20COPY_H -#define SECRETS_20COPY_H #ifndef SECRETS_H #define SECRETS_H @@ -9,4 +7,3 @@ #endif /* SECRETS_H */ -#endif /* SECRETS_20COPY_H */