diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e57ea71..c5cdfe6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,17 +5,17 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ~/.cache/pip ~/.platformio/.cache key: ${{ runner.os }}-pio - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.9' - name: Install PlatformIO @@ -23,7 +23,7 @@ jobs: - name: Build firmware run: platformio run - name: Archive - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: firmwares.zip path: .pio/build/*/firmware.bin diff --git a/include/camera_config.h b/include/camera_config.h index 3181b41..341cbb4 100644 --- a/include/camera_config.h +++ b/include/camera_config.h @@ -111,8 +111,7 @@ constexpr camera_config_t ttgo_t_camera_settings = { .grab_mode = CAMERA_GRAB_LATEST}; constexpr camera_config_t m5stack_camera_settings = { - .pin_pwdn = -1, - .pin_reset = -1, + .pin_reset = -1, .pin_xclk = 10, .pin_sscb_sda = 40, .pin_sscb_scl = 39, @@ -134,7 +133,7 @@ constexpr camera_config_t m5stack_camera_settings = { .frame_size = FRAMESIZE_SVGA, .jpeg_quality = 12, .fb_count = 1, - .fb_location = CAMERA_FB_IN_PSRAM, + .fb_location = CAMERA_FB_IN_DRAM, .grab_mode = CAMERA_GRAB_LATEST}; constexpr camera_config_t wrover_kit_camera_settings = { @@ -189,4 +188,31 @@ constexpr camera_config_t xiao_esp32s3_camera_settings = { .jpeg_quality = 12, .fb_count = 2, .fb_location = CAMERA_FB_IN_PSRAM, + .grab_mode = CAMERA_GRAB_LATEST}; + +constexpr camera_config_t m5stack_unitcams3_camera_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 = 1, + .fb_location = CAMERA_FB_IN_PSRAM, .grab_mode = CAMERA_GRAB_LATEST}; \ No newline at end of file diff --git a/include/settings.h b/include/settings.h index f87f508..cb3ec9b 100644 --- a/include/settings.h +++ b/include/settings.h @@ -32,6 +32,9 @@ constexpr camera_config_t default_camera_config = wrover_kit_camera_settings; #elif defined(BOARD_SEEED_XIAO_ESP32S3_SENSE) constexpr const char *board_name = "Seed Xiao ESP32S3 Sense"; constexpr camera_config_t default_camera_config = xiao_esp32s3_camera_settings; +#elif defined(BOARD_M5STACK_UNITCAMS3) +constexpr const char *board_name = "M5Stack UnitCamS3"; +constexpr camera_config_t default_camera_config = m5stack_unitcams3_camera_settings; #else #error No board defined #endif diff --git a/platformio.ini b/platformio.ini index cf8e965..e0b9fe7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,8 @@ #default_envs = ttgo-t-beam #default_envs = m5stack_esp32cam #default_envs = esp32_wrover_cam -default_envs = seeed_xiao_esp32s3 +#default_envs = seeed_xiao_esp32s3 +#default_envs = m5stack_unitcams3 [env] platform = espressif32 @@ -85,4 +86,11 @@ build_flags = [env:seeed_xiao_esp32s3] board = seeed_xiao_esp32s3 build_flags = - -D BOARD_SEEED_XIAO_ESP32S3_SENSE \ No newline at end of file + -D BOARD_SEEED_XIAO_ESP32S3_SENSE + -D BOARD_HAS_PSRAM + +[env:m5stack_unitcams3] +board = esp32s3box +build_flags = + -D BOARD_M5STACK_UNITCAMS3 + -D BOARD_HAS_PSRAM \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index f82cdec..90fcd06 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -300,8 +300,10 @@ void setup() // Disable brownout WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // LED_BUILTIN (GPIO33) has inverted logic false => LED on +#ifdef LED_BUILTIN pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, false); +#endif Serial.begin(115200); Serial.setDebugOutput(true); @@ -348,7 +350,9 @@ void setup() iotWebConf.getApTimeoutParameter()->visible = true; iotWebConf.setConfigSavedCallback(on_config_saved); iotWebConf.setWifiConnectionCallback(on_connected); + #ifdef LED_BUILTIN iotWebConf.setStatusPin(LED_BUILTIN, LOW); + #endif iotWebConf.init(); camera_init_result = initialize_camera();