|
| 1 | +# Basic FPS Logger Example |
| 2 | + |
| 3 | +This example provides the minimal working demonstration of the **CCM ESP32 Vision Node**: |
| 4 | + |
| 5 | +- Initialize the ESP32-S3 camera |
| 6 | +- Capture frames in a loop |
| 7 | +- Measure and log frames-per-second (FPS) |
| 8 | +- Validate hardware, PSRAM, and camera configuration |
| 9 | + |
| 10 | +It serves as the baseline sanity check before adding any image-processing stages. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Who This Example Is For |
| 15 | + |
| 16 | +- Embedded developers bringing up ESP32-S3 camera hardware |
| 17 | +- Robotics / IoT engineers running a small smart-camera node |
| 18 | +- Engineering leads evaluating CCM Code’s firmware structure |
| 19 | +- Anyone validating that their board + camera module is wired and configured correctly |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Hardware Requirements |
| 24 | + |
| 25 | +Recommended and tested target: |
| 26 | + |
| 27 | +- ESP32-S3 dev board with PSRAM |
| 28 | +- Camera module: |
| 29 | + - OV2640 |
| 30 | + - OV5640 |
| 31 | +- Example boards: |
| 32 | + - Seeed XIAO ESP32-S3 Sense |
| 33 | + - ESP32-S3-EYE |
| 34 | + - AI-Thinker ESP32-S3-CAM |
| 35 | + |
| 36 | +Required tools: |
| 37 | + |
| 38 | +- USB cable |
| 39 | +- ESP-IDF v5 or newer |
| 40 | +- Serial monitor (`idf.py monitor` or VS Code ESP-IDF extension) |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## How to Build & Run |
| 45 | + |
| 46 | +From the repository root: |
| 47 | + |
| 48 | +```bash |
| 49 | +cd firmware |
| 50 | +idf.py set-target esp32s3 |
| 51 | +idf.py menuconfig # configure serial port and camera pins if needed |
| 52 | +idf.py build |
| 53 | +idf.py flash monitor |
| 54 | +``` |
| 55 | + |
| 56 | +This example is the default firmware entry point (`firmware/main/main.cpp`). |
| 57 | +If additional examples are added later, use a compile-time switch or Kconfig option to select them. |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## Expected Serial Output |
| 62 | + |
| 63 | +If everything is configured correctly, you should see logs similar to: |
| 64 | + |
| 65 | +```text |
| 66 | +I (200) camera_node: Camera initialized: 320x240, PIXFORMAT_RGB565 |
| 67 | +I (210) main: Starting capture loop... |
| 68 | +I (1210) main: Frame 100, avg FPS = 28.7, min = 26.4, max = 30.1 |
| 69 | +I (2210) main: Frame 200, avg FPS = 28.9, min = 26.2, max = 30.3 |
| 70 | +``` |
| 71 | + |
| 72 | +This verifies: |
| 73 | + |
| 74 | +- Proper camera pin configuration |
| 75 | +- PSRAM buffers are stable |
| 76 | +- Frame acquisition loop is running |
| 77 | +- Timing metrics are correct |
| 78 | + |
| 79 | +If you see camera initialization errors, re-check: |
| 80 | + |
| 81 | +- Pin assignments |
| 82 | +- PSRAM stability in `menuconfig` |
| 83 | +- Sensor module orientation |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## What to Try Next |
| 88 | + |
| 89 | +After FPS logging works: |
| 90 | + |
| 91 | +- Increase resolution and compare FPS |
| 92 | +- Enable grayscale or early `CvPipeline` stages |
| 93 | +- Add logging of per-stage timings |
| 94 | +- Move toward blob detection and MJPEG streaming |
| 95 | + |
| 96 | +The FPS logger is intentionally simple — it is your reference baseline as the vision node grows. |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## File Structure |
| 101 | + |
| 102 | +```text |
| 103 | +examples/ |
| 104 | +└── basic_fps_logger/ |
| 105 | + ├── README.md <-- this file |
| 106 | + └── (future) CMakeLists.txt or example-specific config |
| 107 | +``` |
| 108 | + |
| 109 | +Additional example variants (blob detection, ROI cropping, streaming) will live beside this one. |
0 commit comments