diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b38fc0..c5cdfe6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,18 +5,25 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 with: - python-version: '3.x' - architecture: 'x64' + submodules: 'true' + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' - name: Install PlatformIO run: python -m pip install platformio - name: Build firmware run: platformio run - name: Archive - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: firmware.bin + name: firmwares.zip path: .pio/build/*/firmware.bin diff --git a/README.md b/README.md index b33f817..4da7dc2 100644 --- a/README.md +++ b/README.md @@ -9,34 +9,43 @@ Simple [RTSP](https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol), [HTTP > This branch supports all the current devices and the Seeed Studio Xiao esp32s3! > Please use this and let me know if this works for you! - Flashing this software on a ESP32CAM module will make it a **RTSP streaming camera** server, a **HTTP Motion JPEG streamer** and a **HTTP image server**. Supported protocols -- :white_check_mark: RTSP +- RTSP The RTSP protocol is an industry standard and allows many CCTV systems and applications (like for example [VLC](https://www.videolan.org/vlc/)) to connect directly to the ESP32CAM camera stream. It is also possible to stream directly to a server using [ffmpeg](https://ffmpeg.org). This makes the module a camera server allowing recording and the stream can be stored on a disk and replayed later. The URL is rtsp://<ip address>:554/mjpeg/1 -- :white_check_mark: HTTP Motion JPEG +- HTTP Motion JPEG The HTTP JPEG streamer makes it possible to watch the camera stream directly in your browser. The URL is http://<ip address>/stream -- :white_check_mark: HTTP image +- HTTP image The HTTP Image returns an HTTP JPEG image of the camera. The URL is http://<ip address>/snapshot This software supports the following ESP32-CAM (and alike) modules: -- ESP32CAM - AI THINKER -- TTGO T-CAM -- WROVER-KIT +- EspressIf ESP-EYE +- EspressIf ESP32S2-CAM +- EspressIf ESP32S3-CAM-LCD +- EspressIf ESP32S3-EYE +- Freenove WROVER KIT +- M5STACK ESP32CAM +- M5STACK_PSRAM +- M5STACK_UNITCAM +- M5STACK_UNITCAMS3 +- M5STACK_V2_PSRAM +- M5STACK_PSRAM +- M5STACK_WIDE - M5STACK - -![ESP32CAM module](assets/ESP32-CAM.jpg) +- Seeed Studio XIAO ESP32S3 SENSE +- TTGO T-CAMERA +- TTGO T-JOURNAL The software provides a **configuration web server**, that can be used to: @@ -44,7 +53,6 @@ The software provides a **configuration web server**, that can be used to: - Set the WiFi parameters, - Set the timeout for connecting to the access point, - Set an access password, -- Select the board type, - Select the image size, - Select the frame rate, - Select the JPEG quality @@ -54,7 +62,7 @@ The software provides a **configuration web server**, that can be used to: - Brightness - Contrast - Saturation - - Special effect (Normal, Negative, Grayscale, Red/Green/Blue tint, Sepia) + - Special effect (Normal, Negative, Gray-scale, Red/Green/Blue tint, Sepia) - White balance - Automatic White Balance gain - Wite Balance mode @@ -83,25 +91,34 @@ It advertises HTTP (port 80) and RTSP (port 554) - USB to Serial (TTL level) converter, piggyback board ESP32-CAM-MB or other way to connect to the device, - [**PlatformIO**](https://platformio.org/) software (free download) +## Boards + +There are a lot of boards available that are all called ESP32-CAM. +However, there are differences in CPU (type/speed/cores), how the camera is connected, presence of PSRAM or not... +To select the right board use the table below and use the configuration that is listed below for your board: + +| Board | Image | CPU | SRAM | Flash | PSRAM | Camera | | Site | +|--- |--- |--- |--- |--- | --- |--- |--- |--- | +| Espressif ESP32-Wrover CAM | ![img](assets/boards/esp32-wrover-cam.jpg) | ESP32 | 520KB | 4Mb | 4MB | OV2640 | | | +| AI-Thinker ESP32-CAM | ![img](assets/boards/ai-thinker-esp32-cam-ipex.jpg) ![img](assets/boards/ai-thinker-esp32-cam.jpg) | ESP32-S | 520KB | 4Mb | 4MB | OV2640 | | https://docs.ai-thinker.com/esp32-cam | +| Espressif ESP-EYE | ![img](assets/boards/espressif-esp-eye.jpg) | ESP32 | 520KB | 4Mb | 4MB | OV2640 | | | +| Espressif ESP-S3-EYE | ![img](assets/boards/espressif-esps3-eye.jpg) | ESP32-S3 | 520KB | 4Mb | 4MB | OV2640 | | https://www.espressif.com/en/products/devkits/esp-eye/overview | +| LilyGo camera module | ![img](assets/boards/lilygo-camera-module.jpg) | ESP32 Wrover | 520KB | 4Mb | 4MB | OV2640 / OV5640 | | | +| LilyGo Simcam | ![img](assets/boards/lilygo-simcam.jpg) | | | | | OV2640 | | | +| LilyGo TTGO-T Camera | ![img](assets/boards/lilygo-ttgo-t-camera.jpg) | | | | | OV2640 | | | +| M5Stack ESP32CAM | ![img](assets/boards/m5stack_esp32cam_02.webp) | ESP32 | 520Kb | 4Mb | - | OV2640 | Microphone | https://docs.m5stack.com/en/unit/esp32cam | +| M5Stack UnitCam | ![img](assets/boards/m5stack_unit_cam_02.webp) ![img](assets/boards/m5stack_unit_cam_03.webp) | ESP32-WROOM-32E | 520KB | 4Mb | - | OV2640 | | https://docs.m5stack.com/en/unit/unit_cam | +| M5Stack Camera | ![img](assets/boards/m5stack-esp32-camera.jpg) | ESP32 | 520Kb | 4Mb | - | OV2640 | | https://docs.m5stack.com/en/unit/m5camera | +| M5Stack Camera PSRAM | ![img](assets/boards/m5stack-esp32-camera.jpg) | ESP32 | 520Kb | 4Mb | 4Mb | OV2640 | | https://docs.m5stack.com/en/unit/m5camera | +| M5Stack UnitCamS3 | ![img](assets/boards//m5stack_Unitcams3.webp) ![img](assets/boards/m5stack_Unitcams32.webp) | ESP32-S3-WROOM-1-N16R8 | 520Kb | 16Mb | 8Mb | OV2640 | | https://docs.m5stack.com/en/unit/Unit-CamS3 | +| Seeed studio Xiao ESP32S3 Sense | ![img](assets/boards/seeed-studio-xiao-esp32s3-sense.jpg) | ESP32-S3R8 | 520KB | 8Mb | 8MB | OV2640 | Microphone | https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html | + ## Installing and running PlatformIO PlatformIO is available for all major operating systems: Windows, Linux and MacOS. It is also provided as a plugin to [Visual Studio Code](https://visualstudio.microsoft.com). More information can be found at: [https://docs.platformio.org/en/latest/installation.html](https://docs.platformio.org/en/latest/installation.html) below the basics. -### Debian based systems command-line install - -Install platformIO - -```sh - sudo apt-get install python-pip - sudo pip install platformio - pio upgrade -``` - -### Windows, Linux and MacOS - -Install [**Visual Studio code**](https://code.visualstudio.com) and install the PlatformIO plugin. -For command line usage Python and PlatformIO-Core is sufficient. +Install [Visual Studio Code](https://code.visualstudio.com) and install the PlatformIO plugin. ## Putting the ESP32-CAM in download mode @@ -135,7 +152,6 @@ cd esp32cam-rtsp Next, the firmware has to be build and deployed to the ESP32. There are to flavours to do this; using the command line or the graphical interface of Visual Studio Code. -I recommend to use VIsual Studio Code as it is free to use and offers more insight. ### Using the command line @@ -240,16 +256,8 @@ Calling this URL will start the form for configuring the device in the browser. ### GET: /snapshot Calling this URL will return a JPEG snapshot of the camera in the browser. - This request can also be used (for example using cURL) to save the snapshot to a file. -### GET: /flash?v={intensity} - -Calling this URL will set the intensity of the flash LED. Authentication is required. - -The parameter v for the intensity must be between 0 (off) and 255 (max). -If no v parameter is present, it will be set to the value of the flash LED intensity from configuration. - ## Issues / Nice to know - The red LED on the back of the device indicates the device is not connected. @@ -284,14 +292,22 @@ The availability of PSRAM can be seen in the HTML status overview. Not all the boards are equipped with PSRAM: -| Board | PSRAM | -|--- |--- | -| ESP32CAM | Yes | -| ESP32CAM (USB-C) | No | -| AI THINKER | Yes | -| TTGO T-CAM | No | -| M5 STACK| | No | -| WROVER KIT | Yes | +| Board | PSRAM | +|--- |--- | +| WROVER_KIT | 8Mb | +| ESP_EYE | 8Mb | +| ESP32S3_EYE | 8Mb | +| M5STACK_PSRAM | 8Mb | +| M5STACK_V2_PSRAM | Version B only | +| M5STACK_WIDE | 8Mb | +| M5STACK_ESP32CAM | No | +| M5STACK_UNITCAM | No | +| M5STACK_UNITCAMS3 | 8Mb | +| AI_THINKER | 8Mb | +| TTGO_T_JOURNAL | No | +| ESP32_CAM_BOARD | ? | +| ESP32S2_CAM_BOARD | ? | +| ESP32S3_CAM_LCD | ? | Depending on the image resolution, framerate and quality, the PSRAM must be enabled and/or the number of frame buffers increased to keep up with the data generated by the sensor. There are (a lot of?) boards around with faulty PSRAM. If the camera fails to initialize, this might be a reason. See on [Reddit](https://www.reddit.com/r/esp32/comments/z2hyns/i_have_a_faulty_psram_on_my_esp32cam_what_should/). @@ -323,6 +339,14 @@ esp32cam-rtsp depends on PlatformIO, Bootstrap 5 and Micro-RTSP by Kevin Hester. ## Change history +- January 2024 + - Moved settings to board definitions + - Added new boards + - Removed OTA to increase performance +- Oktober 2023 + - Added support for Seeed Xiao esp32s3 + - New build system + - Updated documentation - March 2023 - Added options to set PSRAM / Frame buffers - Added JPEG Motion streaming diff --git a/assets/ESP32-CAM-MB.jpg b/assets/ESP32-CAM-MB.jpg deleted file mode 100644 index 13226eb..0000000 Binary files a/assets/ESP32-CAM-MB.jpg and /dev/null differ diff --git a/assets/ESP32-CAM.jpg b/assets/ESP32-CAM.jpg deleted file mode 100644 index e69fe5f..0000000 Binary files a/assets/ESP32-CAM.jpg and /dev/null differ diff --git a/assets/boards/ai-thinker-esp32-cam-ipex.jpg b/assets/boards/ai-thinker-esp32-cam-ipex.jpg new file mode 100644 index 0000000..a819215 Binary files /dev/null and b/assets/boards/ai-thinker-esp32-cam-ipex.jpg differ diff --git a/assets/boards/ai-thinker-esp32-cam-mb.jpg b/assets/boards/ai-thinker-esp32-cam-mb.jpg new file mode 100644 index 0000000..027ad46 Binary files /dev/null and b/assets/boards/ai-thinker-esp32-cam-mb.jpg differ diff --git a/assets/boards/ai-thinker-esp32-cam.jpg b/assets/boards/ai-thinker-esp32-cam.jpg new file mode 100644 index 0000000..5cca775 Binary files /dev/null and b/assets/boards/ai-thinker-esp32-cam.jpg differ diff --git a/assets/boards/ai_thinker_esp32-cam.jpg b/assets/boards/ai_thinker_esp32-cam.jpg new file mode 100644 index 0000000..87f9b3f Binary files /dev/null and b/assets/boards/ai_thinker_esp32-cam.jpg differ diff --git a/assets/boards/datasheets/ov2640_ds_1.8_.pdf b/assets/boards/datasheets/ov2640_ds_1.8_.pdf new file mode 100644 index 0000000..3281d2d Binary files /dev/null and b/assets/boards/datasheets/ov2640_ds_1.8_.pdf differ diff --git a/assets/boards/esp-lyrap-cam-v1.0-3d.png b/assets/boards/esp-lyrap-cam-v1.0-3d.png new file mode 100644 index 0000000..d3f0a6b Binary files /dev/null and b/assets/boards/esp-lyrap-cam-v1.0-3d.png differ diff --git a/assets/boards/esp32-wrover-cam.jpg b/assets/boards/esp32-wrover-cam.jpg new file mode 100644 index 0000000..f58b5bb Binary files /dev/null and b/assets/boards/esp32-wrover-cam.jpg differ diff --git a/assets/boards/espressif-esp-eye.jpg b/assets/boards/espressif-esp-eye.jpg new file mode 100644 index 0000000..8276dd8 Binary files /dev/null and b/assets/boards/espressif-esp-eye.jpg differ diff --git a/assets/boards/espressif-esps3-eye.jpg b/assets/boards/espressif-esps3-eye.jpg new file mode 100644 index 0000000..79a072e Binary files /dev/null and b/assets/boards/espressif-esps3-eye.jpg differ diff --git a/assets/boards/lilygo-camera-module.jpg b/assets/boards/lilygo-camera-module.jpg new file mode 100644 index 0000000..63312e8 Binary files /dev/null and b/assets/boards/lilygo-camera-module.jpg differ diff --git a/assets/boards/lilygo-simcam.jpg b/assets/boards/lilygo-simcam.jpg new file mode 100644 index 0000000..357f56b Binary files /dev/null and b/assets/boards/lilygo-simcam.jpg differ diff --git a/assets/boards/lilygo-ttgo-t-camera.jpg b/assets/boards/lilygo-ttgo-t-camera.jpg new file mode 100644 index 0000000..4415c24 Binary files /dev/null and b/assets/boards/lilygo-ttgo-t-camera.jpg differ diff --git a/assets/boards/m5stack-esp32-camera.jpg b/assets/boards/m5stack-esp32-camera.jpg new file mode 100644 index 0000000..a240056 Binary files /dev/null and b/assets/boards/m5stack-esp32-camera.jpg differ diff --git a/assets/boards/m5stack_Unitcams3.webp b/assets/boards/m5stack_Unitcams3.webp new file mode 100644 index 0000000..1945bcf Binary files /dev/null and b/assets/boards/m5stack_Unitcams3.webp differ diff --git a/assets/boards/m5stack_Unitcams32.webp b/assets/boards/m5stack_Unitcams32.webp new file mode 100644 index 0000000..d70994c Binary files /dev/null and b/assets/boards/m5stack_Unitcams32.webp differ diff --git a/assets/boards/m5stack_Unitcams33webp.webp b/assets/boards/m5stack_Unitcams33webp.webp new file mode 100644 index 0000000..91a49b4 Binary files /dev/null and b/assets/boards/m5stack_Unitcams33webp.webp differ diff --git a/assets/boards/m5stack_esp32cam_02.webp b/assets/boards/m5stack_esp32cam_02.webp new file mode 100644 index 0000000..d3afa6b Binary files /dev/null and b/assets/boards/m5stack_esp32cam_02.webp differ diff --git a/assets/boards/m5stack_unit_cam_02.webp b/assets/boards/m5stack_unit_cam_02.webp new file mode 100644 index 0000000..c1db855 Binary files /dev/null and b/assets/boards/m5stack_unit_cam_02.webp differ diff --git a/assets/boards/m5stack_unit_cam_03.webp b/assets/boards/m5stack_unit_cam_03.webp new file mode 100644 index 0000000..2de9f0b Binary files /dev/null and b/assets/boards/m5stack_unit_cam_03.webp differ diff --git a/assets/boards/schematics/ESP-LyraP-CAM_V1.1_SCH_20200511A.pdf b/assets/boards/schematics/ESP-LyraP-CAM_V1.1_SCH_20200511A.pdf new file mode 100644 index 0000000..65c463e Binary files /dev/null and b/assets/boards/schematics/ESP-LyraP-CAM_V1.1_SCH_20200511A.pdf differ diff --git a/assets/boards/schematics/UnitCamS3.png b/assets/boards/schematics/UnitCamS3.png new file mode 100644 index 0000000..6f6c874 Binary files /dev/null and b/assets/boards/schematics/UnitCamS3.png differ diff --git a/assets/boards/schematics/XIAO_ESP32S3_ExpBoard_v1.0_SCH.pdf b/assets/boards/schematics/XIAO_ESP32S3_ExpBoard_v1.0_SCH.pdf new file mode 100644 index 0000000..191e552 Binary files /dev/null and b/assets/boards/schematics/XIAO_ESP32S3_ExpBoard_v1.0_SCH.pdf differ diff --git a/assets/boards/schematics/ai_thinker_esp32cam.pdf b/assets/boards/schematics/ai_thinker_esp32cam.pdf new file mode 100644 index 0000000..e24574b Binary files /dev/null and b/assets/boards/schematics/ai_thinker_esp32cam.pdf differ diff --git a/assets/boards/schematics/m5stack_unit_cam_sch_01.webp b/assets/boards/schematics/m5stack_unit_cam_sch_01.webp new file mode 100644 index 0000000..80c49dc Binary files /dev/null and b/assets/boards/schematics/m5stack_unit_cam_sch_01.webp differ diff --git a/assets/boards/seeed-studio-xiao-esp32s3-sense.jpg b/assets/boards/seeed-studio-xiao-esp32s3-sense.jpg new file mode 100644 index 0000000..c70122a Binary files /dev/null and b/assets/boards/seeed-studio-xiao-esp32s3-sense.jpg differ diff --git a/boards/esp32cam_ai_thinker.json b/boards/esp32cam_ai_thinker.json new file mode 100644 index 0000000..7db7f1d --- /dev/null +++ b/boards/esp32cam_ai_thinker.json @@ -0,0 +1,65 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_AI_THINKER'", + "'-D BOARD_HAS_PSRAM'", + "'-mfix-esp32-psram-cache-issue'", + "'-D USER_LED_GPIO=33'", + "'-D USER_LED_ON_LEVEL=LOW'", + "'-D CAMERA_CONFIG_PIN_PWDN=32'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=0'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=26'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=27'", + "'-D CAMERA_CONFIG_PIN_Y9=35'", + "'-D CAMERA_CONFIG_PIN_Y8=34'", + "'-D CAMERA_CONFIG_PIN_Y7=39'", + "'-D CAMERA_CONFIG_PIN_Y6=36'", + "'-D CAMERA_CONFIG_PIN_Y5=21'", + "'-D CAMERA_CONFIG_PIN_Y4=19'", + "'-D CAMERA_CONFIG_PIN_Y3=18'", + "'-D CAMERA_CONFIG_PIN_Y2=5'", + "'-D CAMERA_CONFIG_PIN_VSYNC=25'", + "'-D CAMERA_CONFIG_PIN_HREF=23'", + "'-D CAMERA_CONFIG_PIN_PCLK=22'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32CAM AI Thinker", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.ai-thinker.com/esp32-cam", + "vendor": "Anxinke" +} diff --git a/boards/esp32cam_espressif_esp32s2_cam_board.json b/boards/esp32cam_espressif_esp32s2_cam_board.json new file mode 100644 index 0000000..725fa48 --- /dev/null +++ b/boards/esp32cam_espressif_esp32s2_cam_board.json @@ -0,0 +1,61 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32s2_out.ld" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_ESPRESSIF_ESP32S2_CAM_BOARD'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=0'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D CAMERA_CONFIG_PIN_PWDN=1'", + "'-D CAMERA_CONFIG_PIN_RESET=2'", + "'-D CAMERA_CONFIG_PIN_XCLK=42'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=41'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=18'", + "'-D CAMERA_CONFIG_PIN_Y9=16'", + "'-D CAMERA_CONFIG_PIN_Y8=39'", + "'-D CAMERA_CONFIG_PIN_Y7=40'", + "'-D CAMERA_CONFIG_PIN_Y6=15'", + "'-D CAMERA_CONFIG_PIN_Y5=12'", + "'-D CAMERA_CONFIG_PIN_Y4=5'", + "'-D CAMERA_CONFIG_PIN_Y3=13'", + "'-D CAMERA_CONFIG_PIN_Y2=14'", + "'-D CAMERA_CONFIG_PIN_VSYNC=38'", + "'-D CAMERA_CONFIG_PIN_HREF=4'", + "'-D CAMERA_CONFIG_PIN_PCLK=3'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "mcu": "esp32s2", + "variant": "esp32s2" + }, + "connectivity": [ + "wifi" + ], + "debug": { + "openocd_target": "esp32s2.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif ESP32-S2-Saola-1", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-esp-lyrap-cam-v1.1.html", + "vendor": "Espressif" +} diff --git a/boards/esp32cam_espressif_esp32s2_cam_header.json b/boards/esp32cam_espressif_esp32s2_cam_header.json new file mode 100644 index 0000000..347264f --- /dev/null +++ b/boards/esp32cam_espressif_esp32s2_cam_header.json @@ -0,0 +1,61 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32s2_out.ld" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_ESPRESSIF_ESP32S2_CAM_BOARD'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=0'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D CAMERA_CONFIG_PIN_PWDN=1'", + "'-D CAMERA_CONFIG_PIN_RESET=2'", + "'-D CAMERA_CONFIG_PIN_XCLK=42'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=41'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=18'", + "'-D CAMERA_CONFIG_PIN_Y9=16'", + "'-D CAMERA_CONFIG_PIN_Y8=39'", + "'-D CAMERA_CONFIG_PIN_Y7=40'", + "'-D CAMERA_CONFIG_PIN_Y6=15'", + "'-D CAMERA_CONFIG_PIN_Y5=13'", + "'-D CAMERA_CONFIG_PIN_Y4=5'", + "'-D CAMERA_CONFIG_PIN_Y3=12'", + "'-D CAMERA_CONFIG_PIN_Y2=14'", + "'-D CAMERA_CONFIG_PIN_VSYNC=38'", + "'-D CAMERA_CONFIG_PIN_HREF=4'", + "'-D CAMERA_CONFIG_PIN_PCLK=3'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "mcu": "esp32s2", + "variant": "esp32s2" + }, + "connectivity": [ + "wifi" + ], + "debug": { + "openocd_target": "esp32s2.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif ESP32-S2-Saola-1", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-esp-lyrap-cam-v1.1.html", + "vendor": "Espressif" +} diff --git a/boards/esp32cam_espressif_esp32s3_cam_lcd.json b/boards/esp32cam_espressif_esp32s3_cam_lcd.json new file mode 100644 index 0000000..a847749 --- /dev/null +++ b/boards/esp32cam_espressif_esp32s3_cam_lcd.json @@ -0,0 +1,71 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_8MB.csv", + "memory_type": "opi_opi" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_ESP32S3_CAM_LCD'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=1'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=40'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=17'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=18'", + "'-D CAMERA_CONFIG_PIN_Y9=39'", + "'-D CAMERA_CONFIG_PIN_Y8=41'", + "'-D CAMERA_CONFIG_PIN_Y7=42'", + "'-D CAMERA_CONFIG_PIN_Y6=12'", + "'-D CAMERA_CONFIG_PIN_Y5=3'", + "'-D CAMERA_CONFIG_PIN_Y4=14'", + "'-D CAMERA_CONFIG_PIN_Y3=47'", + "'-D CAMERA_CONFIG_PIN_Y2=13'", + "'-D CAMERA_CONFIG_PIN_VSYNC=21'", + "'-D CAMERA_CONFIG_PIN_HREF=38'", + "'-D CAMERA_CONFIG_PIN_PCLK=11'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "dout", + "hwids": [ + [ + "0X303A", + "0x1001" + ] + ], + "mcu": "esp32s3", + "variant": "esp32s3camlcd" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32S3-CAM LCD", + "upload": { + "flash_size": "8MB", + "maximum_ram_size": 327680, + "maximum_size": 8388608, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.espressif.com/en/news/Maple_Eye_ESP32-S3", + "vendor": "Espressif" +} diff --git a/boards/esp32cam_espressif_esp32s3_eye.json b/boards/esp32cam_espressif_esp32s3_eye.json new file mode 100644 index 0000000..b67514d --- /dev/null +++ b/boards/esp32cam_espressif_esp32s3_eye.json @@ -0,0 +1,75 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_ESPRESSIF_ESP32S3_EYE'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=1'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=15'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=4'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=5'", + "'-D CAMERA_CONFIG_PIN_Y9=16'", + "'-D CAMERA_CONFIG_PIN_Y8=17'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=12'", + "'-D CAMERA_CONFIG_PIN_Y5=10'", + "'-D CAMERA_CONFIG_PIN_Y4=8'", + "'-D CAMERA_CONFIG_PIN_Y3=9'", + "'-D CAMERA_CONFIG_PIN_Y2=11'", + "'-D CAMERA_CONFIG_PIN_VSYNC=6'", + "'-D CAMERA_CONFIG_PIN_HREF=7'", + "'-D CAMERA_CONFIG_PIN_PCLK=13'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [ + [ + "0x2886", + "0x0056" + ], + [ + "0x2886", + "0x8056" + ] + ], + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32S3_EYE", + "upload": { + "flash_size": "8MB", + "maximum_ram_size": 327680, + "maximum_size": 8388608, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.espressif.com/en/products/devkits/esp-eye/overview", + "vendor": "Espressif" +} diff --git a/boards/esp32cam_espressif_esp_eye.json b/boards/esp32cam_espressif_esp_eye.json new file mode 100644 index 0000000..c22f0e1 --- /dev/null +++ b/boards/esp32cam_espressif_esp_eye.json @@ -0,0 +1,65 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_ESPRESSIF_ESP_EYE'", + "'-D BOARD_HAS_PSRAM'", + "'-mfix-esp32-psram-cache-issue'", + "'-D USER_LED_GPIO=14'", + "'-D USER_LED_ON_LEVEL=HIGH'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=11'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=17'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=41'", + "'-D CAMERA_CONFIG_PIN_Y9=13'", + "'-D CAMERA_CONFIG_PIN_Y8=4'", + "'-D CAMERA_CONFIG_PIN_Y7=10'", + "'-D CAMERA_CONFIG_PIN_Y6=5'", + "'-D CAMERA_CONFIG_PIN_Y5=7'", + "'-D CAMERA_CONFIG_PIN_Y4=16'", + "'-D CAMERA_CONFIG_PIN_Y3=15'", + "'-D CAMERA_CONFIG_PIN_Y2=6'", + "'-D CAMERA_CONFIG_PIN_VSYNC=42'", + "'-D CAMERA_CONFIG_PIN_HREF=18'", + "'-D CAMERA_CONFIG_PIN_PCLK=12'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=1'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM AI Thinker", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.espressif.com/en/products/devkits/esp-eye/overview", + "vendor": "Espressif" +} diff --git a/boards/esp32cam_freenove_wrover_kit.json b/boards/esp32cam_freenove_wrover_kit.json new file mode 100644 index 0000000..14099ff --- /dev/null +++ b/boards/esp32cam_freenove_wrover_kit.json @@ -0,0 +1,65 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_WROVER_KIT'", + "'-D BOARD_HAS_PSRAM'", + "'-mfix-esp32-psram-cache-issue'", + "'-D USER_LED_GPIO=2'", + "'-D USER_LED_ON_LEVEL=HIGH'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=21'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=26'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=27'", + "'-D CAMERA_CONFIG_PIN_Y9=35'", + "'-D CAMERA_CONFIG_PIN_Y8=34'", + "'-D CAMERA_CONFIG_PIN_Y7=39'", + "'-D CAMERA_CONFIG_PIN_Y6=36'", + "'-D CAMERA_CONFIG_PIN_Y5=19'", + "'-D CAMERA_CONFIG_PIN_Y4=18'", + "'-D CAMERA_CONFIG_PIN_Y3=5'", + "'-D CAMERA_CONFIG_PIN_Y2=4'", + "'-D CAMERA_CONFIG_PIN_VSYNC=25'", + "'-D CAMERA_CONFIG_PIN_HREF=23'", + "'-D CAMERA_CONFIG_PIN_PCLK=22'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM WROVER kit", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.aliexpress.com/item/1005004960637276.html", + "vendor": "Freenove" +} diff --git a/boards/esp32cam_m5stack_camera.json b/boards/esp32cam_m5stack_camera.json new file mode 100644 index 0000000..cc62530 --- /dev/null +++ b/boards/esp32cam_m5stack_camera.json @@ -0,0 +1,63 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=15'", + "'-D CAMERA_CONFIG_PIN_XCLK=27'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=25'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=23'", + "'-D CAMERA_CONFIG_PIN_Y9=19'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=39'", + "'-D CAMERA_CONFIG_PIN_Y5=5'", + "'-D CAMERA_CONFIG_PIN_Y4=34'", + "'-D CAMERA_CONFIG_PIN_Y3=35'", + "'-D CAMERA_CONFIG_PIN_Y2=32'", + "'-D CAMERA_CONFIG_PIN_VSYNC=25'", + "'-D CAMERA_CONFIG_PIN_HREF=26'", + "'-D CAMERA_CONFIG_PIN_PCLK=21'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=1'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'", + "'-D GROVE_SDA=13'", + "'-D GROVE_SCL=4'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM M5 STACK", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.m5stack.com/en/unit/m5camera", + "vendor": "M5STACK" +} diff --git a/boards/esp32cam_m5stack_camera_psram.json b/boards/esp32cam_m5stack_camera_psram.json new file mode 100644 index 0000000..00f47de --- /dev/null +++ b/boards/esp32cam_m5stack_camera_psram.json @@ -0,0 +1,65 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK_CAMERA_PSRAM'", + "'-D BOARD_HAS_PSRAM'", + "'-mfix-esp32-psram-cache-issue'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=15'", + "'-D CAMERA_CONFIG_PIN_XCLK=27'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=25'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=23'", + "'-D CAMERA_CONFIG_PIN_Y9=19'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=39'", + "'-D CAMERA_CONFIG_PIN_Y5=5'", + "'-D CAMERA_CONFIG_PIN_Y4=34'", + "'-D CAMERA_CONFIG_PIN_Y3=35'", + "'-D CAMERA_CONFIG_PIN_Y2=32'", + "'-D CAMERA_CONFIG_PIN_VSYNC=22'", + "'-D CAMERA_CONFIG_PIN_HREF=26'", + "'-D CAMERA_CONFIG_PIN_PCLK=21'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'", + "'-D GROVE_SDA=13'", + "'-D GROVE_SCL=4'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM M5 STACK", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.m5stack.com/en/unit/m5camera", + "vendor": "M5STACK" +} diff --git a/boards/esp32cam_m5stack_esp32cam.json b/boards/esp32cam_m5stack_esp32cam.json new file mode 100644 index 0000000..8d726dc --- /dev/null +++ b/boards/esp32cam_m5stack_esp32cam.json @@ -0,0 +1,68 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK_ESP32CAM'", + "'-D BOARD_HAS_PSRAM'", + "'-mfix-esp32-psram-cache-issue'", + "'-D USER_LED_GPIO=16'", + "'-D USER_LED_ON_LEVEL=LOW'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=15'", + "'-D CAMERA_CONFIG_PIN_XCLK=27'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=25'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=23'", + "'-D CAMERA_CONFIG_PIN_Y9=19'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=39'", + "'-D CAMERA_CONFIG_PIN_Y5=5'", + "'-D CAMERA_CONFIG_PIN_Y4=34'", + "'-D CAMERA_CONFIG_PIN_Y3=35'", + "'-D CAMERA_CONFIG_PIN_Y2=17'", + "'-D CAMERA_CONFIG_PIN_VSYNC=22'", + "'-D CAMERA_CONFIG_PIN_HREF=26'", + "'-D CAMERA_CONFIG_PIN_PCLK=21'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'", + "'-D MICROPHONE_GPIO=32'", + "'-D GROVE_SDA=13'", + "'-D GROVE_SCL=4'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM M5STACK ESP32CAM", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.m5stack.com/en/unit/esp32cam", + "vendor": "M5STACK" +} diff --git a/boards/esp32cam_m5stack_unitcam.json b/boards/esp32cam_m5stack_unitcam.json new file mode 100644 index 0000000..b11599e --- /dev/null +++ b/boards/esp32cam_m5stack_unitcam.json @@ -0,0 +1,63 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK_UNITCAM'", + "'-D USER_LED_GPIO=4'", + "'-D USER_LED_ON_LEVEL=LOW'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=15'", + "'-D CAMERA_CONFIG_PIN_XCLK=27'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=25'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=23'", + "'-D CAMERA_CONFIG_PIN_Y9=19'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=39'", + "'-D CAMERA_CONFIG_PIN_Y5=5'", + "'-D CAMERA_CONFIG_PIN_Y4=34'", + "'-D CAMERA_CONFIG_PIN_Y3=35'", + "'-D CAMERA_CONFIG_PIN_Y2=32'", + "'-D CAMERA_CONFIG_PIN_VSYNC=22'", + "'-D CAMERA_CONFIG_PIN_HREF=26'", + "'-D CAMERA_CONFIG_PIN_PCLK=21'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=1'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM M5STACK UNITCAM", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.m5stack.com/en/unit/unit_cam", + "vendor": "M5STACK" +} diff --git a/boards/esp32cam_m5stack_unitcams3.json b/boards/esp32cam_m5stack_unitcams3.json new file mode 100644 index 0000000..7926893 --- /dev/null +++ b/boards/esp32cam_m5stack_unitcams3.json @@ -0,0 +1,83 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK_UNITCAMS3'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=1'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D USER_LED_GPIO=14'", + "'-D USER_LED_ON_LEVEL=HIGH'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=21'", + "'-D CAMERA_CONFIG_PIN_XCLK=11'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=17'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=41'", + "'-D CAMERA_CONFIG_PIN_Y9=35'", + "'-D CAMERA_CONFIG_PIN_Y8=34'", + "'-D CAMERA_CONFIG_PIN_Y7=39'", + "'-D CAMERA_CONFIG_PIN_Y6=36'", + "'-D CAMERA_CONFIG_PIN_Y5=19'", + "'-D CAMERA_CONFIG_PIN_Y4=18'", + "'-D CAMERA_CONFIG_PIN_Y3=5'", + "'-D CAMERA_CONFIG_PIN_Y2=4'", + "'-D CAMERA_CONFIG_PIN_VSYNC=25'", + "'-D CAMERA_CONFIG_PIN_HREF=23'", + "'-D CAMERA_CONFIG_PIN_PCLK=22'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'", + "'-D I2C_MEMS_SDA=48'", + "'-D I2C_MEMS_SCL=47'", + "'-D TF_CS=9'", + "'-D TF_MOSI=38'", + "'-D TF_CLK=39'", + "'-D TF_MISO=40'" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [ + [ + "0x2886", + "0x0056" + ], + [ + "0x2886", + "0x8056" + ] + ], + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM M5STACK UNITCAMS3", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.m5stack.com/en/unit/Unit-CamS3", + "vendor": "M5STACK" +} diff --git a/boards/esp32cam_m5stack_wide.json b/boards/esp32cam_m5stack_wide.json new file mode 100644 index 0000000..df425dd --- /dev/null +++ b/boards/esp32cam_m5stack_wide.json @@ -0,0 +1,63 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK_WIDE'", + "'-D BOARD_HAS_PSRAM'", + "'-mfix-esp32-psram-cache-issue'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=15'", + "'-D CAMERA_CONFIG_PIN_XCLK=27'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=22'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=23'", + "'-D CAMERA_CONFIG_PIN_Y9=19'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=39'", + "'-D CAMERA_CONFIG_PIN_Y5=5'", + "'-D CAMERA_CONFIG_PIN_Y4=34'", + "'-D CAMERA_CONFIG_PIN_Y3=35'", + "'-D CAMERA_CONFIG_PIN_Y2=32'", + "'-D CAMERA_CONFIG_PIN_VSYNC=25'", + "'-D CAMERA_CONFIG_PIN_HREF=26'", + "'-D CAMERA_CONFIG_PIN_PCLK=21'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM M5 STACK WIDE", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://shop.m5stack.com/collections/m5-cameras", + "vendor": "M5STACK" +} diff --git a/boards/esp32cam_seeed_xiao_esp32s3_sense.json b/boards/esp32cam_seeed_xiao_esp32s3_sense.json new file mode 100644 index 0000000..fa36d88 --- /dev/null +++ b/boards/esp32cam_seeed_xiao_esp32s3_sense.json @@ -0,0 +1,83 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_SEEED_XIAO_ESP32S3_SENSE'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=1'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D USER_LED_GPIO=21'", + "'-D USER_LED_ON_LEVEL=LOW'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=10'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=40'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=39'", + "'-D CAMERA_CONFIG_PIN_Y9=48'", + "'-D CAMERA_CONFIG_PIN_Y8=11'", + "'-D CAMERA_CONFIG_PIN_Y7=12'", + "'-D CAMERA_CONFIG_PIN_Y6=14'", + "'-D CAMERA_CONFIG_PIN_Y5=16'", + "'-D CAMERA_CONFIG_PIN_Y4=18'", + "'-D CAMERA_CONFIG_PIN_Y3=17'", + "'-D CAMERA_CONFIG_PIN_Y2=15'", + "'-D CAMERA_CONFIG_PIN_VSYNC=38'", + "'-D CAMERA_CONFIG_PIN_HREF=47'", + "'-D CAMERA_CONFIG_PIN_PCLK=13'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'", + "'-D I2C_MEMS_SDA=41'", + "'-D I2C_MEMS_SCL=42'", + "'-D TF_CS=21'", + "'-D TF_MOSI=10'", + "'-D TF_CLK=8'", + "'-D TF_MISO=9'" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [ + [ + "0x2886", + "0x0056" + ], + [ + "0x2886", + "0x8056" + ] + ], + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Seeed Studio XIAO ESP32S3 Sense", + "upload": { + "flash_size": "8MB", + "maximum_ram_size": 327680, + "maximum_size": 8388608, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.seeedstudio.com/XIAO-ESP32S3-p-5627.html", + "vendor": "Seeed Studio" +} diff --git a/boards/esp32cam_ttgo_t_camera.json b/boards/esp32cam_ttgo_t_camera.json new file mode 100644 index 0000000..1f693f3 --- /dev/null +++ b/boards/esp32cam_ttgo_t_camera.json @@ -0,0 +1,65 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_TTGO_T_CAMERA'", + "'-D CAMERA_CONFIG_PIN_PWDN=26'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=32'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=13'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=12'", + "'-D CAMERA_CONFIG_PIN_Y9=39'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=23'", + "'-D CAMERA_CONFIG_PIN_Y6=18'", + "'-D CAMERA_CONFIG_PIN_Y5=15'", + "'-D CAMERA_CONFIG_PIN_Y4=4'", + "'-D CAMERA_CONFIG_PIN_Y3=14'", + "'-D CAMERA_CONFIG_PIN_Y2=5'", + "'-D CAMERA_CONFIG_PIN_VSYNC=27'", + "'-D CAMERA_CONFIG_PIN_HREF=25'", + "'-D CAMERA_CONFIG_PIN_PCLK=19'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=1'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'", + "'-D LCD_SSD1306_PIN_SDA=21'", + "'-D LCD_SSD1306_PIN_SCL=22'", + "'-D BUTTON_RIGHT_PIN=34'", + "'-D PIR_PIN=33'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM TTGO-T-CAMERA", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.lilygo.cc/products/", + "vendor": "LILYGO" +} \ No newline at end of file diff --git a/boards/esp32cam_ttgo_t_journal.json b/boards/esp32cam_ttgo_t_journal.json new file mode 100644 index 0000000..885d5c0 --- /dev/null +++ b/boards/esp32cam_ttgo_t_journal.json @@ -0,0 +1,61 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_TTGO_T_JOURNAL'", + "'-D CAMERA_CONFIG_PIN_PWDN=0'", + "'-D CAMERA_CONFIG_PIN_RESET=15'", + "'-D CAMERA_CONFIG_PIN_XCLK=27'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=25'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=23'", + "'-D CAMERA_CONFIG_PIN_Y9=19'", + "'-D CAMERA_CONFIG_PIN_Y8=36'", + "'-D CAMERA_CONFIG_PIN_Y7=18'", + "'-D CAMERA_CONFIG_PIN_Y6=39'", + "'-D CAMERA_CONFIG_PIN_Y5=5'", + "'-D CAMERA_CONFIG_PIN_Y4=34'", + "'-D CAMERA_CONFIG_PIN_Y3=35'", + "'-D CAMERA_CONFIG_PIN_Y2=17'", + "'-D CAMERA_CONFIG_PIN_VSYNC=22'", + "'-D CAMERA_CONFIG_PIN_HREF=26'", + "'-D CAMERA_CONFIG_PIN_PCLK=21'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=1'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'" + ], + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-CAM TTGO-T-JOURNAL", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.lilygo.cc/products/", + "vendor": "LILYGO" +} \ No newline at end of file diff --git a/generate_html.ps1 b/generate_html.ps1 index 9474aa3..41885f2 100644 --- a/generate_html.ps1 +++ b/generate_html.ps1 @@ -1,5 +1,4 @@ . python3 -m pip install --upgrade pip setuptools wheel . python3 -m pip install minify-html -. python3 ./minify.py ./html/index.html ./html/index.min.html -. python3 ./minify.py ./html/restart.html ./html/restart.min.html \ No newline at end of file +. python3 ./minify.py ./html/index.html ./html/index.min.html \ No newline at end of file diff --git a/generate_html.sh b/generate_html.sh index 7920450..c313849 100755 --- a/generate_html.sh +++ b/generate_html.sh @@ -3,5 +3,4 @@ python3 -m pip install --upgrade pip setuptools wheel python3 -m pip install minify-html -python3 ./minify.py ./html/index.html ./html/index.min.html -python3 ./minify.py ./html/restart.html ./html/restart.min.html \ No newline at end of file +python3 ./minify.py ./html/index.html ./html/index.min.html \ No newline at end of file diff --git a/html/index.html b/html/index.html index dfbb06f..9452780 100644 --- a/html/index.html +++ b/html/index.html @@ -104,17 +104,11 @@ - {{#ConfigChanged}} -
-

- The configuration has been changed.
- It is recommended to restart the device.

- -

-
- {{/ConfigChanged}} +

ESP32

+
Board type:
+
{{BoardType}}
SDK Version:
{{SDKVersion}}
CPU model:
@@ -135,8 +129,6 @@
Uptime:
{{Uptime}}
-
Chip temperature:
-
{{Temperature}} °C
RTSP sessions:
{{NumRTSPSessions}}
Free heap:
@@ -145,14 +137,6 @@
{{MaxAllocHeap}}
-

Peripheral

-
-
Board type:
-
{{BoardType}}
-
LED intensity:
-
{{LedIntensity}} [0-100]
-
-

Network

Host name:
@@ -166,9 +150,9 @@
Signal strength:
{{SignalStrength}} dbm
IPv4 address:
-
{{IpV4}}
+
{{IPv4}}
IPv6 address:
-
{{IpV6}}
+
{{IPv6}}
{{#NetworkState.ApMode}} @@ -191,10 +175,6 @@
{{FrameSize}}
JPEG quality:
{{JpegQuality}} [1-100]
-
Enable PSRAM:
-
{{#EnablePSRAM}}Enabled{{/EnablePSRAM}}{{^EnablePSRAM}}Disabled{{/EnablePSRAM}}
-
Number of frame buffers:
-
{{FrameBuffers}}
Brightness:
{{Brightness}} [-2,2]
Contrast:
@@ -260,15 +240,11 @@

Special URLs / API

RTSP camera stream:
-
rtsp://{{IpV4}}:{{RtspPort}}/mjpeg/1
+
rtsp://{{IPv4}}:{{RtspPort}}/mjpeg/1
JPEG Motion stream:
-
http://{{IpV4}}/stream
+
http://{{IPv4}}/stream
Snapshot of the camera:
-
http://{{IpV4}}/snapshot
-
Intensity of the flash led (0-255):
-
http://{{IpV4}}/flash?v=0 (Authentication required)
-
Restart the camera:
-
http://{{IpV4}}/restart (Authentication required)
+
http://{{IPv4}}/snapshot
diff --git a/html/index.min.html b/html/index.min.html index 5ac9528..b2b7fc2 100644 --- a/html/index.min.html +++ b/html/index.min.html @@ -1 +1 @@ -{{AppTitle}} v{{AppVersion}}

{{ThingName}}


Press on the button below to change the settings

{{#ConfigChanged}}

The configuration has been changed.
It is recommended to restart the device.

{{/ConfigChanged}}

ESP32

SDK Version:
{{SDKVersion}}
CPU model:
{{ChipModel}} rev. {{ChipRevision}}
CPU speed:
{{CpuFreqMHz}} Mhz
CPU cores:
{{CpuCores}}
RAM size:
{{HeapSize}}
PSRAM size:
{{PsRamSize}}
Flash size:
{{FlashSize}}

Diagnostics

Uptime:
{{Uptime}}
Chip temperature:
{{Temperature}} °C
RTSP sessions:
{{NumRTSPSessions}}
Free heap:
{{FreeHeap}}
Max free block:
{{MaxAllocHeap}}

Peripheral

Board type:
{{BoardType}}
LED intensity:
{{LedIntensity}} [0-100]

Network

Host name:
{{HostName}}
Mac address:
{{MacAddress}}
Wifi mode:
{{WifiMode}}
Access point:
{{AccessPoint}}
Signal strength:
{{SignalStrength}} dbm
IPv4 address:
{{IpV4}}
IPv6 address:
{{IpV6}}
{{#NetworkState.ApMode}}

Not connected to an access point.
Consider configuring the access point.

{{/NetworkState.ApMode}} {{#NetworkState.OnLine}}

Connected to the access point

{{/NetworkState.OnLine}}

Camera

Frame rate:
{{FrameDuration}} ms ({{FrameFrequency}} f/s)
Frame size:
{{FrameSize}}
JPEG quality:
{{JpegQuality}} [1-100]
Enable PSRAM:
{{#EnablePSRAM}}Enabled{{/EnablePSRAM}}{{^EnablePSRAM}}Disabled{{/EnablePSRAM}}
Number of frame buffers:
{{FrameBuffers}}
Brightness:
{{Brightness}} [-2,2]
Contrast:
{{Contrast}} [-2,2]
Saturation:
{{Saturation}} [-2,2]
Special effect:
{{SpecialEffect}}
White balance:
{{#WhiteBal}}Auto{{/WhiteBal}}{{^WhiteBal}}Manual{{/WhiteBal}}
AWB gain:
{{#AwbGain}}Auto{{/AwbGain}}{{^AwbGain}}Manual{{/AwbGain}}
WB mode:
{{WbMode}}
Exposure control:
{{#ExposureCtrl}}Auto{{/ExposureCtrl}}{{^ExposureCtrl}}Manual{{/ExposureCtrl}}
Auto exposure control (dsp):
{{#Aec2}}Enabled{{/Aec2}}{{^Aec2}}Disabled{{/Aec2}}
Auto Exposure level:
{{AeLevel}}
Manual exposure value:
{{AecValue}}
Gain control:
{{#GainCtrl}}Auto{{/GainCtrl}}{{^GainCtrl}}Manual{{/GainCtrl}}
AGC gain:
{{AgcGain}}
Gain ceiling:
{{GainCeiling}}
Black pixel correct:
{{#Bpc}}Auto{{/Bpc}}{{^Bpc}}Manual{{/Bpc}}
White pixel correct:
{{#Wpc}}Auto{{/Wpc}}{{^Wpc}}Manual{{/Wpc}}
Gamma correct:
{{#RawGma}}Enabled{{/RawGma}}{{^RawGma}}Disabled{{/RawGma}}
Lens correction:
{{#Lenc}}Enabled{{/Lenc}}{{^Lenc}}Disabled{{/Lenc}}
Horizontal mirror:
{{#HMirror}}Mirrored{{/HMirror}}{{^HMirror}}Normal{{/HMirror}}
Vertical flip:
{{#VFlip}}Flipped{{/VFlip}}{{^VFlip}}Normal{{/VFlip}}
Downsize enable:
{{#Dcw}}Enabled{{/Dcw}}{{^Dcw}}Disabled{{/Dcw}}
Color bar:
{{#ColorBar}}Enabled{{/ColorBar}}{{^ColorBar}}Camera{{/ColorBar}}
{{#CameraInitialized}}

Camera was initialized successfully!

{{/CameraInitialized}} {{^CameraInitialized}}

Failed to initialize the camera!
Result: {{CameraInitResult}} ({{CameraInitResultText}})
Please check hardware or correct the camera settings and restart.

{{/CameraInitialized}}

Special URLs / API

RTSP camera stream:
rtsp://{{IpV4}}:{{RtspPort}}/mjpeg/1
JPEG Motion stream:
http://{{IpV4}}/stream
Snapshot of the camera:
http://{{IpV4}}/snapshot
Intensity of the flash led (0-255):
http://{{IpV4}}/flash?v=0 (Authentication required)
Restart the camera:
http://{{IpV4}}/restart (Authentication required)
\ No newline at end of file +{{AppTitle}} v{{AppVersion}}

{{ThingName}}


Press on the button below to change the settings

ESP32

Board type:
{{BoardType}}
SDK Version:
{{SDKVersion}}
CPU model:
{{ChipModel}} rev. {{ChipRevision}}
CPU speed:
{{CpuFreqMHz}} Mhz
CPU cores:
{{CpuCores}}
RAM size:
{{HeapSize}}
PSRAM size:
{{PsRamSize}}
Flash size:
{{FlashSize}}

Diagnostics

Uptime:
{{Uptime}}
RTSP sessions:
{{NumRTSPSessions}}
Free heap:
{{FreeHeap}}
Max free block:
{{MaxAllocHeap}}

Network

Host name:
{{HostName}}
Mac address:
{{MacAddress}}
Wifi mode:
{{WifiMode}}
Access point:
{{AccessPoint}}
Signal strength:
{{SignalStrength}} dbm
IPv4 address:
{{IPv4}}
IPv6 address:
{{IPv6}}
{{#NetworkState.ApMode}}

Not connected to an access point.
Consider configuring the access point.

{{/NetworkState.ApMode}} {{#NetworkState.OnLine}}

Connected to the access point

{{/NetworkState.OnLine}}

Camera

Frame rate:
{{FrameDuration}} ms ({{FrameFrequency}} f/s)
Frame size:
{{FrameSize}}
JPEG quality:
{{JpegQuality}} [1-100]
Brightness:
{{Brightness}} [-2,2]
Contrast:
{{Contrast}} [-2,2]
Saturation:
{{Saturation}} [-2,2]
Special effect:
{{SpecialEffect}}
White balance:
{{#WhiteBal}}Auto{{/WhiteBal}}{{^WhiteBal}}Manual{{/WhiteBal}}
AWB gain:
{{#AwbGain}}Auto{{/AwbGain}}{{^AwbGain}}Manual{{/AwbGain}}
WB mode:
{{WbMode}}
Exposure control:
{{#ExposureCtrl}}Auto{{/ExposureCtrl}}{{^ExposureCtrl}}Manual{{/ExposureCtrl}}
Auto exposure control (dsp):
{{#Aec2}}Enabled{{/Aec2}}{{^Aec2}}Disabled{{/Aec2}}
Auto Exposure level:
{{AeLevel}}
Manual exposure value:
{{AecValue}}
Gain control:
{{#GainCtrl}}Auto{{/GainCtrl}}{{^GainCtrl}}Manual{{/GainCtrl}}
AGC gain:
{{AgcGain}}
Gain ceiling:
{{GainCeiling}}
Black pixel correct:
{{#Bpc}}Auto{{/Bpc}}{{^Bpc}}Manual{{/Bpc}}
White pixel correct:
{{#Wpc}}Auto{{/Wpc}}{{^Wpc}}Manual{{/Wpc}}
Gamma correct:
{{#RawGma}}Enabled{{/RawGma}}{{^RawGma}}Disabled{{/RawGma}}
Lens correction:
{{#Lenc}}Enabled{{/Lenc}}{{^Lenc}}Disabled{{/Lenc}}
Horizontal mirror:
{{#HMirror}}Mirrored{{/HMirror}}{{^HMirror}}Normal{{/HMirror}}
Vertical flip:
{{#VFlip}}Flipped{{/VFlip}}{{^VFlip}}Normal{{/VFlip}}
Downsize enable:
{{#Dcw}}Enabled{{/Dcw}}{{^Dcw}}Disabled{{/Dcw}}
Color bar:
{{#ColorBar}}Enabled{{/ColorBar}}{{^ColorBar}}Camera{{/ColorBar}}
{{#CameraInitialized}}

Camera was initialized successfully!

{{/CameraInitialized}} {{^CameraInitialized}}

Failed to initialize the camera!
Result: {{CameraInitResult}} ({{CameraInitResultText}})
Please check hardware or correct the camera settings and restart.

{{/CameraInitialized}}

Special URLs / API

RTSP camera stream:
rtsp://{{IPv4}}:{{RtspPort}}/mjpeg/1
JPEG Motion stream:
http://{{IPv4}}/stream
Snapshot of the camera:
http://{{IPv4}}/snapshot
\ No newline at end of file diff --git a/html/restart.html b/html/restart.html deleted file mode 100644 index 1d5c738..0000000 --- a/html/restart.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - {{AppTitle}} v{{AppVersion}} - - - -

{{ThingName}}

-
- -
-

Restarting

-

- The device is restarting...

- If this page takes longer than a minute, consider performing a power cycle. -

-
- - - - \ No newline at end of file diff --git a/html/restart.min.html b/html/restart.min.html deleted file mode 100644 index 207854f..0000000 --- a/html/restart.min.html +++ /dev/null @@ -1 +0,0 @@ -{{AppTitle}} v{{AppVersion}}

{{ThingName}}


Restarting

The device is restarting...

If this page takes longer than a minute, consider performing a power cycle.

\ No newline at end of file diff --git a/include/lookup_camera_config.h b/include/lookup_camera_config.h deleted file mode 100644 index 99337f7..0000000 --- a/include/lookup_camera_config.h +++ /dev/null @@ -1,152 +0,0 @@ -#pragma once - -#include -#include - -typedef struct -{ - const char name[11]; - const camera_config_t config; -} camera_config_entry_t; - -constexpr camera_config_t esp32cam_settings = { - .pin_pwdn = -1, - .pin_reset = 15, - .pin_xclk = 27, - .pin_sscb_sda = 25, - .pin_sscb_scl = 23, - .pin_d7 = 19, - .pin_d6 = 36, - .pin_d5 = 18, - .pin_d4 = 39, - .pin_d3 = 5, - .pin_d2 = 34, - .pin_d1 = 35, - .pin_d0 = 17, - .pin_vsync = 22, - .pin_href = 26, - .pin_pclk = 21, - .xclk_freq_hz = 20000000, - .ledc_timer = LEDC_TIMER_0, - .ledc_channel = LEDC_CHANNEL_0, - .pixel_format = PIXFORMAT_JPEG, - .frame_size = FRAMESIZE_SVGA, - .jpeg_quality = 12, - .fb_count = 2}; - -constexpr camera_config_t esp32cam_aithinker_settings = { - .pin_pwdn = 32, - .pin_reset = -1, - .pin_xclk = 0, - .pin_sscb_sda = 26, - .pin_sscb_scl = 27, - .pin_d7 = 35, - .pin_d6 = 34, - .pin_d5 = 39, - .pin_d4 = 36, - .pin_d3 = 21, - .pin_d2 = 19, - .pin_d1 = 18, - .pin_d0 = 5, - .pin_vsync = 25, - .pin_href = 23, - .pin_pclk = 22, - .xclk_freq_hz = 20000000, - .ledc_timer = LEDC_TIMER_1, - .ledc_channel = LEDC_CHANNEL_1, - .pixel_format = PIXFORMAT_JPEG, - .frame_size = FRAMESIZE_SVGA, - .jpeg_quality = 12, - .fb_count = 2}; - -constexpr camera_config_t esp32cam_ttgo_t_settings = { - .pin_pwdn = 26, - .pin_reset = -1, - .pin_xclk = 32, - .pin_sscb_sda = 13, - .pin_sscb_scl = 12, - .pin_d7 = 39, - .pin_d6 = 36, - .pin_d5 = 23, - .pin_d4 = 18, - .pin_d3 = 15, - .pin_d2 = 4, - .pin_d1 = 14, - .pin_d0 = 5, - .pin_vsync = 27, - .pin_href = 25, - .pin_pclk = 19, - .xclk_freq_hz = 20000000, - .ledc_timer = LEDC_TIMER_0, - .ledc_channel = LEDC_CHANNEL_0, - .pixel_format = PIXFORMAT_JPEG, - .frame_size = FRAMESIZE_SVGA, - .jpeg_quality = 12, - .fb_count = 2}; - -constexpr camera_config_t esp32cam_m5stack_settings = { - .pin_pwdn = -1, - .pin_reset = 15, - .pin_xclk = 27, - .pin_sscb_sda = 25, - .pin_sscb_scl = 23, - .pin_d7 = 19, - .pin_d6 = 36, - .pin_d5 = 18, - .pin_d4 = 39, - .pin_d3 = 5, - .pin_d2 = 34, - .pin_d1 = 35, - .pin_d0 = 32, - .pin_vsync = 22, - .pin_href = 26, - .pin_pclk = 21, - .xclk_freq_hz = 20000000, - .ledc_timer = LEDC_TIMER_0, - .ledc_channel = LEDC_CHANNEL_0, - .pixel_format = PIXFORMAT_JPEG, - .frame_size = FRAMESIZE_SVGA, - .jpeg_quality = 12, - .fb_count = 2}; - -constexpr camera_config_t esp32cam_wrover_kit_settings = { - .pin_pwdn = -1, - .pin_reset = -1, - .pin_xclk = 21, - .pin_sscb_sda = 26, - .pin_sscb_scl = 27, - .pin_d7 = 35, - .pin_d6 = 34, - .pin_d5 = 39, - .pin_d4 = 36, - .pin_d3 = 19, - .pin_d2 = 18, - .pin_d1 = 5, - .pin_d0 = 4, - .pin_vsync = 25, - .pin_href = 23, - .pin_pclk = 22, - .xclk_freq_hz = 20000000, - .ledc_timer = LEDC_TIMER_0, - .ledc_channel = LEDC_CHANNEL_0, - .pixel_format = PIXFORMAT_JPEG, - .frame_size = FRAMESIZE_SVGA, - .jpeg_quality = 12, - .fb_count = 2}; - -constexpr const camera_config_entry_t camera_configs[] = { - {"ESP32CAM", esp32cam_settings}, - {"AI THINKER", esp32cam_aithinker_settings}, - {"TTGO T-CAM", esp32cam_ttgo_t_settings}, - {"M5 STACK", esp32cam_m5stack_settings}, - {"WROVER KIT", esp32cam_wrover_kit_settings}}; - -const camera_config_t lookup_camera_config(const char *name) -{ - // Lookup table for the frame name to framesize_t - for (const auto &entry : camera_configs) - if (strncmp(entry.name, name, sizeof(entry.name)) == 0) - return entry.config; - - return camera_config_t{}; -} diff --git a/include/settings.h b/include/settings.h index 98bc9e2..9422efa 100644 --- a/include/settings.h +++ b/include/settings.h @@ -5,23 +5,20 @@ #define WIFI_SSID "ESP32CAM-RTSP" #define WIFI_PASSWORD nullptr -#define CONFIG_VERSION "1.5" +#define CONFIG_VERSION "1.6" #define OTA_PASSWORD "ESP32CAM-RTSP" #define RTSP_PORT 554 -#define DEFAULT_CAMERA_CONFIG "AI THINKER" -#define DEFAULT_ENABLE_PSRAM psramFound() -#define DEFAULT_BUFFERS (psramFound() ? 2 : 1) #define DEFAULT_FRAME_DURATION 200 #define DEFAULT_FRAME_SIZE "VGA (640x480)" #define DEFAULT_JPEG_QUALITY (psramFound() ? 12 : 14) -#define DEFAULT_BRIGHTNESS 0 -#define DEFAULT_CONTRAST 0 -#define DEFAULT_SATURATION 0 -#define DEFAULT_EFFECT "Normal" +#define DEFAULT_BRIGHTNESS 0 +#define DEFAULT_CONTRAST 0 +#define DEFAULT_SATURATION 0 +#define DEFAULT_EFFECT "Normal" #define DEFAULT_WHITE_BALANCE true #define DEFAULT_WHITE_BALANCE_GAIN true #define DEFAULT_WHITE_BALANCE_MODE "Auto" @@ -41,4 +38,4 @@ #define DEFAULT_DCW true #define DEFAULT_COLORBAR false -#define DEFAULT_LED_INTENSITY 0 +#define DEFAULT_LED_INTENSITY 0 \ No newline at end of file diff --git a/lib/rtsp_server/library.json b/lib/rtsp_server/library.json index 69739e1..15009f2 100644 --- a/lib/rtsp_server/library.json +++ b/lib/rtsp_server/library.json @@ -1,8 +1,8 @@ { "name": "RTSPServer", "version": "1.0.0", - "description": "", + "description": "RTSP Server", "dependencies": { "contrem/arduino-timer": "^2.3.1" - } + } } \ No newline at end of file diff --git a/lib/rtsp_server/rtsp_server.h b/lib/rtsp_server/rtsp_server.h index a49a98b..63e207a 100644 --- a/lib/rtsp_server/rtsp_server.h +++ b/lib/rtsp_server/rtsp_server.h @@ -29,7 +29,7 @@ private: std::shared_ptr session; }; - OV2640 cam_; + OV2640 cam_; std::list> clients_; uintptr_t task_; Timer<> timer_; diff --git a/platformio.ini b/platformio.ini index 013831c..3f722ef 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,15 +8,33 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:esp32cam] +############################################################################### +[platformio] +#default_envs = esp32cam_ai_thinker +#default_envs = esp32cam_espressif_esp_eye +#default_envs = esp32cam_espressif_esp32s2_cam_board +#default_envs = esp32cam_espressif_esp32s2_cam_header +#default_envs = esp32cam_espressif_esp32s3_cam_lcd +#default_envs = esp32cam_espressif_esp32s3_eye +#default_envs = esp32cam_freenove_wrover_kit +#default_envs = esp32cam_m5stack_camera_psram +#default_envs = esp32cam_m5stack_camera +#default_envs = esp32cam_m5stack_esp32cam + +#default_envs = esp32cam_m5stack_unitcam +#default_envs = esp32cam_m5stack_unitcams3 +#default_envs = esp32cam_m5stack_wide +#default_envs = esp32cam_seeed_xiao_esp32s3_sense +#default_envs = esp32cam_ttgo_t_camera +#default_envs = esp32cam_ttgo_t_journal + +[env] platform = espressif32 -board = esp32cam framework = arduino #upload_protocol = espota -#upload_port = 192.168.50.222 -#upload_flags = -# --auth='ESP32CAM-RTSP' +#upload_port = 192.168.178.223 +#upload_flags = --auth='ESP32CAM-RTSP' # Partition scheme for OTA board_build.partitions = min_spiffs.csv @@ -27,19 +45,67 @@ monitor_dtr = 0 monitor_filters = log2file, time, default, esp32_exception_decoder build_flags = - -O2 - -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE - -D LED_FLASH=4 - -D LED_BUILTIN=33 - -D BOARD_HAS_PSRAM - -mfix-esp32-psram-cache-issue - -D IOTWEBCONF_PASSWORD_LEN=64 + -Ofast + -D 'BOARD_NAME="${this.board}"' + -D 'CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE' + -D 'IOTWEBCONF_PASSWORD_LEN=64' board_build.embed_txtfiles = html/index.min.html - html/restart.min.html lib_deps = - prampec/IotWebConf @ ^3.2.1 - geeksville/Micro-RTSP @ ^0.1.6 - rzeldent/micro-moustache@^1.0.1 \ No newline at end of file + prampec/IotWebConf@^3.2.1 + geeksville/Micro-RTSP@^0.1.6 + rzeldent/micro-moustache@^1.0.1 + +[env:esp32cam_ai_thinker] +board = esp32cam_ai_thinker + +[env:esp32cam_espressif_esp_eye] +board = esp32cam_espressif_esp_eye + +[env:esp32cam_espressif_esp32s2_cam_board] +# Use board connection +# The 18 pin header on the board has Y5 and Y3 swapped +board = esp32cam_espressif_esp32s2_cam_board + +[env:esp32cam_espressif_esp32s2_cam_header] +# Use header connection +# The 18 pin header on the board has Y5 and Y3 swapped +board = esp32cam_espressif_esp32s2_cam_header + +[env:esp32cam_espressif_esp32s3_cam_lcd] +board = esp32cam_espressif_esp32s3_cam_lcd + +[env:esp32cam_espressif_esp32s3_eye] +board = esp32cam_espressif_esp32s3_eye + +[env:esp32cam_freenove_wrover_kit] +board = esp32cam_freenove_wrover_kit + +[env:esp32cam_m5stack_camera_psram] +board = esp32cam_m5stack_camera_psram + +[env:esp32cam_m5stack_camera] +board = esp32cam_m5stack_camera + +[env:esp32cam_m5stack_esp32cam] +board = esp32cam_m5stack_esp32cam + +[env:esp32cam_m5stack_unitcam] +board = esp32cam_m5stack_unitcam + +[env:esp32cam_m5stack_unitcams3] +board = esp32cam_m5stack_unitcams3 + +[env:esp32cam_m5stack_wide] +board = esp32cam_m5stack_wide + +[env:esp32cam_seeed_xiao_esp32s3_sense] +board = esp32cam_seeed_xiao_esp32s3_sense + +[env:esp32cam_ttgo_t_camera] +board = esp32cam_ttgo_t_camera + +[env:esp32cam_ttgo_t_journal] +board = esp32cam_ttgo_t_journal \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index a53699d..9b95f41 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,13 +1,12 @@ #include -#include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -17,21 +16,13 @@ #include #include -extern "C" uint8_t temprature_sens_read(); - // HTML files extern const char index_html_min_start[] asm("_binary_html_index_min_html_start"); -extern const char restart_html_min_start[] asm("_binary_html_restart_min_html_start"); - -auto param_group_board = iotwebconf::ParameterGroup("board", "Board settings"); -auto param_board = iotwebconf::Builder>("bt").label("Board").optionValues((const char *)&camera_configs).optionNames((const char *)&camera_configs).optionCount(sizeof(camera_configs) / sizeof(camera_configs[0])).nameLength(sizeof(camera_configs[0])).defaultValue(DEFAULT_CAMERA_CONFIG).build(); auto param_group_camera = iotwebconf::ParameterGroup("camera", "Camera settings"); auto param_frame_duration = iotwebconf::Builder>("fd").label("Frame duration (ms)").defaultValue(DEFAULT_FRAME_DURATION).min(10).build(); auto param_frame_size = iotwebconf::Builder>("fs").label("Frame size").optionValues((const char *)&frame_sizes).optionNames((const char *)&frame_sizes).optionCount(sizeof(frame_sizes) / sizeof(frame_sizes[0])).nameLength(sizeof(frame_sizes[0])).defaultValue(DEFAULT_FRAME_SIZE).build(); auto param_jpg_quality = iotwebconf::Builder>("q").label("JPG quality").defaultValue(DEFAULT_JPEG_QUALITY).min(1).max(100).build(); -auto param_enable_psram = iotwebconf::Builder("eps").label("Enable PSRAM if available").defaultValue(DEFAULT_ENABLE_PSRAM).build(); -auto param_frame_buffers = iotwebconf::Builder>("fb").label("Buffers").defaultValue(DEFAULT_BUFFERS).min(1).max(4).build(); auto param_brightness = iotwebconf::Builder>("b").label("Brightness").defaultValue(DEFAULT_BRIGHTNESS).min(-2).max(2).build(); auto param_contrast = iotwebconf::Builder>("c").label("Contrast").defaultValue(DEFAULT_CONTRAST).min(-2).max(2).build(); auto param_saturation = iotwebconf::Builder>("s").label("Saturation").defaultValue(DEFAULT_SATURATION).min(-2).max(2).build(); @@ -55,9 +46,6 @@ auto param_vflip = iotwebconf::Builder("vm").lab auto param_dcw = iotwebconf::Builder("dcw").label("Downsize enable").defaultValue(DEFAULT_DCW).build(); auto param_colorbar = iotwebconf::Builder("cb").label("Colorbar").defaultValue(DEFAULT_COLORBAR).build(); -auto param_group_peripheral = iotwebconf::ParameterGroup("io", "peripheral settings"); -auto param_led_intensity = iotwebconf::Builder>("li").label("LED intensity").defaultValue(DEFAULT_LED_INTENSITY).min(0).max(100).build(); - // Camera OV2640 cam; // DNS Server @@ -70,21 +58,9 @@ WebServer web_server(80); auto thingName = String(WIFI_SSID) + "-" + String(ESP.getEfuseMac(), 16); IotWebConf iotWebConf(thingName.c_str(), &dnsServer, &web_server, WIFI_PASSWORD, CONFIG_VERSION); -// Keep track of config changes. This will allow a reset of the device -bool config_changed = false; // Camera initialization result esp_err_t camera_init_result; -void stream_text_file_gzip(const unsigned char *content, size_t length, const char *mime_type) -{ - // Cache for 86400 seconds (one day) - web_server.sendHeader("Cache-Control", "max-age=86400"); - web_server.sendHeader("Content-encoding", "gzip"); - web_server.setContentLength(length); - web_server.send(200, mime_type, ""); - web_server.sendContent(reinterpret_cast(content), length); -} - void handle_root() { log_v("Handle root"); @@ -102,12 +78,15 @@ void handle_root() auto ipv4 = WiFi.getMode() == WIFI_MODE_AP ? WiFi.softAPIP() : WiFi.localIP(); auto ipv6 = WiFi.getMode() == WIFI_MODE_AP ? WiFi.softAPIPv6() : WiFi.localIPv6(); + auto initResult = esp_err_to_name(camera_init_result); + if (initResult == nullptr) + initResult = "Unknown reason"; + moustache_variable_t substitutions[] = { - // Config Changed? - {"ConfigChanged", String(config_changed)}, // Version / CPU {"AppTitle", APP_TITLE}, {"AppVersion", APP_VERSION}, + {"BoardType", BOARD_NAME}, {"ThingName", iotWebConf.getThingName()}, {"SDKVersion", ESP.getSdkVersion()}, {"ChipModel", ESP.getChipModel()}, @@ -119,7 +98,6 @@ void handle_root() {"PsRamSize", format_memory(ESP.getPsramSize(), 0)}, // Diagnostics {"Uptime", String(format_duration(millis() / 1000))}, - {"Temperature", String((temprature_sens_read() - 32) / 1.8)}, {"FreeHeap", format_memory(ESP.getFreeHeap())}, {"MaxAllocHeap", format_memory(ESP.getMaxAllocHeap())}, {"NumRTSPSessions", camera_server != nullptr ? String(camera_server->num_connected()) : "RTSP server disabled"}, @@ -129,21 +107,18 @@ void handle_root() {"AccessPoint", WiFi.SSID()}, {"SignalStrength", String(WiFi.RSSI())}, {"WifiMode", wifi_modes[WiFi.getMode()]}, - {"IpV4", ipv4.toString()}, - {"IpV6", ipv6.toString()}, + {"IPv4", ipv4.toString()}, + {"IPv6", ipv6.toString()}, {"NetworkState.ApMode", String(iotWebConf.getState() == iotwebconf::NetworkState::ApMode)}, {"NetworkState.OnLine", String(iotWebConf.getState() == iotwebconf::NetworkState::OnLine)}, // Camera - {"BoardType", String(param_board.value())}, {"FrameSize", String(param_frame_size.value())}, {"FrameDuration", String(param_frame_duration.value())}, {"FrameFrequency", String(1000.0 / param_frame_duration.value(), 1)}, {"JpegQuality", String(param_jpg_quality.value())}, - {"EnablePSRAM", String(param_enable_psram.value())}, - {"FrameBuffers", String(param_frame_buffers.value())}, {"CameraInitialized", String(camera_init_result == ESP_OK)}, {"CameraInitResult", String(camera_init_result)}, - {"CameraInitResultText", esp_err_to_name(camera_init_result)}, + {"CameraInitResultText", initResult}, // Settings {"Brightness", String(param_brightness.value())}, {"Contrast", String(param_contrast.value())}, @@ -167,8 +142,6 @@ void handle_root() {"VFlip", String(param_vflip.value())}, {"Dcw", String(param_dcw.value())}, {"ColorBar", String(param_colorbar.value())}, - // LED - {"LedIntensity", String(param_led_intensity.value())}, // RTSP {"RtspPort", String(RTSP_PORT)}}; @@ -177,28 +150,6 @@ void handle_root() web_server.send(200, "text/html", html); } -void handle_restart() -{ - log_v("Handle restart"); - - if (!web_server.authenticate("admin", iotWebConf.getApPasswordParameter()->valueBuffer)) - { - web_server.requestAuthentication(BASIC_AUTH, APP_TITLE, "401 Unauthorized

The password is incorrect."); - return; - } - - moustache_variable_t substitutions[] = { - {"AppTitle", APP_TITLE}, - {"AppVersion", APP_VERSION}, - {"ThingName", iotWebConf.getThingName()}}; - - auto html = moustache_render(restart_html_min_start, substitutions); - web_server.send(200, "text/html", html); - log_v("Restarting... Press refresh to connect again"); - sleep(100); - ESP.restart(); -} - void handle_snapshot() { log_v("handle_snapshot"); @@ -209,7 +160,7 @@ void handle_snapshot() } // Remove old images stored in the frame buffer - auto frame_buffers = param_frame_buffers.value(); + auto frame_buffers = CAMERA_CONFIG_FB_COUNT; while (frame_buffers--) cam.run(); @@ -258,62 +209,49 @@ void handle_stream() log_v("stopped streaming"); } -void handle_flash() -{ - log_v("handle_flash"); - - if (!web_server.authenticate("admin", iotWebConf.getApPasswordParameter()->valueBuffer)) - { - web_server.requestAuthentication(BASIC_AUTH, APP_TITLE, "401 Unauthorized

The password is incorrect."); - return; - } - - // If no value present, use value from config - if (web_server.hasArg("v")) - { - auto v = (uint8_t)min(web_server.arg("v").toInt(), 255L); - // If conversion fails, v = 0 - analogWrite(LED_FLASH, v); - } - else - { - analogWrite(LED_FLASH, param_led_intensity.value()); - } - - web_server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); - web_server.send(200); -} - esp_err_t initialize_camera() { log_v("initialize_camera"); - log_i("Camera config: %s", param_board.value()); - auto camera_config_template = lookup_camera_config(param_board.value()); - // Copy the settings - camera_config_t camera_config; - memset(&camera_config, 0, sizeof(camera_config_t)); - memcpy(&camera_config, &camera_config_template, sizeof(camera_config_t)); + + constexpr auto pixformat = PIXFORMAT_JPEG; log_i("Frame size: %s", param_frame_size.value()); auto frame_size = lookup_frame_size(param_frame_size.value()); log_i("JPEG quality: %d", param_jpg_quality.value()); + auto jpeg_quality = param_jpg_quality.value(); log_i("Frame duration: %d ms", param_frame_duration.value()); - camera_config.frame_size = frame_size; - camera_config.jpeg_quality = param_jpg_quality.value(); - camera_config.grab_mode = CAMERA_GRAB_LATEST; - log_i("Enable PSRAM: %d", param_enable_psram.value()); - log_i("Frame buffers: %d", param_frame_buffers.value()); - camera_config.fb_count = param_frame_buffers.value(); + constexpr auto i2c_port = I2C_NUM_0; - if (param_enable_psram.value() && psramFound()) - { - camera_config.fb_location = CAMERA_FB_IN_PSRAM; - log_i("PSRAM enabled!"); - } - else - { - camera_config.fb_location = CAMERA_FB_IN_DRAM; - log_i("PSRAM disabled"); - } + camera_config_t camera_config = { + .pin_pwdn = CAMERA_CONFIG_PIN_PWDN, // GPIO pin for camera power down line + .pin_reset = CAMERA_CONFIG_PIN_RESET, // GPIO pin for camera reset line + .pin_xclk = CAMERA_CONFIG_PIN_XCLK, // GPIO pin for camera XCLK line + .pin_sccb_sda = CAMERA_CONFIG_PIN_SCCB_SDA, // GPIO pin for camera SDA line + .pin_sccb_scl = CAMERA_CONFIG_PIN_SCCB_SCL, // GPIO pin for camera SCL line + .pin_d7 = CAMERA_CONFIG_PIN_Y9, // GPIO pin for camera D7 line + .pin_d6 = CAMERA_CONFIG_PIN_Y8, // GPIO pin for camera D6 line + .pin_d5 = CAMERA_CONFIG_PIN_Y7, // GPIO pin for camera D5 line + .pin_d4 = CAMERA_CONFIG_PIN_Y6, // GPIO pin for camera D4 line + .pin_d3 = CAMERA_CONFIG_PIN_Y5, // GPIO pin for camera D3 line + .pin_d2 = CAMERA_CONFIG_PIN_Y4, // GPIO pin for camera D2 line + .pin_d1 = CAMERA_CONFIG_PIN_Y3, // GPIO pin for camera D1 line + .pin_d0 = CAMERA_CONFIG_PIN_Y2, // GPIO pin for camera D0 line + .pin_vsync = CAMERA_CONFIG_PIN_VSYNC, // GPIO pin for camera VSYNC line + .pin_href = CAMERA_CONFIG_PIN_HREF, // GPIO pin for camera HREF line + .pin_pclk = CAMERA_CONFIG_PIN_PCLK, // GPIO pin for camera PCLK line + .xclk_freq_hz = CAMERA_CONFIG_CLK_FREQ_HZ, // Frequency of XCLK signal, in Hz. EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode + .ledc_timer = CAMERA_CONFIG_LEDC_TIMER, // LEDC timer to be used for generating XCLK + .ledc_channel = CAMERA_CONFIG_LEDC_CHANNEL, // LEDC channel to be used for generating XCLK + .pixel_format = pixformat, // Format of the pixel data: PIXFORMAT_ + YUV422|GRAYSCALE|RGB565|JPEG + .frame_size = frame_size, // Size of the output image: FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA + .jpeg_quality = jpeg_quality, // Quality of JPEG output. 0-63 lower means higher quality + .fb_count = CAMERA_CONFIG_FB_COUNT, // Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) + .fb_location = CAMERA_CONFIG_FB_LOCATION, // The location where the frame buffer will be allocated + .grab_mode = CAMERA_GRAB_LATEST, // When buffers should be filled +#if CONFIG_CAMERA_CONVERTER_ENABLED + conv_mode = CONV_DISABLE, // RGB<->YUV Conversion mode +#endif + .sccb_i2c_port = i2c_port // If pin_sccb_sda is -1, use the already configured I2C bus by number + }; return cam.init(camera_config); } @@ -357,14 +295,12 @@ void start_rtsp_server() camera_server = std::unique_ptr(new rtsp_server(cam, param_frame_duration.value(), RTSP_PORT)); // Add RTSP service to mDNS // HTTP is already set by iotWebConf - MDNS.addService("rtsp", "tcp", 554); + MDNS.addService("rtsp", "tcp", RTSP_PORT); } void on_connected() { log_v("on_connected"); - // Start (OTA) Over The Air programming when connected - ArduinoOTA.begin(); // Start the RTSP Server if initialized if (camera_init_result == ESP_OK) start_rtsp_server(); @@ -375,11 +311,7 @@ void on_connected() void on_config_saved() { log_v("on_config_saved"); - // Set flash led intensity - analogWrite(LED_FLASH, param_led_intensity.value()); - // Update camera setting update_camera_settings(); - config_changed = true; } void setup() @@ -387,38 +319,35 @@ void setup() // Disable brownout WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); - // LED_BUILTIN (GPIO33) has inverted logic false => LED on - pinMode(LED_BUILTIN, OUTPUT); - digitalWrite(LED_BUILTIN, false); - - pinMode(LED_FLASH, OUTPUT); - // Turn flash led off - analogWrite(LED_FLASH, 0); - -#ifdef CORE_DEBUG_LEVEL - Serial.begin(115200); - Serial.setDebugOutput(true); +#ifdef USER_LED_GPIO + pinMode(USER_LED_GPIO, OUTPUT); + digitalWrite(USER_LED_GPIO, !USER_LED_ON_LEVEL); #endif + Serial.begin(115200); + Serial.setDebugOutput(true); + +#ifdef ARDUINO_USB_CDC_ON_BOOT + // Delay for USB to connect/settle + delay(5000); +#endif + + log_i("Core debug level: %d", CORE_DEBUG_LEVEL); log_i("CPU Freq: %d Mhz, %d core(s)", getCpuFrequencyMhz(), ESP.getChipCores()); log_i("Free heap: %d bytes", ESP.getFreeHeap()); log_i("SDK version: %s", ESP.getSdkVersion()); + log_i("Board: %s", BOARD_NAME); log_i("Starting " APP_TITLE "..."); - if (psramFound()) + if (CAMERA_CONFIG_FB_LOCATION == CAMERA_FB_IN_PSRAM) { - psramInit(); - log_v("PSRAM found and initialized"); + if (!psramInit()) + log_e("Failed to initialize PSRAM"); } - param_group_board.addItem(¶m_board); - iotWebConf.addParameterGroup(¶m_group_board); - param_group_camera.addItem(¶m_frame_duration); param_group_camera.addItem(¶m_frame_size); param_group_camera.addItem(¶m_jpg_quality); - param_group_camera.addItem(¶m_enable_psram); - param_group_camera.addItem(¶m_frame_buffers); param_group_camera.addItem(¶m_brightness); param_group_camera.addItem(¶m_contrast); param_group_camera.addItem(¶m_saturation); @@ -443,67 +372,39 @@ void setup() param_group_camera.addItem(¶m_colorbar); iotWebConf.addParameterGroup(¶m_group_camera); - param_group_peripheral.addItem(¶m_led_intensity); - iotWebConf.addParameterGroup(¶m_group_peripheral); - iotWebConf.getApTimeoutParameter()->visible = true; iotWebConf.setConfigSavedCallback(on_config_saved); iotWebConf.setWifiConnectionCallback(on_connected); - iotWebConf.setStatusPin(LED_BUILTIN, LOW); +#ifdef USER_LED_GPIO + iotWebConf.setStatusPin(USER_LED_GPIO, USER_LED_ON_LEVEL); +#endif iotWebConf.init(); camera_init_result = initialize_camera(); if (camera_init_result == ESP_OK) update_camera_settings(); else - log_e("Failed to initialize camera: 0x%0x. Type: %s, frame size: %s, frame rate: %d ms, jpeg quality: %d", camera_init_result, param_board.value(), param_frame_size.value(), param_frame_duration.value(), param_jpg_quality.value()); + log_e("Failed to initialize camera: 0x%0x. Frame size: %s, frame rate: %d ms, jpeg quality: %d", camera_init_result, param_frame_size.value(), param_frame_duration.value(), param_jpg_quality.value()); // Set up required URL handlers on the web server web_server.on("/", HTTP_GET, handle_root); web_server.on("/config", [] { iotWebConf.handleConfig(); }); - web_server.on("/restart", HTTP_GET, handle_restart); // Camera snapshot web_server.on("/snapshot", HTTP_GET, handle_snapshot); // Camera stream web_server.on("/stream", HTTP_GET, handle_stream); - // Camera flash light - web_server.on("/flash", HTTP_GET, handle_flash); web_server.onNotFound([]() { iotWebConf.handleNotFound(); }); - - ArduinoOTA - .setPassword(OTA_PASSWORD) - .onStart([]() - { log_w("Starting OTA update: %s", ArduinoOTA.getCommand() == U_FLASH ? "sketch" : "filesystem"); }) - .onEnd([]() - { log_w("OTA update done!"); }) - .onProgress([](unsigned int progress, unsigned int total) - { log_i("OTA Progress: %u%%\r", (progress / (total / 100))); }) - .onError([](ota_error_t error) - { - switch (error) - { - case OTA_AUTH_ERROR: log_e("OTA: Auth Failed"); break; - case OTA_BEGIN_ERROR: log_e("OTA: Begin Failed"); break; - case OTA_CONNECT_ERROR: log_e("OTA: Connect Failed"); break; - case OTA_RECEIVE_ERROR: log_e("OTA: Receive Failed"); break; - case OTA_END_ERROR: log_e("OTA: End Failed"); break; - default: log_e("OTA error: %u", error); - } }); - - // Set flash led intensity - analogWrite(LED_FLASH, param_led_intensity.value()); } void loop() { iotWebConf.doLoop(); - ArduinoOTA.handle(); if (camera_server) camera_server->doLoop(); - yield(); + sleep(0); } \ No newline at end of file