PrintWatch Plugin that runs on any Klipper based 3D Printer. This backend monitors the webcam stream on any Klipper printer for spaghetti type defects. It can work with any camera that is accessible via an IP address/HTTP endpoint. This Plugin requires Moonraker for making API requests to the Klipper firmware.
If you are an OEM using Klipper for their printers, please contact us for a more custom integration, support, and licensing options.
This Backend component can be installed on any Linux device that is running Klipper. Ensure that the latest version of pip is installed on your device with the following commands:
pip install --upgrade pip
In some cases you will need to specify pip3:
pip3 install --upgrade pip
In some cases, you will need to upgrade using python:
python -m pip install --upgrade pip
Please follow the steps below for your device:
cd /home/pi
git clone https://github.com/printpal-io/Klipper-PrintWatch
cd Klipper-PrintWatch
pip3 install -r requirements.txt
sudo nano settings.json
Then modify the api_key
and camera_ip
fields to match your configuration.
You can obtain your API key from your account's settings tab, or upgrade if you haven't upgraded your account yet.
The camera_ip
field should be the URL address for retrieveing the static image of your webcam. If using crowsnest (built-in streamer for Klipper), this URL is configured in your crowsnest.conf
file. The address is typically http://127.0.0.1/webcam/?action=snapshot
. Verify this by entering the URL into your browser and ensuring the static image of the webcam is returned.
If you want to edit the api_key
or camera_ip
after having started the printwatch.service
, you must run the command systemctl restart printwatch
for the changes to take effect.
sudo systemctl daemon-reload
sudo systemctl enable /home/pi/Klipper-PrintWatch/printwatch.service
sudo systemctl start printwatch.service
sudo journalctl -u printwatch
Outputs:
Sep 08 23:35:24 pi systemd[1]: Started PrintWatch AI.
Sep 08 23:35:28 pi python3[2237]: INFO: Started server process [2237]
Sep 08 23:35:28 pi python3[2237]: INFO: Waiting for application startup.
Sep 08 23:35:28 pi python3[2237]: INFO: Application startup complete.
Sep 08 23:35:28 pi python3[2237]: INFO: Uvicorn running on http://0.0.0.0:8989 (Press CTRL+C to quit)
You must overwrite the Mainsail directory with the folder in this repository in order to enable the AI panel (this will change in the future).
$ cd ~
$ cp -rf Klipper-PrintWatch/mainsail .
http://<DEVICE IP>
and navigating to the Dashboard:Visit the Mainsail UI page at http://<RPi IP address>
Navigate to the dashboard and observe the AI
component added to the dashbaord items:
What each item means:
Status
: this is the status of the AI monitor, it can be: Monitoring
, Idle
, or Disabled
.
Monitoring
: this means that the AI is actively running and analyzing the webcam imagesIdle
: this means the AI is turned on but not actively observing anything.Disabled
: this means the AI is turned offSensitivity
: this is the current sensitivity of the AI set by the user. It can be three values:
Fast (3 minutes)
: it takes ~3 minutes of consistent positive detections for an action to occurMedium (6 minutes)
: it takes ~6 minutes of consistent positive detections for an action to occurLong (12 minutes)
: it takes ~12 minutes of consistent positive detections for an action to occurNotification
: if notifications are enabled by the user
Pausing
: if pausing the print is enabled by the user
Defect Level
: the current moving average of the defect level detected by the AI
0-100
16/32/64
detections
Sensitivity
= Fast (3 minutes
the last 16 detections are used for the averageSensitivity
= Medium (6 minutes
the last 32 detections are used for the averageSensitivity
= Fast (12 minutes
the last 64 detections are used for the averageVisit the settings page from the top navigation bar of the Mainsail UI and navigate to the AI
sidebar option:
The user can change the settings on this page and then must click SAVE
.
If this is your first time using the plugin, follow our configuration guide for configuring your camera's settings, location, and the lighting.
Develop a custom integration with the AI backend by using the REST API documentation found on this repository.