Plugin Marketplace
Sign in

Failure Detector

TrustedPhilip SørensenNo votesgithub.com/philip-soerensen/connect-local-failure-detector
  • Failure Detector, image 1

Watches printer cameras during prints and detects failed prints (spaghetti) with an on-device AI model (obico or printguard, your choice), Obico-style. Alerts on the event stream and can pause the printer. RTSP cameras are pulled with ffmpeg installed on the server.

Watches printer cameras during prints and detects failed prints (spaghetti) with an on-device AI model, Obico-style. Alerts on the event stream and can pause the printer.

This extension is native code that runs on your Connect Local server, with the permissions you grant it at install. It is not sandboxed. Prusa reviewed this release before publishing it; install extensions only from authors you trust.

Connects to
  • the server you set in model_urlfrom the server

    Download the ONNX detection model once, on first use.

    Sends: Nothing leaves the server; the model bytes arrive over HTTPS.

  • the server you set in prototypes_urlfrom the server

    Download the PrintGuard class prototypes once, on first use (model=printguard only).

    Sends: Nothing leaves the server; the prototypes arrive over HTTPS.

  • the server you set in camera_snapshot_hosts:80,443,8080from the server

    Camera access. HTTP snapshots go only to the hosts in camera_snapshot_hosts (empty refuses all); RTSP cameras (feeder rtsp_url) are pulled with ffmpeg installed on the server.

    Sends: A GET for one JPEG, with the camera's digest credentials, to a host the operator named.

What's inside 0.3.24
  • module.yamlThe manifest: what the extension is and what it asks for
  • failure-detector_linux_amd64The program for linux amd64
  • failure-detector_linux_arm64The program for linux arm64
  • failure-detector_darwin_amd64The program for darwin amd64
  • failure-detector_darwin_arm64The program for darwin arm64
  • failure-detector_windows_amd64.exeThe program for windows amd64
  • ui/The browser bundle the Connect web app loads
  • checksums.txtThe SHA-256 of every file above
  • checksums.txt.sigThe author's signature over checksums.txt

A release may also carry LICENSE, README.md and CHANGELOG.md. Nothing else is accepted.

Versions
0.3.24latest .tar.gz

AGPL-3.0-or-later · core * · sink · linux_amd64, linux_arm64, darwin_amd64, darwin_arm64, windows_amd64 · 14617.1 KB · Nov 19, 2026

Failure Detector v0.3.24 — AI spaghetti detection for Prusa Connect Local

Warning: this project was 100% written by Mistral Vibe. I have tried to direct it and test as best I can, but consider this potential AI slop and take your precautions. I did it because it was fun, but it should not be shared without this disclaimer. However, it works on my machine!

Expect bugs. Beta, written by an AI, tested on exactly one setup (Prusa Core One + standalone Buddy3D camera over RTSP + Connect Local on a Linux server). Read the code before trusting it with a print.

Supports two different AI models

  • obico (default) — the AGPL-3.0 reference detector (~200 MB, 416x416, bounding boxes)

  • printguard — ~5 MB ShuffleNetV2 encoder + prototype classifier (GPL-2.0, oliverbravery/PrintGuard), very fast on CPU, 224x224 tiled scoring

Switch from the Spaghetti tab on a printer's page (Model dropdown) or the extension's global settings — one option, last writer wins.

What it does

  • Spaghetti tab on every printer page: enable/disable, pause-on-failure, alert/pause thresholds, check interval, model picker, camera picker (dropdown of cameras registered on your instance), history of the last 10 scored frames with photos

  • Built-in per-printer camera feeder; RTSP-only cameras pulled with the server's ffmpeg (optional RTSP URL field)

  • Publishes failure alerts on the event stream; can pause the print when the smoothed score crosses the pause threshold

Requirement: ffmpeg on the server

RTSP cameras (e.g. a standalone Buddy3D) are pulled by running ffmpeg installed on the Connect Local server — the extension has no bundled binary and makes no other external calls. Install it with your package manager (apt install ffmpeg / dnf install ffmpeg / …). Only rtsp:// and rtsps:// URLs are accepted, and ffmpeg runs with -protocol_whitelist rtsp,rtp,tcp,udp,tls. Cameras that are already registered on your instance (like the printer's own camera) need no ffmpeg at all — frames are read from the printer's camera channel. HTTP snapshot cameras work without ffmpeg too, but only to hosts you list in the camera_snapshot_hosts option.

Configuration notes: some settings are known to overwrite each other

  • Model: one global option. The global settings page has a switch (use_printguard, ON = printguard, OFF = obico); the Spaghetti tab has a dropdown. Both write the same option — last writer wins, and changing it on one page clears the other's choice. (A leftover model: key in an old config block still applies while the switch is off.)

  • Check interval: the global min_interval_seconds is only the default; the per-printer "Check every (this printer)" on the Spaghetti tab supersedes it when set. Note the effective frame rate can never be faster than the camera's own snapshot_every cadence (camera settings), because that is how often the host hands frames to the extension at all.

  • Threshold/pause/enable changes from the Spaghetti tab are stored as runtime overrides in the module's data dir and win over the global options until the global value is changed again.

Granting the pause permission

The extension cannot grant itself operate on a printer — an administrator does it once per printer:

  1. Create an API credential in the web UI: sign in to Connect Local at https://<server>:8080, click your user avatar (top right) → API tokens → create a token (looks like pcl_…, shown once — copy it).

  2. Find the printer id: GET /api/v1/devices with that token, or from the printer page URL.

  3. Grant the module the operator relation on the printer:

201 = granted. Without it the Spaghetti tab shows a red banner and the module alerts but cannot pause.

Licenses

  • Extension: AGPL-3.0-or-later

  • Obico weights: AGPL-3.0 (TheSpaghettiDetective/obico-server)

  • PrintGuard weights: GPL-2.0 (oliverbravery/PrintGuard) — downloaded once at first use, sha256-verified, URLs overridable

Review fixes (carried from 0.3.15, still in force)

Addressing the review of 0.3.14:

  1. Caller checks on writes. POST /settings requires the caller (from routesapi.PrincipalOf) to operate the printer named in the body (or operate_resource on the module kind for direct API calls), POST /feeders and POST /printer-settings require operate on the printer — checked with accessapi, denied on any error. Read-only users can no longer switch detection or pausing.

  2. No secrets leave the module. GET /feeders returns the camera source with token_set (whether a token is stored) instead of the token itself.

  3. ffmpeg is hardened. RTSP grabs accept only rtsp:///rtsps:// URLs and run with -protocol_whitelist rtsp,rtp,tcp,udp,tls, so file:, http:, concat: etc. are refused before exec. The ffmpeg requirement is stated in the listing summary and the install/update dialog's egress section.

  4. Camera snapshot fetches are declared and bounded. New option camera_snapshot_hosts (comma-separated hosts) with a matching egress entry; snapshot_url must be http(s) with a host on that list, the body is capped (io.LimitReader at max_frame_bytes) and the call has a timeout.

Smaller: the UI camera list goes through host.client (no direct fetch to the host API), and model downloads have a 5-minute timeout.

Note on the scanner hits: camerapush.go os/exec is the ffmpeg RTSP grab described above; ops.go "Concat" is the ONNX Concat operator implementation in the pure-Go inference engine, not a downloader.

Changes since 0.3.15

  • 0.3.20: fixed a crash (panic in the ONNX conv) when switching models with a stale cached weights file; input sizes are now validated and per-frame panics are recovered

  • 0.3.22: switching the model from the Spaghetti tab now re-resolves the model URL/sha, so the correct weights are downloaded (sha256-verified) instead of reusing the previous model's file

  • 0.3.21/0.3.23: the model picker on the global settings page is a switch (use_printguard), no more free-text field

  • 0.3.24: every scored frame is logged with the model's inference time (frame scored … took=…), visible in the server journal

Comments (0)

Sign in to comment.

No comments yet.