Skip to content

Latest commit

 

History

78 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPI Camera Plugin

CI codecov

Device-side software for automated image capture on Raspberry Pi, integrated with the Reverse Engineering Lab platform.

Quick Links

  • Installation Guide - hardware setup, pairing, Docker, standalone mode, and troubleshooting
  • Architecture - runtime design, relay flow, auth boundaries, and configuration model
  • Contributing - local development, tests, quality checks, and release workflow
  • Platform Docs - camera management in Relab

What It Does

The plugin runs a lightweight FastAPI server on a Raspberry Pi that:

  • captures still images from the connected camera module
  • publishes an HLS preview through the local MediaMTX sidecar
  • connects to Relab through an outbound WebSocket relay
  • exposes local REST endpoints for setup, diagnostics, and direct integrations

Supported hardware is Raspberry Pi 5/4 with Camera Module 3/v2 on Raspberry Pi OS 64-bit.

Supported Modes

Mode Purpose
Paired relay The Pi opens an outbound WebSocket relay to the Relab backend.
Local direct LAN/Ethernet clients call the Pi API with X-API-Key.
Backend upload Captures are pushed back to the Relab backend.
S3 upload Captures are written to a configured S3-compatible bucket.

Getting Started

  1. Follow INSTALL.md to prepare the Pi, generate compose.override.yml, and start the service.
  2. Set PAIRING_BACKEND_URL in .env.
  3. Read the 6-character pairing code from /setup or the PAIRING READY log banner.
  4. Enter the pairing code in the native Relab app.
  5. Visit http://your-pi-ip:8018/setup to check pairing, status, and diagnostics.

Use the generated RPi camera API reference for endpoint-level documentation. The Pi-hosted Swagger/OpenAPI routes are development-only.

The HTTPS-served Relab web frontend cannot auto-probe the Pi's plain-HTTP local API because browsers block mixed content. Use the native app for pairing and direct-mode setup.

Standalone Mode

The plugin can run without a Relab backend by writing captures to an S3-compatible bucket. The default standalone stack uses a loopback-only RustFS sidecar and APP_ENV=development for local HTTP storage. Remote production S3 endpoints require HTTPS.

Captured images, queued retries, dead letters, and preview thumbnails are sensitive local device data. In standalone S3 mode, generated public URLs are reachable wherever the configured bucket, endpoint, or proxy is reachable, so keep image storage private or LAN-only when captures are sensitive.

See INSTALL.md#standalone-mode for the complete .env example and runtime checks.

Local Direct Mode

Local mode is enabled by default. On first boot the plugin generates a persistent local API key. Paired Relab apps can retrieve that key through the relay for lower-latency LAN access, and custom local clients can use it with X-API-Key.

The local key is an auth gate for the direct interface. It does not register a camera in Relab; relay pairing still does that. See INSTALL.md#local-direct-mode for key retrieval and network notes.

Observability

The plugin writes redacted structured logs and can ship logs, metrics, and traces to an external observability stack. OTLP tracing is opt-in with OTEL_ENABLED=true and OTEL_EXPORTER_OTLP_ENDPOINT; remote production OTLP endpoints require HTTPS.

See INSTALL.md#observability for operator configuration and ARCHITECTURE.md#observability for the internal pipeline.

Troubleshooting

Use INSTALL.md#troubleshooting for operator issues. Use CONTRIBUTING.md for development setup and test workflow.

Licensing

What Licence
Plugin software AGPL-3.0-or-later
The published API specification (openapi.rpi-cam.json) Apache-2.0

The specification is carved out so that anyone writing a client or an integration against this camera API does not inherit the plugin's copyleft. This mirrors the same split in the Relab platform repository, so every published Relab API schema answers the licensing question the same way.

About

A FastAPI-based REST API to control Raspberry Pi cameras remotely. Tested and verified on Raspberry Pi 5 with Camera Module 3. This API is a component of the CML ReLab platform.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages