RepoPilotOpen in app →

jomjol/AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world

Healthy

Healthy across the board

worst of 4 axes
Use as dependencyConcerns

non-standard license (Other)

Fork & modifyHealthy

Has a license, tests, and CI — clean foundation to fork and modify.

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isHealthy

No critical CVEs, sane security posture — runnable as-is.

  • Last commit 4w ago
  • 15 active contributors
  • Distributed ownership (top contributor 33% of recent commits)
Show 4 more →
  • Other licensed
  • CI configured
  • Tests present
  • Non-standard license (Other) — review terms
What would change the summary?
  • Use as dependency ConcernsMixed if: clarify license terms

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Healthy" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Healthy
[![RepoPilot: Healthy](https://repopilot.app/api/badge/jomjol/ai-on-the-edge-device)](https://repopilot.app/r/jomjol/ai-on-the-edge-device)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/jomjol/ai-on-the-edge-device on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: jomjol/AI-on-the-edge-device

Generated by RepoPilot · 2026-05-09 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/jomjol/AI-on-the-edge-device shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

GO — Healthy across the board

  • Last commit 4w ago
  • 15 active contributors
  • Distributed ownership (top contributor 33% of recent commits)
  • Other licensed
  • CI configured
  • Tests present
  • ⚠ Non-standard license (Other) — review terms

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live jomjol/AI-on-the-edge-device repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/jomjol/AI-on-the-edge-device.

What it runs against: a local clone of jomjol/AI-on-the-edge-device — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in jomjol/AI-on-the-edge-device | Confirms the artifact applies here, not a fork | | 2 | License is still Other | Catches relicense before you depend on it | | 3 | Default branch main exists | Catches branch renames | | 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code | | 5 | Last commit ≤ 58 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>jomjol/AI-on-the-edge-device</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of jomjol/AI-on-the-edge-device. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/jomjol/AI-on-the-edge-device.git
#   cd AI-on-the-edge-device
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of jomjol/AI-on-the-edge-device and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "jomjol/AI-on-the-edge-device(\\.git)?\\b" \\
  && ok "origin remote is jomjol/AI-on-the-edge-device" \\
  || miss "origin remote is not jomjol/AI-on-the-edge-device (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(Other)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"Other\"" package.json 2>/dev/null) \\
  && ok "license is Other" \\
  || miss "license drift — was Other at generation time"

# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
  && ok "default branch main exists" \\
  || miss "default branch main no longer exists"

# 4. Critical files exist
test -f "code/components/jomjol_flowcontroll/MainFlowControl.h" \\
  && ok "code/components/jomjol_flowcontroll/MainFlowControl.h" \\
  || miss "missing critical file: code/components/jomjol_flowcontroll/MainFlowControl.h"
test -f "code/components/jomjol_flowcontroll/ClassFlowControll.cpp" \\
  && ok "code/components/jomjol_flowcontroll/ClassFlowControll.cpp" \\
  || miss "missing critical file: code/components/jomjol_flowcontroll/ClassFlowControll.cpp"
test -f "code/components/jomjol_configfile/configFile.cpp" \\
  && ok "code/components/jomjol_configfile/configFile.cpp" \\
  || miss "missing critical file: code/components/jomjol_configfile/configFile.cpp"
test -f "code/components/jomjol_controlcamera/ClassControllCamera.cpp" \\
  && ok "code/components/jomjol_controlcamera/ClassControllCamera.cpp" \\
  || miss "missing critical file: code/components/jomjol_controlcamera/ClassControllCamera.cpp"
test -f "code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp" \\
  && ok "code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp" \\
  || miss "missing critical file: code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 58 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~28d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/jomjol/AI-on-the-edge-device"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

An embedded system that runs TensorFlow Lite models on an ESP32-CAM microcontroller to automatically read analog utility meters (water, gas, electricity) by image recognition and digitize their readings. The device captures photos of meter displays, performs on-device inference to extract numeric values, and exposes results via a web interface for integration with home automation systems. Monolithic embedded application: code/CMakeLists.txt is the root build file coordinating modular components. Core components are in code/components/: jomjol_configfile/ handles config parsing, jomjol_controlcamera/ manages OV2640 camera via ESP-IDF RMT driver, jomjol_controlGPIO/ drives addressable LEDs via SmartLeds library, jomjol_fileserver_ota/ provides firmware updates. Web UI (HTML/CSS/JavaScript) and Python model training scripts are separate concerns from the core C++ firmware.

👥Who it's for

Home automation enthusiasts and utility companies who need to digitize legacy analog meters without replacing hardware; developers building IoT solutions on ESP32 platforms who want reference implementations of camera integration, ML inference on edge devices, and web UI for microcontroller configuration.

🌱Maturity & risk

Actively developed and production-ready. The project has significant GitHub activity (1.1M+ lines of C++, established CI/CD in .github/workflows/), comprehensive documentation via MkDocs, and numerous releases. However, as an embedded IoT project with hardware dependencies, maturity depends on your specific ESP32 variant compatibility.

Moderate risks: hardware-specific code (RmtDriver variants for ESP32 v4/v5, OV2640 camera register manipulation in code/components/jomjol_controlcamera/) means changes can brick devices if not tested on actual hardware. Single primary maintainer (jomjol) visible in repo structure increases bus factor. TensorFlow Lite model compatibility and ESP32 RAM constraints (typical 4MB) create tight integration points that may break with model updates.

Active areas of work

Active development with GitHub Actions CI pipeline (build.yaml in .github/workflows/) validating builds. The presence of manual-update-contributors-list.yaml and manual-update-webinstaller.yaml indicates ongoing release management. Issue templates (ISSUE_TEMPLATE/*.yaml) show structured community engagement. Last observable structure suggests focus on stability, hardware compatibility expansion, and OTA update reliability.

🚀Get running

Clone the repository and build the ESP32 firmware: git clone https://github.com/jomjol/AI-on-the-edge-device.git && cd code && cmake --preset default && cmake --build build (requires ESP-IDF toolchain installed). Alternatively, download prebuilt binaries from Releases and flash via esptool.py write_flash or web installer mentioned in workflows.

Daily commands: This is firmware, not a traditional application. Flash to ESP32-CAM: esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 firmware.bin. Device boots into WiFi AP mode (SSID visible after ~30s), then connect to http://192.168.4.1 web interface to configure camera, meter ROI, and WiFi credentials. Access status dashboard at configured IP after WiFi join.

🗺️Map of the codebase

  • code/components/jomjol_flowcontroll/MainFlowControl.h — Entry point orchestrating the entire image capture → AI analysis → output pipeline; all contributors must understand this control flow.
  • code/components/jomjol_flowcontroll/ClassFlowControll.cpp — Core state machine managing flow initialization, execution, and lifecycle; handles the critical sequence of meter digitization.
  • code/components/jomjol_configfile/configFile.cpp — Configuration parser for all device settings and flow definitions; must be updated whenever adding new configurable parameters.
  • code/components/jomjol_controlcamera/ClassControllCamera.cpp — Camera hardware abstraction layer managing OV2640 sensor initialization and image capture; critical for meter image acquisition.
  • code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.cpp — AI/ML pipeline wrapping CNN inference for digit and meter value recognition; core business logic for meter reading.
  • code/CMakeLists.txt — Top-level build configuration for ESP32 firmware; defines all component dependencies and compiler settings.
  • code/components/jomjol_flowcontroll/ClassFlowImage.cpp — Image preprocessing and alignment for reliable meter reading; ensures quality input to CNN pipeline.

🛠️How to make changes

Add a New Data Export Destination

  1. Create new flow class inheriting from ClassFlow in code/components/jomjol_flowcontroll/ClassFlow.h (code/components/jomjol_flowcontroll/ClassFlowMyService.h)
  2. Implement DoStep() to send meter readings to your service API (code/components/jomjol_flowcontroll/ClassFlowMyService.cpp)
  3. Register the new class in ClassFlowControll.cpp's GetFlowClass() switch statement (code/components/jomjol_flowcontroll/ClassFlowControll.cpp)
  4. Add configuration parameters (API key, endpoint) to config file parser (code/components/jomjol_configfile/configFile.cpp)
  5. Define flow step in web UI config with [MyService] section and parameters (configuration file on SD card)

Add a New Image Preprocessing Step

  1. Create new preprocessing class inheriting from ClassFlow (code/components/jomjol_flowcontroll/ClassFlowImageMyFilter.h)
  2. Implement image transformation logic using OpenCV/image library (code/components/jomjol_flowcontroll/ClassFlowImageMyFilter.cpp)
  3. Insert the step into the flow sequence after ClassFlowTakeImage (code/components/jomjol_flowcontroll/ClassFlowControll.cpp)
  4. Update the flow ordering in config file documentation (configuration documentation)

Add a New Camera Hardware Variant

  1. Add sensor-specific register definitions and tuning parameters (code/components/jomjol_controlcamera/ClassControllCamera.h)
  2. Implement sensor initialization and special effects (contrast, sharpness) (code/components/jomjol_controlcamera/ov2640_specialEffect.cpp)
  3. Update camera configuration logic based on hardware detection (code/components/jomjol_controlcamera/ClassControllCamera.cpp)
  4. Build and test with new sensor hardware connected to ESP32-CAM pins (code/CMakeLists.txt)

Add a New Configuration Parameter

  1. Define parameter parsing in the YAML/INI config file parser (code/components/jomjol_configfile/configFile.cpp)
  2. Store parameter in the corresponding ClassFlow subclass member variable (code/components/jomjol_flowcontroll/ClassFlowXxx.h)
  3. Use the parameter in the flow step's DoStep() implementation (code/components/jomjol_flowcontroll/ClassFlowXxx.cpp)
  4. Document the parameter in the config file examples and README (configuration documentation)

🔧Why these technologies

  • ESP32-CAM (microcontroller + OV2640 camera) — Low-cost, edge-deployable hardware with integrated camera and sufficient compute for on-device inference; eliminates cloud dependency for meter reading.
  • TensorFlow Lite / TFLite Micro — Lightweight ML inference engine optimized for embedded systems; enables 10–100ms digit recognition on-device without cloud API calls.
  • C++ embedded runtime — Direct memory control, minimal overhead, and deterministic real-time behavior required for camera + CNN + network I/O pipeline on constrained hardware.
  • InfluxDB + MQTT + HTTP Webhooks — Decoupled output targets allow flexibility; users choose their storage/automation layer (cloud or self-hosted) without code changes.
  • Flow-based plugin architecture — Modular step composition (image → align → CNN → postprocess → output) enables configuration-driven meter type support without recompilation.

⚖️Trade-offs already made

  • On-device CNN inference instead of cloud API calls
    • Why: Reduces latency (10–100ms vs 500ms–2s), eliminates internet dependency, respects privacy by not sending images off-device.
    • Consequence: Limited model complexity; models must fit ESP32 PSRAM (~4MB); accuracy bounded by quantization and mobile architectures

🪤Traps & gotchas

Hardware variant sensitivity: RmtDriver4.cpp vs RmtDriver5.cpp must match your ESP32 revision exactly or camera will not initialize. RAM constraints: ESP32 has ~320KB usable SRAM; models larger than ~100KB must be quantized or stored on SD card. OV2640 sensor tuning: register writes in ov2640_contrast_brightness.cpp are sensor-specific; changing sensors requires rewriting these calibrations. WiFi credentials in config: stored in plaintext on SPIFFS; no encryption at rest. Timezone/NTP: no visible NTP client in file structure, so timestamps may be wrong until explicitly set via web UI. OTA firmware updates: require careful binary compatibility validation since jomjol_fileserver_ota/md5.cpp only checksums, doesn't validate incompatible config format changes.

🏗️Architecture

  • espressif/esp-idf — Official ESP32 SDK that this project's CMake build system and all hardware drivers depend on; required for any local development
  • tensorflow/tflite-micro — TensorFlow Lite Micro library embedded in firmware for quantized model inference on RAM-constrained ESP32; this repo likely pins a specific commit
  • jomjol/AI-on-the-edge-device-docs — Companion MkDocs documentation repository covering hardware compatibility matrix, setup guides, and model training workflows
  • espressif/esp32-camera — ESP-IDF component providing camera HAL and OV2640 register definitions that ClassControllCamera.cpp wraps
  • home-assistant/core — Popular home automation platform; this device integrates as a REST API source, and users commonly expose meter readings via MQTT or HTTP to Home Assistant

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add GitHub Actions workflow for automated ESP32 firmware builds and validation

The repo has a build.yaml workflow but it appears incomplete. There's no validation that the CMake build system (code/CMakeLists.txt and component-level CMakeLists.txt files) successfully compiles on every PR. This prevents regressions in the embedded C++ codebase across jomjol_configfile, jomjol_controlGPIO, jomjol_controlcamera, and jomjol_fileserver_ota components.

  • [ ] Review existing .github/workflows/build.yaml to understand current setup
  • [ ] Extend workflow to run CMake configure and build for the ESP32-CAM target
  • [ ] Add build matrix for different ESP-IDF versions if applicable
  • [ ] Verify all component CMakeLists.txt files are properly configured
  • [ ] Add step to validate compilation doesn't introduce new warnings

Create component-level unit tests for jomjol_configfile configuration parser

The configFile.cpp/configFile.h component is critical infrastructure for the entire device (all configuration parsing flows through it), but there are no visible unit tests. This is a high-impact target since config parsing bugs affect all features. New contributors can add tests for config file parsing, validation, and edge cases.

  • [ ] Create code/components/jomjol_configfile/tests directory
  • [ ] Set up CMake test configuration in code/components/jomjol_configfile/CMakeLists.txt
  • [ ] Write tests for valid config file parsing scenarios
  • [ ] Add tests for malformed/invalid configuration edge cases
  • [ ] Integrate test execution into GitHub Actions build workflow

Add comprehensive API documentation for server components and HTTP endpoints

The codebase contains multiple server implementations (server_GPIO.cpp, server_camera.cpp, server_ota.cpp, server_file.cpp, server_help.cpp) that expose HTTP endpoints, but there's no documented API specification. This blocks external integrations and increases support burden. A new contributor can document all endpoints, parameters, and response formats.

  • [ ] Audit all .cpp server files in code/components to identify HTTP endpoints and their signatures
  • [ ] Create docs/API.md with endpoint documentation (methods, paths, parameters, response examples)
  • [ ] Document authentication/authorization for each endpoint if applicable
  • [ ] Add example curl/HTTP requests for common operations (capture image, get config, update firmware)
  • [ ] Reference this API doc from README.md and add to Table of Contents

🌿Good first issues

  • Add unit tests for code/components/jomjol_configfile/configFile.cpp parsing: create test cases for malformed JSON, missing keys, and config version upgrades to prevent regressions
  • Create documentation in code/README.md with actual SDK/compiler version requirements: the main README mentions TensorFlow Lite but doesn't specify ESP-IDF version, TFLite Micro commit hash, or verified CMake versions
  • Implement timezone/NTP synchronization: add a new component jomjol_ntp that performs NTP sync on WiFi connect and exposes timezone offset to inference pipeline, enabling accurate meter reading timestamps without user intervention

Top contributors

Click to expand
  • @SybexX — 33 commits
  • @caco3 — 29 commits
  • @jomjol — 23 commits
  • @mekaneck — 2 commits
  • [@Frank Haverland](https://github.com/Frank Haverland) — 2 commits

📝Recent commits

Click to expand
  • a1ccda2 — Update version in Changelog to 16.1.0 (caco3)
  • 71766e1 — prepared changelog for 16.1.0-RC1 (CaCO3)
  • d739ad4 — Enable OV3660 support in sdkconfig.defaults (#3996) (PowLee88)
  • 7157703 — Added "Draw from center" option to Analog ROI editor (#3975) (evgbus)
  • 39de778 — Add link for top cover and antenna holder (#3988) (Mallo321123)
  • de4ae71 — Add default_entity_id to MQTT HA autodiscovery payload (#3970) (mekaneck)
  • 2b09ce6 — checkDigitConsistency: added ESP_LOG_DEBUG output (#3962) (SybexX)
  • eb81228 — dig-class100-0182 model with new lcd images (#3947) (Frank Haverland)
  • f3e3ce5 — setup_fix (#3906) (SybexX)
  • ba03a7d — Migration fix (#3900) (SybexX)

🔒Security observations

  • High · Embedded Miniz Library - Potential Zip Bomb and Decompression Vulnerability — code/components/jomjol_fileserver_ota/miniz/miniz.c and server_ota.cpp. The codebase includes an embedded miniz library (code/components/jomjol_fileserver_ota/miniz/) for ZIP file handling. Miniz has a history of vulnerabilities related to ZIP bomb attacks and improper decompression handling. The OTA (Over-The-Air) update functionality uses this library without visible validation of decompressed sizes or file counts. Fix: 1) Implement strict limits on decompressed file sizes and total decompression ratio. 2) Add validation to prevent zip bombs (e.g., max decompression ratio of 100:1). 3) Consider using a well-maintained, actively patched ZIP library or validate against the latest miniz version. 4) Implement timeout mechanisms for decompression operations.
  • High · OTA Update Server - Insufficient Authentication/Authorization — code/components/jomjol_fileserver_ota/server_ota.cpp and server_ota.h. The OTA update functionality (server_ota.cpp) appears to handle firmware updates without visible cryptographic signature verification or mutual TLS authentication. This could allow attackers to push malicious firmware to devices if they can intercept or perform MITM attacks. Fix: 1) Implement digital signature verification for all OTA updates using asymmetric cryptography. 2) Enforce HTTPS with certificate pinning for update checks and downloads. 3) Implement rollback protection and version checking. 4) Use secure boot features if available on ESP32. 5) Add detailed logging of update operations.
  • High · Unencrypted Network Communications — code/components/jomjol_fileserver_ota/ and code/components/jomjol_controlcamera/ and code/components/jomjol_controlGPIO/. The codebase includes multiple server components (server_GPIO.cpp, server_camera.cpp, server_file.cpp) that likely expose HTTP endpoints for device control and data retrieval. There is no visible enforcement of HTTPS or encrypted communication, exposing sensitive meter readings and device control commands. Fix: 1) Enforce HTTPS for all web endpoints. 2) Implement certificate management (self-signed or proper CA certificates). 3) Disable HTTP or redirect to HTTPS. 4) Implement secure WebSocket (WSS) if real-time updates are used. 5) Add security headers (HSTS, CSP, X-Frame-Options).
  • High · Weak or Missing Authentication for Web Interface — code/components/jomjol_controlGPIO/server_GPIO.cpp, code/components/jomjol_controlcamera/server_camera.cpp. The web interface components (server_GPIO.cpp, server_camera.cpp) lack visible authentication mechanisms. Device configuration, camera controls, and GPIO manipulation could be performed by unauthenticated attackers on the network. Fix: 1) Implement strong authentication (username/password with bcrypt/argon2, or token-based auth). 2) Add session management with secure cookies. 3) Implement rate limiting and account lockout mechanisms. 4) Change default credentials if any exist. 5) Consider implementing OAuth2 or similar for user management.
  • Medium · Potential Command Injection in Configuration File Parsing — code/components/jomjol_configfile/configFile.cpp and configFile.h. The configFile.cpp component parses configuration files without visible input validation or sanitization. If configuration files are remotely updatable or user-controllable, this could lead to command injection or arbitrary code execution. Fix: 1) Implement strict input validation for all configuration parameters. 2) Use whitelisting for allowed configuration values. 3) Avoid passing configuration values to system commands or shell execution. 4) Use safe APIs for configuration parsing (e.g., JSON schema validation). 5) Implement config file integrity verification.
  • Medium · Insufficient Input Validation in Camera Control — code/components/jomjol_controlcamera/ov2640_*.. Camera settings are adjusted via multiple functions (ov2640_contrast_brightness.cpp, ov2640_sharpness.cpp, ov2640_specialEffect.cpp) without visible bounds checking or input validation, potentially leading to buffer overflows or unexpected device behavior. Fix: undefined

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Healthy signals · jomjol/AI-on-the-edge-device — RepoPilot