This is a comprehensive 3D printer monitoring system with spaghetti detection (print failure detection) and Telegram bot integration. The system monitors ongoing prints, detects failures, and provides real-time updates through a Telegram bot interface.
- Main Application: Orchestrates all services using a centralized application class
- Printer Service: Manages communication with the OctoPrint API
- Telegram Bot Service: Handles user interactions via Telegram
- Spaghetti Detector: Monitors for print failures using computer vision
- Camera Service: Centralized service for capturing images from the printer camera
- Configuration Manager: Unified configuration system with validation
- Real-time print monitoring
- Spaghetti detection (print failure detection)
- Timelapse creation
- Remote control via Telegram
- Adaptive learning from user feedback
- Graceful shutdown handling
- Clone the repository
- Install dependencies:
pip install opencv-python requests python-telegram-bot pillow numpy
- Set up environment variables:
OCTOPRINT_API_KEYTELEGRAM_BOT_TOKENCHAT_ID
All configuration settings are managed through the unified configuration system:
config = ConfigManager()Key configurable parameters include:
- Detection thresholds
- Camera settings
- Notification preferences
- Print monitoring intervals
- Adaptive learning parameters
Centralized service for capturing images from the printer camera with proper resource management.
Uses computer vision to detect print failures with adaptive learning capabilities.
Handles user interactions, notifications, and remote commands.
Manages communication with the OctoPrint API for printer status and controls.
The system implements centralized error handling with proper logging and graceful degradation.
All important events are logged with appropriate severity levels for debugging and monitoring.
- Input validation for all user inputs
- Secure handling of credentials
- Environment variable validation