From c8a14a8bb509f122fda6b72e042077b775424786 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 20 May 2025 10:48:57 -0500 Subject: [PATCH 1/5] chore: Update dependencies and remove submodules --- .gitignore | 1 + .gitmodules | 9 --------- CMakeLists.txt | 2 -- components/esp-protocols | 1 - components/esp32-camera | 1 - components/espp | 1 - main/idf_component.yml | 14 ++++++++++++++ sdkconfig.defaults | 2 ++ 8 files changed, 17 insertions(+), 14 deletions(-) delete mode 160000 components/esp-protocols delete mode 160000 components/esp32-camera delete mode 160000 components/espp create mode 100644 main/idf_component.yml diff --git a/.gitignore b/.gitignore index d99e497..b4ef190 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ sdkconfig sdkconfig.old .DS_Store dependencies.lock +managed_components/ diff --git a/.gitmodules b/.gitmodules index 133a0e3..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +0,0 @@ -[submodule "components/espp"] - path = components/espp - url = git@github.com:esp-cpp/espp -[submodule "components/esp32-camera"] - path = components/esp32-camera - url = git@github.com:espressif/esp32-camera -[submodule "components/esp-protocols"] - path = components/esp-protocols - url = git@github.com:espressif/esp-protocols diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cae7d4..a5281e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,6 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) # add the component directories that we want to use set(EXTRA_COMPONENT_DIRS - "components/espp/components" - "components/esp-protocols/components/mdns" ) add_compile_definitions(BOARD_HAS_PSRAM) diff --git a/components/esp-protocols b/components/esp-protocols deleted file mode 160000 index 5964ead..0000000 --- a/components/esp-protocols +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5964eadbf5591e8c12ffa5c724c7ace083423239 diff --git a/components/esp32-camera b/components/esp32-camera deleted file mode 160000 index 7aa37d4..0000000 --- a/components/esp32-camera +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7aa37d4f22503fdac9ccd449e4678c4894c40055 diff --git a/components/espp b/components/espp deleted file mode 160000 index 8e84d34..0000000 --- a/components/espp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e84d34eb4a9decb8869b0faa71e422c00db69b0 diff --git a/main/idf_component.yml b/main/idf_component.yml new file mode 100644 index 0000000..f7867c1 --- /dev/null +++ b/main/idf_component.yml @@ -0,0 +1,14 @@ +## IDF Component Manager Manifest File +dependencies: + ## Required IDF version + idf: + version: '>=5.0' + espressif/mdns: '>=1.8' + espressif/esp32-camera: '>=2.0' + espp/rtsp: '>=1.0' + espp/wifi: '>=1.0' + espp/monitor: '>=1.0' + espp/socket: '>=1.0' + espp/nvs: '>=1.0' + espp/task: '>=1.0' + espp/esp32-timer-cam: '>=1.0' diff --git a/sdkconfig.defaults b/sdkconfig.defaults index f92f417..0fb0bd6 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -18,6 +18,8 @@ CONFIG_SPIRAM=y CONFIG_SPIRAM_USE_MALLOC=y CONFIG_SPIRAM_MODE_OCT=y CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y +CONFIG_SPIRAM_RODATA=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y # From 49e794c8b75603939d1933cd84c6ee5c9943f292 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 20 May 2025 11:05:49 -0500 Subject: [PATCH 2/5] fix ci and sa --- .github/workflows/build.yml | 4 +--- .github/workflows/package_main.yml | 31 +++++++++++++++++++++------ .github/workflows/static_analysis.yml | 8 +++---- CMakeLists.txt | 2 +- main/main.cpp | 2 +- sdkconfig.defaults | 3 --- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 431937b..49b70b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,12 +10,10 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - with: - submodules: 'recursive' - name: Build Main uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: v5.2.2 + esp_idf_version: release-v5.4 target: esp32 path: '.' diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index c49d4a5..e125331 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -5,6 +5,7 @@ on: branches: [main] release: types: [published] + workflow_dispatch: jobs: build: @@ -12,36 +13,54 @@ jobs: runs-on: ubuntu-latest continue-on-error: false + outputs: + zipfile-id: ${{ steps.zip_step.outputs.artifact-id }} + steps: - name: Checkout repo uses: actions/checkout@v4 - with: - submodules: 'recursive' - name: Build Main Code uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: v5.2.2 + esp_idf_version: release-v5.4 target: esp32 path: '.' - name: Upload Build Outputs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + id: zip_step with: name: build-artifacts path: | + build/*.bin + build/*.elf build/bootloader/bootloader.bin build/partition_table/partition-table.bin - build/*.bin + build/flasher_args.json build/flash_args - name: Attach files to release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: ${{ github.event.release && github.event.action == 'published' }} with: files: | build/*.bin + build/*.elf build/bootloader/bootloader.bin build/partition_table/partition-table.bin + build/flasher_args.json build/flash_args + package: + name: Package the binaries into an executables for Windows, MacOS, and Linux (Ubuntu) + needs: build + strategy: + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: esp-cpp/esp-packaged-programmer-action@v1.0.5 + with: + zipfile-id: ${{ needs.build.outputs.zipfile-id }} + programmer-name: 'camera-streamer_programmer' diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 54bf1b2..a35a74c 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -9,8 +9,6 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v2 - with: - submodules: 'recursive' - name: Run static analysis uses: esp-cpp/StaticAnalysis@master @@ -18,8 +16,8 @@ jobs: # Do not build the project and do not use cmake to generate compile_commands.json use_cmake: false - # Use the 5.2 release version since it's what we build with - esp_idf_version: release/v5.2 + # Use the 5.4 release version since it's what we build with + esp_idf_version: release/v5.4 # (Optional) cppcheck args - cppcheck_args: -i$GITHUB_WORKSPACE/components/espp -i$GITHUB_WORKSPACE/components/esp32-camera -i$GITHUB_WORKSPACE/components/esp-protocols --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt + cppcheck_args: --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index a5281e4..8f7360b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.20) include($ENV{IDF_PATH}/tools/cmake/project.cmake) diff --git a/main/main.cpp b/main/main.cpp index 508f270..3924ebc 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -176,7 +176,7 @@ extern "C" void app_main(void) { // initialize the camera logger.info("Creating camera task"); - auto camera_task_fn = [&rtsp_server, &logger](auto &m, auto &cv) -> bool { + auto camera_task_fn = [&rtsp_server, &logger](const auto &m, const auto &cv) -> bool { // take image static camera_fb_t *fb = NULL; static size_t _jpg_buf_len; diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 0fb0bd6..ecbb99d 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -16,10 +16,7 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768 # SPIRAM Configuration CONFIG_SPIRAM=y CONFIG_SPIRAM_USE_MALLOC=y -CONFIG_SPIRAM_MODE_OCT=y CONFIG_SPIRAM_SPEED_80M=y -CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y -CONFIG_SPIRAM_RODATA=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y # From 6604aadeadcfcda0710d630701baf23d78e9ee29 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 20 May 2025 11:22:22 -0500 Subject: [PATCH 3/5] Update to use 5.3 instead of 5.4 because of i2c driver conflict with esp32-camera --- .github/workflows/build.yml | 2 +- .github/workflows/package_main.yml | 2 +- .github/workflows/static_analysis.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49b70b8..ee48f63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,6 @@ jobs: - name: Build Main uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: release-v5.4 + esp_idf_version: release-v5.3 target: esp32 path: '.' diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index e125331..b44f093 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -23,7 +23,7 @@ jobs: - name: Build Main Code uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: release-v5.4 + esp_idf_version: release-v5.3 target: esp32 path: '.' diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index a35a74c..6772783 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -16,8 +16,8 @@ jobs: # Do not build the project and do not use cmake to generate compile_commands.json use_cmake: false - # Use the 5.4 release version since it's what we build with - esp_idf_version: release/v5.4 + # Use the 5.3 release version since it's what we build with + esp_idf_version: release/v5.3 # (Optional) cppcheck args cppcheck_args: --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt From c9023b117c07a534289852f09c380d4e415d3a03 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 20 May 2025 11:41:56 -0500 Subject: [PATCH 4/5] update to use latest esp32-camera with support for legacy i2c driver even on esp-idf 5.4 --- .github/workflows/build.yml | 2 +- .github/workflows/package_main.yml | 2 +- .github/workflows/static_analysis.yml | 4 ++-- .gitmodules | 3 +++ components/esp32-camera | 1 + main/idf_component.yml | 5 ++++- sdkconfig.defaults | 3 +++ 7 files changed, 15 insertions(+), 5 deletions(-) create mode 160000 components/esp32-camera diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee48f63..49b70b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,6 @@ jobs: - name: Build Main uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: release-v5.3 + esp_idf_version: release-v5.4 target: esp32 path: '.' diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index b44f093..e125331 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -23,7 +23,7 @@ jobs: - name: Build Main Code uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: release-v5.3 + esp_idf_version: release-v5.4 target: esp32 path: '.' diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 6772783..a35a74c 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -16,8 +16,8 @@ jobs: # Do not build the project and do not use cmake to generate compile_commands.json use_cmake: false - # Use the 5.3 release version since it's what we build with - esp_idf_version: release/v5.3 + # Use the 5.4 release version since it's what we build with + esp_idf_version: release/v5.4 # (Optional) cppcheck args cppcheck_args: --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt diff --git a/.gitmodules b/.gitmodules index e69de29..21c8215 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "components/esp32-camera"] + path = components/esp32-camera + url = git@github.com:esp-cpp/esp32-camera diff --git a/components/esp32-camera b/components/esp32-camera new file mode 160000 index 0000000..0fe33c0 --- /dev/null +++ b/components/esp32-camera @@ -0,0 +1 @@ +Subproject commit 0fe33c0346b9a348bb68190d2b81e830fc46a58b diff --git a/main/idf_component.yml b/main/idf_component.yml index f7867c1..49898de 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -4,7 +4,10 @@ dependencies: idf: version: '>=5.0' espressif/mdns: '>=1.8' - espressif/esp32-camera: '>=2.0' + # NOTE: we cannot use the idf component because for anything ESP-IDF >= 5.4 it + # automatically uses the new I2C driver, which espp doesn't support yet. + # + # espressif/esp32-camera: '>=2.0' espp/rtsp: '>=1.0' espp/wifi: '>=1.0' espp/monitor: '>=1.0' diff --git a/sdkconfig.defaults b/sdkconfig.defaults index ecbb99d..d12b298 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -30,3 +30,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" # CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +# ESP32-Camera specific +CONFIG_SCCB_HARDWARE_I2C_DRIVER_LEGACY=y From dbd5cb4d6d5fcaf285750249017090ca6eee698d Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 20 May 2025 11:55:05 -0500 Subject: [PATCH 5/5] fix actions to ensure submodules are checked out --- .github/workflows/build.yml | 2 ++ .github/workflows/package_main.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49b70b8..b90a274 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + with: + submodules: true - name: Build Main uses: espressif/esp-idf-ci-action@v1 diff --git a/.github/workflows/package_main.yml b/.github/workflows/package_main.yml index e125331..582abd4 100644 --- a/.github/workflows/package_main.yml +++ b/.github/workflows/package_main.yml @@ -19,6 +19,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + with: + submodules: true - name: Build Main Code uses: espressif/esp-idf-ci-action@v1