Skip to content

EUMETNET/webcam-iot-ingest

Repository files navigation

webcam-iot-ingest

FastAPI service that ingests webcam images, stores them in S3-compatible object storage, and publishes notifications to an MQTT broker.

What it does

  1. Accepts a POST /upload payload with a base64-encoded image
  2. Validates and converts the image to JPEG, resizes to max 640×480
  3. Uploads the file to an S3 bucket
  4. Publishes an MQTT message with the object URL and metadata

Quick start

Install just

install-just.sh

Adjust env variables and run

cp .env.example .env
just up

API docs available at http://localhost:8009/docs

Environment variables

Variable Default Description
MQTT_HOST mqtt Broker hostname
MQTT_PORT 1883 Broker port
MQTT_USERNAME Broker username
MQTT_PASSWORD Broker password
MQTT_TLS False Enable TLS
MQTT_TOPIC_PREPEND - Topic prefix
BUCKET_NAME - Bucket name
BUCKET_ACCESS_KEY_ID S3 access key
BUCKET_SECRET_ACCESS_KEY S3 secret key
BUCKET_ENDPOINT_URL S3 endpoint URL
BUCKET_OBJECT_URL S3 object URL

Monitoring

Start the full monitoring stack (Prometheus + Grafana):

just local

Pre-built dashboards for FastAPI and MQTT are provisioned automatically.

Running tests

pip install -e .
pytest tests/

Example image ingestion

Example Python script to ingest a randomly colored 640x480 png image provided in test_sender.py

About

This software is for ingesting of IoT webcams to cloud storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors