ECE-BOT supports live video feeds from machines using a Raspberry Pi camera and Cloudflare Tunnel. The Raspberry Pi streams video locally over HTTP, and a helper script publishes the public tunnel URL to ECE-BOT automatically at boot. Operators and admins can then view the live feed directly from the machine monitoring dashboard.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Kr-Yogsa/ECE-BOT/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Raspberry Pi runs the camera stream
The Raspberry Pi runs a local camera stream server (for example,
mjpg-streamer or picamera2) that exposes a video feed at http://localhost:8080/stream. This address is only accessible on the Raspberry Pi itself.Cloudflare Tunnel creates a public URL
cloudflared runs on the Raspberry Pi and creates an outbound tunnel to Cloudflare’s edge network. This assigns a public trycloudflare.com URL to the local stream — no port forwarding or static IP required.The tunnel URL changes every time the Raspberry Pi reboots, which is why ECE-BOT stores it in the database rather than relying on a hard-coded value.publish_cloudflare_live_url.py registers the URL
The The
publish_cloudflare_live_url.py script runs on the Raspberry Pi after the tunnel starts. It automatically detects the current trycloudflare.com URL and sends it to ECE-BOT:machine_id in the URL identifies which machine the stream belongs to (melfa, plc, or cnc).The endpoint requires the
X-Live-Update-Token header to match the MACHINE_LIVE_UPDATE_TOKEN environment variable configured in ECE-BOT. This prevents unauthorized URL updates.URL storage and priority
The stream URL for each machine is stored in PostgreSQL. When ECE-BOT looks up the stream URL for a machine, it uses the following priority order:- Database-stored URL — the most recently published URL from
POST /api/machine-live/<machine_id>/url. This takes priority over all other sources. - Static environment variable — a fallback URL set at deploy time.
Static environment variables
If you do not use the Raspberry Pi publishing script, you can configure static stream URLs using environment variables:| Variable | Machine |
|---|---|
MELFA_LIVE_STREAM_URL | MELFA robot |
PLC_LIVE_STREAM_URL | PLC machine |
CNC_LIVE_STREAM_URL | CNC machine |
Access control
Only users with the operator or admin role can view live video feeds. Requests fromuser-role accounts receive a 403 Forbidden response.
API reference
machine_id values: melfa, plc, cnc.