Continuous Marlin print queue · auto cooldown & push-off · live monochrome 3D studio
Built for the Anycubic Kobra Neo and compatible bedslingers over CH340 USB-serial.
python
· fastapi
· uvicorn
· pyserial
· marlin
· 3d-printing
· anycubic-kobra-neo
· print-queue
· websocket
· gcode
Local multi-user continuous 3D printing queue, automated cooldown & gantry push-off ejector, and pure monochrome (Black / White) live 3D web dashboard for the Anycubic Kobra Neo and compatible Marlin printers (115200 baud CH340).
- Pipelined Marlin USB Streaming: Keeps Marlin's serial RX buffer saturated (up to 6 commands / 96 bytes in-flight) with
N<line> <cmd>*<checksum>framing, automaticResend:replay,echo:busy:keepalive handling, and 600s timeouts forG28/G29/M109/M190/M400— eliminating USB curve stuttering. - Automated Cooldown & Gantry Push-Off Ejection:
- Retracts, lifts Z clear, shuts heaters off (
M104 S0/M140 S0), cools at 100% part fan (M106 S255), and pollsM105until bed<= eject_temp(default28°C/ configurable in UI or CLI). - Sweeps the finished part off the front of the PEI sheet (
X110 Y215 -> Z2.0 -> Y0 -> Z30, configurable via--sweep-z).
- Retracts, lifts Z clear, shuts heaters off (
- Safe Manual-Clear Gate (
Bed Cleared):- When Require "Bed Cleared" Gate is enabled, the printer presents the bed forward (
G1 Y215), double-beeps (M300), displaysM117 Remove part!, and pauses the queue until you confirm the plate is clear.
- When Require "Bed Cleared" Gate is enabled, the printer presents the bed forward (
- Pure Monochrome Web Studio (Follows System Dark/Light +
SYS / BLK / WHTToggle):- Interactive 3D G-Code Toolpath Visualizer: Perspective 3D canvas with live nozzle cone,
Iso / Top / Front / Fitpresets,+ / −zoom, layer scrubber, Follow live-layer tracking, and mobile touch gestures (1-finger orbit, 2-finger pinch-zoom & pan). - Live Mid-Print Priority Tuning: Speed
10–300%(M220), Flow (M221), Fan (M106), Live Temps (M104/M140), Linear AdvanceK(M900), and BabyStepping (M290+M500). - Calibration Suite: 5×5 Bed Leveling Mesh Heatmap (
M420 V), one-clickG29Auto-Level, Guided Paper-Test Z-Offset Wizard, PLA Load/Unload, and Hotend/Bed PID Autotune (M303). - Multi-User LAN Sync: WebSocket broadcast keeps desktop and phone clients synced with live user presence, drag-and-drop
.gcodeuploads, drag-to-reorder queue, and history re-queue.
- Interactive 3D G-Code Toolpath Visualizer: Perspective 3D canvas with live nozzle cone,
- Cross-Platform Host Safety: Prevents sleep/USB suspend while printing on Windows (
SetThreadExecutionState), macOS (caffeinate), and Linux (systemd-inhibit), plus instant E-STOP (M112/ heaters off + Z lift).
Follows your OS/browser prefers-color-scheme automatically (SYS), or toggle between #000000 Black and #ffffff White at any time.
Pure Black (BLK) |
Pure White (WHT) |
|---|---|
![]() |
![]() |
Inspect any queued or library .gcode file layer-by-layer in 3D, follow the live print layer, jog axes, baby-step Z-offset with Save M500, test dry-sweep, and tune Linear Advance K (M900).
Drag-and-drop .gcode files, adjust copy quantities, reorder jobs, toggle Recalibrate Bed (G29) vs saved M420 S1, and configure auto-push Eject Temp and Sweep Z.
Inspect bed flatness at a glance, run G29 auto-leveling, step through the guided A4 paper Z-offset wizard, load/unload PLA, and run PID autotune.
Search and filter .gcode files, click 3D to preview any file immediately, or send raw Marlin G-code commands with ↑/↓ history and quick macros.
| File Library | G-Code Console & Quick Macros |
|---|---|
![]() |
![]() |
Full touch support (1-finger 3D orbit, 2-finger pinch-zoom & pan) and a fixed bottom navigation bar for controlling your printer from your phone over LAN.
Requires Python 3.10+ and uv (plus make if using Makefile targets). Runs on Windows, Linux, and macOS.
# 1. Install dependencies
make install
# Linux only (once): allow serial access, then re-login
# sudo usermod -aG dialout $USER
# 2. Verify CH340 serial port, M115 firmware, and M105 temperatures
make check
# Optional explicit port examples:
# make check PORT=COM3
# make check PORT=/dev/ttyUSB0
# make check PORT=/dev/cu.usbserial-0001
# 3. Test push-off clearance (heaters OFF, Z=2.0mm) before real prints
make dry-sweep
# 4. Launch the live web dashboard (PC + phone on LAN)
make webOpen http://127.0.0.1:8765 on your PC, or http://<YOUR-PC-LAN-IP>:8765 on your phone. If the firewall blocks port 8765, run make firewall and apply the printed Windows / Linux / macOS rule.
| Command | Description |
|---|---|
make help |
Show all available targets |
make install |
Sync Python dependencies via uv |
make check |
Auto-detect CH340 serial port, verify M115 & M105 |
make firewall |
Print OS firewall (+ Linux dialout) commands for LAN access |
make dry-sweep SWEEP_Z=2.0 |
Home (G28) and test push-off sweep with heaters off |
make web WEB_PORT=8765 |
Start multi-user web dashboard (0.0.0.0:8765) |
make web-local |
Start web dashboard on 127.0.0.1 only |
make run |
Drain .gcode files from queue/ -> done/ |
make watch |
Continuously watch queue/ for newly dropped .gcode files |
make mesh |
Print current 5×5 M420 V bed leveling mesh |
make z-offset Z_OFFSET=-2.85 |
Set M851 Z and save to EEPROM (M500) |
make stop |
Emergency stop (heaters off + lift Z+10 mm) |
make firmware-download |
Download custom Marlin v1.3.3 firmware.bin to firmware/ |
make test |
Run pytest unit tests |
make clean |
Clean caches and logs |
# Explicit files with repeat counts
uv run forgequeue run partA.gcode x3 partB.gcode x2 --eject-temp 28.0 --sweep-z 2.0
# Folder queue mode
uv run forgequeue run --queue-dir queue --done-dir done --watch
# Web dashboard
uv run forgequeue web --host 0.0.0.0 --web-port 8765 --auto-connectkobra-queue remains as a compatibility alias for the same CLI entry point.
forgequeue/
├── src/forgequeue/
│ ├── marlin.py # CH340 auto-detect, pipelined checksum serial streamer, M420 V mesh parser
│ ├── gcode.py # Comment stripping, repeat parser, preview geometry, G29→M420 filter
│ ├── runner.py # Cooldown / push-off sweep, continuous CLI queue runner
│ ├── manager.py # Printer + queue + calibration coordinator
│ ├── app.py # FastAPI REST + WebSocket routes
│ ├── models.py # Queue domain models + request schemas
│ ├── power.py # Cross-platform sleep prevention
│ ├── cli.py # CLI (check, dry-sweep, run, web, mesh, z-offset, stop, firmware-download)
│ └── static/index.html # Monochrome web studio
├── library/ # Optional shared .gcode library folder
├── queue/ / done/ # Folder-queue drop zones
├── docs/ # Logo + screenshots
├── tests/
├── FIRMWARE.md
├── Makefile
└── pyproject.toml
See FIRMWARE.md for open-source firmware upgrades (Custom Marlin v1.3.3 with Linear Advance & Klipper on HC32F460), microSD flashing steps, and M420 S1-aware Z-offset calibration.
uv run --with pytest pytest -vUse and modify freely for personal and workshop printing workflows. Contributions welcome via pull request.







