Prusa-Firmware-ESP32-Cam/ESP32_PrusaConnectCam
Robert Pouliot bcd9a7279c Fix crashes, races and SD/WiFi issues; per-day timelapse folders
Bug fixes against v1.1.2, tested on Freenove ESP32-S3-WROOM (OV3660),
arduino-esp32 3.3.11. Details in FIXES_SUMMARY.md.

Crashes and hangs
- Stack overflow in CheckMicroSdCard (#145); stacks sized from measured
  high-water marks, never below master; per-task stack report in telemetry
- NULL deref in /saved-photo.jpg; NULL guards on sensor and EXIF allocations
- OTA version check ran inside the async web handler (boot loop); now
  deferred to the system task
- udp_new_ip_type assert: SNTP stopped after sync, OTA check waits for NTP
- Divide-by-zero on SD card removal
- Busy-wait response loops (PrusaConnect, OTA) starved IDLE0 -> task WDT
- setTimeout() takes seconds: 1000 meant ~16 min

Camera
- Frame buffer returned multiple times per stream teardown
- Reinit frees buffers under the frame-buffer lock
- Capture failure skipped the reinit recovery and left the flash on
- Retry loop leaked a driver buffer per short frame
- Two semaphore leaks in CaptureStream(); stream failure now detectable
- OV3660 lost settings written right after init

Concurrency
- Recursive mutexes for SD card, log rotation, EEPROM and WiFi state
- Task WDT subscribe race: each task subscribes itself
- TWDT already initialised by the core: reconfigure only

Other
- Freenove: XCLK drive strength lowered (harmonics desensed 2.4 GHz WiFi),
  SD at 20 MHz (esp-idf#8521), DHT11 enabled on GPIO47
- Snapshots sent as image/jpeg (image/jpg was not shown in Prusa Connect)
- Second WiFi credential save failed ("sta is connecting")
- isCardCorrupted() misread an empty card as missing
- Log level checked before taking the log lock
- Timelapse: one folder per day, /timelapse/YYYY-MM-DD/YYYY-MM-DD_HH-MM-SS.jpg,
  skipped until NTP sync (FAT directory scans grow with file count)
- Web server started after all subsystems
- README: core and library versions
2026-10-11 22:01:40 -04:00
..
Certificate.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
Certificate_ota.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
ESP32_PrusaConnectCam.ino Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
ExternalTemperatureSensor.cpp update cfg for the ESP32-S3-cam board 2024-07-12 21:58:19 +02:00
ExternalTemperatureSensor.h "Added support for an external temperature sensor to more boards. 2024-07-12 21:51:29 +02:00
ExternalTemperatureSensorTypes.h First version of the external temperature/humidity sensor 2024-07-12 21:44:08 +02:00
WebPage.h update jquery lib to 3.7.1 2024-11-26 21:58:18 +01:00
WebPage_Icons.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
WebServer.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
WebServer.h First version of the external temperature/humidity sensor 2024-07-12 21:44:08 +02:00
WebStream.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
WebStream.h fix several thinks 2024-06-27 22:28:43 +02:00
camera.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
camera.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
cfg.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
cfg.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
connect.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
connect.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
connect_types.h added WEB api 2024-06-27 22:16:15 +02:00
exif.cpp updated logging and web design 2024-05-27 17:53:04 +02:00
exif.h added photo EXIF metadata 2024-05-27 17:15:15 +02:00
exif_defines.h added photo EXIF metadata 2024-05-27 17:15:15 +02:00
jquery.h update jquery lib to 3.7.1 2024-11-26 21:58:18 +01:00
log.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
log.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
log_level.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
mcu_cfg.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
micro_sd.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
micro_sd.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
module_AI_Thinker_ESP32-CAM.h update cfg for the ESP32-S3-cam board 2024-07-12 21:58:19 +02:00
module_ESP32-S3-CAM.h update 2024-07-12 22:00:01 +02:00
module_ESP32-S3-EYE_2_2.h update cfg for the ESP32-S3-cam board 2024-07-12 21:58:19 +02:00
module_ESP32-S3_Wroom_Freenove.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
module_ESP32-WROVER-DEV.h update cfg for the ESP32-S3-cam board 2024-07-12 21:58:19 +02:00
module_ESP32_S3_DEV_CAM.h update cfg for the ESP32-S3-cam board 2024-07-12 21:58:19 +02:00
module_XIAO_ESP32-S3-cam.h update docu 2024-07-12 23:36:35 +02:00
module_templates.h Added support for ESP32-S3 Wroom Freenove 2024-12-27 23:34:48 +01:00
serial_cfg.cpp added serial command loglevel 2024-08-03 21:44:09 +02:00
serial_cfg.h Update arduino-esp32 from 2.0.16 to 3.0.2 (from ESP IDF 4.4.7 to ESP IDF 5.1.4) 2024-06-27 22:15:12 +02:00
sys_led.cpp Initial version with multi-board support 2024-06-27 22:12:49 +02:00
sys_led.h First version of the external temperature/humidity sensor 2024-07-12 21:44:08 +02:00
system.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
system.h First version of the external temperature/humidity sensor 2024-07-12 21:44:08 +02:00
var.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
var.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
wifi_mngt.cpp Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00
wifi_mngt.h Fix crashes, races and SD/WiFi issues; per-day timelapse folders 2026-10-11 22:01:40 -04:00