Install
openclaw skills install snapmaker-2Control and monitor Snapmaker 2.0 3D printers via their HTTP API. Status, job management, progress watching, and event monitoring.
openclaw skills install snapmaker-2Control and monitor Snapmaker 2.0 3D printers via their HTTP API.
Create config.json in your workspace's snapmaker/ folder (e.g. ~/clawd/snapmaker/config.json).
Start from config.json.example.
Config format:
{
"ip": "192.168.0.32",
"token": "your-token-here",
"port": 8080
}
Finding your token:
Open the Snapmaker Luban app, connect to your printer, and find the token
in the connection settings. Copy it into your config.json.
# Find Snapmaker printers on the local network (UDP broadcast, port 20054)
python3 scripts/snapmaker.py discover
# Probe a specific IP (useful across subnets)
python3 scripts/snapmaker.py discover --target 192.168.0.32
# JSON output
python3 scripts/snapmaker.py discover --json
Discovery uses the Snapmaker UDP broadcast protocol (no auth required). Falls back to HTTP probe using config if UDP gets no reply (e.g. different subnet).
# 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
# 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
--yes - Skip confirmation prompts (use with caution!)--force - Override safety checks (NOT RECOMMENDED)All commands that modify state require confirmation unless --yes is provided.
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 fileThe status command returns:
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:
python3 scripts/snapmaker.py status | grep -q "RUNNING" && echo "Busy" || echo "Available"
python3 scripts/snapmaker.py status --json | jq -r '.remainingTime'
python3 scripts/snapmaker.py status --json | jq '{nozzle: .nozzleTemperature1, bed: .heatedBedTemperature}'
"Machine is not connected yet" (401 error):
/api/v1/connect first before any status queriescurl -X POST "http://192.168.0.32:8080/api/v1/connect?token=YOUR_TOKEN"Connection refused:
ping 192.168.0.32Invalid token:
config.jsonCan't send file:
python3 scripts/snapmaker.py status--force only if absolutely necessaryrequests library (install: pip3 install requests)Part of OpenClaw skills collection.