This component uses the ESP32-CAM with the OV2640 camera module for the Rusty Secure system.
- After cloning the repository, initialize the ESP32-CAM component submodule:
git submodule update --init-
Check that the esp32-camera component is properly installed in the
components/esp32-cameradirectory. -
Install the ESP Rust toolchain (
channel = "esp"inrust-toolchain.toml). See esp-rs/rust-build for instructions.
Two shell scripts are provided for convenience:
./dev.sh # build, flash & monitor
./dev.sh --erase # full erase before flashing
./dev.sh --port /dev/tty.usbserial-140 # specify serial port./release.sh # build, flash & monitor
./release.sh --erase # full erase before flashing
./release.sh --port /dev/tty.usbserial-140 # specify serial portUse --erase when switching between bootloader versions or after major sdkconfig changes.
cargo +esp build # dev build
cargo +esp build --release # release build
espflash flash target/xtensa-esp32-espidf/release/esp32-cam --monitor- Uses ESP-IDF (std) with FreeRTOS — the camera driver requires the full ESP-IDF framework.
- HTTP server listens for
/capturerequests, triggers the camera, and uploads the image to the API server. - The Espressif camera driver is written in C; Rust bindings are generated at build time from
components/bindings.h.
- PSRAM (SPIRAM) is enabled in
sdkconfig.defaultsfor camera frame buffers. - The flash LED on GPIO4 is toggled during capture for lighting.
- For more information, see the reference project: https://github.com/jlocash/esp-camera-rs