snapmaker
Control and monitor Snapmaker 2.0 3D printers via their HTTP API. Status, job management, progress watching, and event monitoring.
- License 许可
- MIT
- 最近更新
- 2026-04-05
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- snapmaker
- summary
- Snapmaker 2.0 3D printer control: status, jobs, monitoring.
- version
- 1.0.0
- homepage
- https://github.com/odrobnik/snapmaker-skill
- metadata
- { "openclaw": { "emoji": "?️", "requires": { "bins": [ "python3" ] } } }
- description
- Control and monitor Snapmaker 2.0 3D printers via their HTTP API. Status, job management, progress watching, and event monitoring.
02 资源文件 3
- 参考文档_meta.json278 B
- 脚本scripts/monitor.py5.3 KB
- 脚本scripts/snapmaker.py12.9 KB
03 SKILL.md 正文
Snapmaker 2.0 Skill
Control and monitor Snapmaker 2.0 3D printers via their HTTP API.
Features
- Status monitoring - Real-time printer status (temperatures, progress, position)
- Job management - Send, start, pause, resume, and stop print jobs
- Safety features - Prevents interfering with active prints without confirmation
- Progress watching - Live monitoring of print progress
- Notification support - Detect print completion, filament issues, errors
Configuration
Config stored in ~/clawd/snapmaker/config.json:
{
"ip": "192.168.0.32",
"token": "your-token-here",
"port": 8080
}
Finding your token:
- macOS:
~/Library/Application Support/snapmaker-luban/machine.json - Windows:
%appdata%\snapmaker-luban\machine.json - Linux:
~/.config/snapmaker-luban/machine.json
Look for the server.token field (second "token" in the file).
Usage
Basic Commands
# Get current printer status
python3 scripts/snapmaker.py status
# Watch print progress (updates every 5 seconds)
python3 scripts/snapmaker.py watch
# Get status as JSON
python3 scripts/snapmaker.py status --json
Job Control
# Send a file (prepares but doesn't start)
python3 scripts/snapmaker.py send ~/prints/model.gcode
# Send and start immediately
python3 scripts/snapmaker.py send ~/prints/model.gcode --start --yes
# Pause current print
python3 scripts/snapmaker.py pause --yes
# Resume paused print
python3 scripts/snapmaker.py resume --yes
# Stop/cancel print (requires confirmation)
python3 scripts/snapmaker.py stop
Safety Flags
--yes- Skip confirmation prompts (use with caution!)--force- Override safety checks (NOT RECOMMENDED)
All commands that modify state require confirmation unless --yes is provided.
API Endpoints
The skill uses these Snapmaker HTTP API v1 endpoints:
POST /api/v1/connect- Establish connectionGET /api/v1/status- Get printer statusPOST /api/v1/prepare_print- Upload filePOST /api/v1/start_print- Start printingPOST /api/v1/pause- Pause printPOST /api/v1/resume- Resume printPOST /api/v1/stop- Stop/cancel printGET /api/v1/print_file- Download last file
Status Fields
The status command returns:
- status - Overall state (IDLE, RUNNING, PAUSED)
- printStatus - Printing / Idle
- progress - 0.0 to 1.0
- fileName - Current/last file
- currentLine / totalLines - G-code progress
- elapsedTime / remainingTime - In seconds
- nozzleTemperature1 / nozzleTargetTemperature1
- heatedBedTemperature / heatedBedTargetTemperature
- x / y / z - Current position
- isFilamentOut - Filament runout detection
- isEnclosureDoorOpen - Door state
Notifications
To detect events:
# Watch for completion
python3 scripts/snapmaker.py watch
# Or poll status in a loop
while true; do
python3 scripts/snapmaker.py status --json | jq -r '.printStatus'
sleep 10
done
Event detection:
- Print complete - status == "IDLE" && progress >= 0.99
- Filament out - isFilamentOut == true
- Door opened - isEnclosureDoorOpen == true
- Error - Check status field for errors
Safety Features
- Active print protection - Cannot send files while printing
- Confirmation prompts - All destructive actions require confirmation
- State validation - Commands check printer state before executing
- Clear warnings - Stop command shows prominent warning
Examples
Check if printer is busy
python3 scripts/snapmaker.py status | grep -q "RUNNING" && echo "Busy" || echo "Available"
Get remaining time
python3 scripts/snapmaker.py status --json | jq -r '.remainingTime'
Monitor temperatures
python3 scripts/snapmaker.py status --json | jq '{nozzle: .nozzleTemperature1, bed: .heatedBedTemperature}'
Troubleshooting
Connection refused:
- Verify printer IP:
ping 192.168.0.32 - Check printer is powered on
- Ensure you're on the same network
Invalid token:
- Reconnect Luban to the printer (accept on touchscreen)
- Extract new token from
machine.json - Update
~/clawd/snapmaker/config.json
Can't send file:
- Check if printer is busy:
python3 scripts/snapmaker.py status - Wait for current print to finish
- Use
--forceonly if absolutely necessary
References
Dependencies
- Python 3.6+
requestslibrary (install:pip3 install requests)
License
Part of OpenClaw skills collection.
04 同仓库更多 Skills
zyfai
Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit/withdraw anytime.
zerion-api
暂无简介
zerion-api-skill
暂无简介
zerion-api-mcp
暂无简介
yahoo-finance-forex
Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR/USD, GBP/USD, USD/JPY, etc.). Analyzes sentiment and provides trading context.
yahoo-finance
This skill should be used when the user asks to "get stock prices", "check stock quotes", "look up earnings", "get financial data", "find trending stocks", or needs stock market data from Yahoo Finance.