Skip to content

DrAlexLiu/OctoPrint-PiNozCam

Repository files navigation

OctoPrint-PiNozCam

Join Discord

🌉Introduction

Welcome to the future of 3D printing with PiNozCam!🎉 It brings free failure detection to your device using edge computing on Arm📟. You can also control your printer remotely using Telegram📱.

Device (50% of All Cores for AI) Detect Speed (images / minute)
Raspberry Pi 5 45
Raspberry Pi 4 9
More Support Devices
Device (50% of All Cores for AI) Detect Speed (images / minute)
Raspberry Pi 3B 5
PC with Intel i5 10600 260
OrangePi Zero 2/3 9
Raspberry Pi Zero 2 W 3

*The inference speed tests were conducted under the circumstance that 50% of the device's cores were allocated for AI processing, while the remaining 50% of the cores were dedicated to OctoPrint and printing processes.

Unlock advanced 3D printing monitoring with PiNozCam, your go-to solution for AI-powered surveillance — all without any subscription or registration. PiNozCam brings cutting-edge computing to your Raspberry Pi or any old PC/single board computer, ensuring privacy and providing instant failure alerts via Telegram/Discord.

Fast Local Detection Instant AI Failure Notifications Privacy-Focused
Remote Pause/Stop No Ad/Credit Card/Subscriptions Set Undetect Zone
💻Support Platforms Support RPi OS platform ([Don’t know❓](https://raspberrytips.com/which-raspberry-pi-os-is-running/)):
OS platform Buster Bullseye Bookworm
arm64 (x64)
armhf (x32)

⚠️ This plugin supports the OctoPi image . However, I am still working on this plugin on Octo4a and it may be supported in the future versions.

RPi(Boardcom) Intel/AMD CPU AllWinner RockChip RAM
>=1GB
Plugin Setup

Plugin Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/master.zip

🚀One AI, Two Modes

Choose Mode and Set Correct Parameters:
NozzleCam WebCam
Boxes Display Threshold: 0.6
Image Sensitivity:0.05 (0.04-0.1)
Failure Scores Threshold: 0.75 (0.75-0.88)
Boxes Display Threshold: 0.75
Image Sensitivity:0.02 (0.02-0.04)
Failure Scores Threshold: 0.94 (0.94-0.99)

Choose the correct settings for your PiNozCam before use. The wrong mode setting can cause false alarms or missed failures.

Camera Setup

📷Camera Setup

Endoscope WebCam
- NozzleCam kits: StealthBurner, 3Do, etc.
- Build yours from Aliexpress or Amazon or Temu.
- Built-in LED backlighting.
- Positioned 5-10 cm from the nozzle.
- Fixed Focus Lens
Logitech C920, C270 or other webcams
AutoFocus enabled
Desk Lamp to provide enough light
Positioned >20 cm from the nozzle.
Positioned front left/right corner of printing bed

Ensure your camera:

⚠️ Cleaning the camera lens before EACH print is highly recommended for dust removal.

Fixture

Search and print a camera fixture for your camera model from Thingiverse or Printables.

📱Telegram/Discord Remote Control

To enable remote control, enter your Telegram bot token and chat ID or Discord Webhook url. Also, setup your printer title, you can check your 3D printer and control it from your Telegram chat. After setting up the Telegram bot, you can use these buttons.

-🔍 Check: See a picture of your printer, its status, progress, temperatures, and file name.

-🔇 Mute / 🔊 Unmute: Stop or start getting notifications about your printer. You can still use "Check" when muted.

-⏸️ Pause / ▶️ Resume: Pause your print. Click again to continue printing.

-⏹️ Stop: Stop your print. The printer will start cooling down.

Remote control by discord will be released soon.

Remote Control UI

Upon configuration and clicking "Save". A welcome message confirms successful setup. An example failure notification will be sent like this:

Example:
Telegram Discord

💥Set Undetect Zone:

Open the dialog box to make a custom mask. This mask tells the AI which parts of the image to ignore when looking for print failures. Draw on the canvas to select the areas you don't want the AI to check. This lets you focus the AI on your print instead of unrelevant background.

Parameters Adjustment

Navigate to the PiNozCam tab:

The screenshot:

Key Parameters:

Initially, stick with the default settings and adjust them gradually to fine-tune performance.

  • Action after Detection: Specifies the action PiNozCam should take when a print failure is detected (e.g., notify only, pause print, stop print). Detected failures are displayed in this webpage for 5 seconds, allowing for immediate visual verification.
  • Image Sensitivity: Image sensitivity = (All bounding box areas 'higher than Failure Scores Threshold')/(Whole image area). A smaller number will find small failures or when a failure just starts. A bigger number will only find big, easy-to-see failures or failures that have been going on for a while and have gotten larger.
  • Failure Scores Threshold: Set the smallest score a box needs to count as a failure and make alerts or actions happen. You can see the score in the corner of each box. A higher number means the AI is more certain about failures but could miss some. A lower number means the AI will spot failures sooner but might also give false alarms.
  • Max Failure Count: Set the maximum number of failures allowed within the Failure Consider Time before PiNozCam pauses or stops the print as configured in Action after Detection. A value 2 or above is recommended to avoid false alarms.
  • Failure Consider Time (s): Set the time window in seconds that PiNozCam remembers and counts failures towards the Max Failure Count. Older failures outside this window are forgotten, like how an airplane's black box only records the last part of the flight.
Other Parameters
  • Enable PiNozCam: Turn the AI detection function of PiNozCam on or off.
  • AI Start Delay (s): Set how many seconds PiNozCam should wait after OctoPrint starts a print before it begins looking for failures. This delay gives time for the bed to level and other starting print steps to finish.
  • Notify Mode: Choose whether to send a notification for each failure detected or only after reaching the Max Failure Count.
  • Custom Snapshot URL: Provide a custom URL or IP camera URL for PiNozCam to fetch camera images from instead of the default snapshot URL. Examples: http:https://192.168.0.xxx/webcam/?action=snapshot. (RTSP protocol is not supported)
  • CPU Speed Control: Offers options for running the CPU at half or full speed. Half speed is recommended.
  • Max Notification Count: Set the maximum number of messages PiNozCam will send before it stops sending more until the print is finished or stopped. If you set it to 0, there will be no limit and it will keep sending messages.

Customer Support

For further discussion and support, please join our Discord channel.

Support my work

I created this plugin in my spare time, so if you have enjoyed using it then please support it’s development!