{"id":14985580,"url":"https://github.com/t9air/klipper-camera-watchdog","last_synced_at":"2026-02-01T19:30:15.114Z","repository":{"id":246564658,"uuid":"821493669","full_name":"T9Air/klipper-camera-watchdog","owner":"T9Air","description":"3d print error detector that catches errors before normal AI spaghetti detectors.","archived":true,"fork":false,"pushed_at":"2024-07-14T16:47:18.000Z","size":117,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T02:47:23.427Z","etag":null,"topics":["klipper","klipper-macros","macros","python","python3","timelapse","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/T9Air.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-28T17:04:04.000Z","updated_at":"2024-12-24T01:32:26.000Z","dependencies_parsed_at":"2024-06-28T18:34:20.222Z","dependency_job_id":"1014f459-909e-46c0-9996-52515bd01478","html_url":"https://github.com/T9Air/klipper-camera-watchdog","commit_stats":{"total_commits":70,"total_committers":1,"mean_commits":70.0,"dds":0.0,"last_synced_commit":"34e5a0b369067550549ed7f4bc381037f7af543d"},"previous_names":["t9air/klipper-camera-watchdog"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T9Air%2Fklipper-camera-watchdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T9Air%2Fklipper-camera-watchdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T9Air%2Fklipper-camera-watchdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T9Air%2Fklipper-camera-watchdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T9Air","download_url":"https://codeload.github.com/T9Air/klipper-camera-watchdog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239785299,"owners_count":19696751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["klipper","klipper-macros","macros","python","python3","timelapse","yaml"],"created_at":"2024-09-24T14:11:14.502Z","updated_at":"2026-02-01T19:30:15.077Z","avatar_url":"https://github.com/T9Air.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# klipper-camera-watchdog\n3d print error detector that catches errors before normal AI spaghetti detectors.\n\u003e Note: The background on how I decided to start this project is at the bottom of the page since it is a few paragraphs long, and I do not want to bore people who just want to get to all the important stuff.\n\n# Installation and setup\nGo to https://github.com/T9Air/klipper-camera-watchdog/blob/main/docs/INSTALLATION.md\n\n# Contributing\nGo to https://github.com/T9Air/klipper-camera-watchdog/blob/main/docs/CONTRIBUTING.md\n\n# Code of Conduct\nGo to https://github.com/T9Air/klipper-camera-watchdog/blob/main/docs/CODE_OF_CONDUCT.md\n\n# Roadmap\nThese are my plans for the future. Go to https://github.com/T9Air/klipper-camera-watchdog/blob/main/docs/ROADMAP.md\n\n# Releases\nThe releases are more of a way to make official separations to be able to tell how the project has evolved over time. I plan on making enough changes to the code to have a new release every 1-3 weeks. \n\nAfter every new release, all branches will be updated to match the master branch. This may cause that branch to be deleted and a new branch with the same name to be created.\n\n# Warning\nThis repository includes a g-code macro which can potentially damage your printer. Never use a macro unless you understand what it does.\n\n# Background\nI saw a post on [reddit](https://www.reddit.com/r/3Dprinting/comments/1dmbpg0/instead_of_detecting_spaghetti_why_not_detect_a/) where the [OP](https://www.github.com/markcarroll) asked why most software looks for spaghetti since spaghetti is usually caused by the object moving on the print bed. The OP thought that maybe we should just take images after each layer, and see if the object moved in between layers. After seeing this I decided to try to make something that would do this, because who knows? Also, I figured that be detecting when the object itself moves, you should be able to catch errors earlier, and who does not want to do that?\n\nSo I started working and chose to use Python as the language that will be run to check the images for movement. Luckily, it was very easy to find the library that I could use to check for differences between the images just by looking it up. That library is called [cv2](https://pypi.org/project/opencv-python/). I then tried to see if I could take images using the Python script but then realized that it would not work since the camera is already being used so that I can view my printer through Fluidd or Mainsail. Therefore I decided to take images using a timelapse but save the images to a location that the script can access. \n\nAfter creating the macro to move the printer to a specified location to take the timelapse frame, I ran into another problem. How would I run the Python script from the macro, and then cancel the print if movement is detected? First I tried running the Python script from a shell script (I forget what repository I used to get the ability to run a shell script from a macro), but I could not figure out how to pass back to the macro whether to cancel the print or not. Luckily, I found [droans](https://github.com/droans) [extended_macros](https://github.com/droans/klipper_extras) repo, which allowed me to run a Python script from inside a g-code macro. After that, it was easy to figure out how to tell the macro to cancel the print by just returning a value, and based on that, the macro would decide whether to cancel the print or not.\n\nAnd that is basically why I decide to start this project, and how I set the main code up! I do have a few things that I would like to add, some more and some less complicated, but for now, everything is working. I only have 1 problem, which is what the threshold value for canceling the printing should be. Any help with trying to figure it out would be greatly appreciated.\n\n# Thank you's\nThank you to [droans](https://github.com/droans) for the [extended_macros](https://github.com/droans/klipper_extras) repo, and all the help you gave when I had trouble setting it up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft9air%2Fklipper-camera-watchdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft9air%2Fklipper-camera-watchdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft9air%2Fklipper-camera-watchdog/lists"}