A small server application to relay images to Prusa Connect.
The server is configured via a yaml file loaded from either the APP_CONFIG
environmental variable or from a config.yaml
file next to the main.py
. Look at example-config.yaml
for an example configuration file with comments to explain options.
This server has the capability to snoop on your printer's status via PrusaLink. It's an optional feature that can be used to limit snapshot updates to only specific printer statuses, so you aren't uploading snapshots whenever the printer is idle. Here's the statuses that we can watch for:
IDLE
BUSY
READY
PRINTING
PAUSED
FINISHED
STOPPED
ERROR
ATTENTION
I would recommend using the whole list but IDLE
, FINISHED
, and maybe READY
and STOPPED
. Here's what I've been using:
snapshot_states:
- BUSY
- READY
- PRINTING
- PAUSED
- ERROR
- ATTENTION
The handler system is plugable, since every camera works a little differently. Below is a list of the included handlers and their options:
A simple handler that will fetch an image file from a url. Useful for some security cams and Wyze Bridge.
Import path: Camera.ImageUrl.ImageUrlHandler
Option | Required? | Description |
---|---|---|
url |
Yes | URL of the image to capture |
This use's OpenCV's videoio system to capture a variety of video sources. Can use several backends depending on what's available on your system.
Import path: Camera.VideoUrl.VideoCaptureHandler
Option | Required? | Description |
---|---|---|
url |
Yes | URL of the video stream. E.G. rtsp://0.0.0.0:8445/printer |
This server is a simple python application that uses PDM to manage dependencies. A Docker image has been provided for some user's convenience.
A Docker container has been provided at ghcr.io/privatebutts/prusacameraconnect:main
. I've put an example Docker Compose file in the project repo as well.
Either method will require passing the config yaml into the container. You can do this with either a volume mount to /app/config.yaml
or via the APP_CONFIG
env. If both a file and env is present, the application will only look at the env.
If you'd prefer to have more control over the deployment, you can install the application manually like any other pdm backed project. You'll need Python 3.11 and PDM installed before your start, then run this command to install all the dependencies:
pdm sync --prod
Then you can start the server with:
pdm run python main.py
from the src/prusacameraconnect
directory.
A justfile has been provided for either reference or convenience.
It's pretty common for people to use Wyze Cameras to keep an eye on their printer. Prusa Connect doesn't support those cameras offically, so we can use this server and Wyze Bridge to get it in the panel. This tutorial will assume that you have Wyze Bridge up and running, and a working install of Docker.
build:
block from the yaml file. This is only needed if you want to make custom changes to the source code.APP_CONFIG
environmental variable or a file you'll mount into the container.An example of the config file can be found here
Camera.ImageUrl.ImageUrlHandler
can scrape. You can find the url by hovering over the "Streams" button of the camera, then copying the url from the "RTSP Snapshot" menu option.
printer_link
is optional. Not providing it will cause the server to constantly relay snapshots to prusa cloud. I prefer to only have it update when the printer is in use, ready, or requires intervention or attention. Use the credentials in your printer's settings, url will most likely be http:// + ip address of your printer.Start the server with docker compose up
. To start in background, use -d
.
You should start seeing snapshots in the Prusa Connect dashboard.