ESP32-P4 Cat Flap Monitor

0 536 Medium

Title

Building a Reliable Cat Flap Camera with FireBeetle 2 ESP32-P4 + Camera Module


 

 Summary

I built a real-world cat flap monitoring system using the DFRobot FireBeetle 2 ESP32-P4 platform and camera hardware. The project focuses on reliability first: live web streaming, local SD snapshot storage, OTA updates, and a clean path toward on-device cat identification.


 

I also want to acknowledge that I used Codex heavily during development for iterative firmware refactoring, debugging workflows, and documentation help.


 

Why This Board

The FireBeetle 2 ESP32-P4 stood out for this project because it combines:


 

- enough performance for camera pipelines

- practical wireless integration via companion connectivity

- SD card support for local persistence

- strong ESP-IDF software ecosystem


 

For a cat flap use case, local-first behavior matters more than cloud-first behavior. This board made that possible.


 

What I Built

Current firmware features:


 

- live stream in browser

- manual snapshot capture

- ultrasonic-triggered snapshot capture

- SD card snapshot ring buffer

- snapshot gallery with delete

- OTA firmware update endpoint


 

The full project code is in my repo:

- https://github.com/janholtzhausen/esp32p4-catflapmonitor


 

 Technical Highlights

    1) Local snapshot pipeline

Instead of relying on immediate cloud upload, snapshots are:

1. captured

2. resized for inference-friendly dimensions (224x224)

3. encoded as JPEG (quality 100)

4. saved to SD card


 

This reduced failure modes and improved responsiveness.


 

    2) SD reliability work

I spent most effort on robust SD behavior:

- controlled SDMMC slot/bus/frequency configuration

- fallback from 4-bit to 1-bit where needed

- ring retention by file count to avoid unbounded directory growth

- deterministic timestamped filenames


 

     3) OTA maintainability

Dual OTA partitions and password-protected update endpoint make field updates practical.


 

 Roadmap

Next goals:


 

- optional Teachable Machine upload workflow for dataset curation

- tiny on-device tensor/YOLO classification for immediate cat identification

- MQTT event alerts for intruder-cat detection


 

Thank You

Thanks to DFRobot for sponsoring the board and camera hardware used in this build. The platform was a strong base for a serious edge-camera firmware project.



 

License
All Rights
Reserved
licensBg
0