Skip to content

About

ForgeQueue — continuous Marlin print queue, auto cooldown & push-off ejector, and monochrome live 3D web dashboard for Anycubic Kobra Neo (Windows/Linux/macOS)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

ForgeQueue

ForgeQueue

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 3.10+ FastAPI & WebSocket pyserial CH340 Marlin USB 115200 Windows Linux macOS Black / White UI pytest uv

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).

Dashboard in Pure Black Mode


Key Features

  • 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, automatic Resend: replay, echo:busy: keepalive handling, and 600s timeouts for G28/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 polls M105 until bed <= eject_temp (default 28°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).
  • Safe Manual-Clear Gate (Bed Cleared):
    • When Require "Bed Cleared" Gate is enabled, the printer presents the bed forward (G1 Y215), double-beeps (M300), displays M117 Remove part!, and pauses the queue until you confirm the plate is clear.
  • Pure Monochrome Web Studio (Follows System Dark/Light + SYS / BLK / WHT Toggle):
    • Interactive 3D G-Code Toolpath Visualizer: Perspective 3D canvas with live nozzle cone, Iso / Top / Front / Fit presets, + / − 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 Advance K (M900), and BabyStepping (M290 + M500).
    • Calibration Suite: 5×5 Bed Leveling Mesh Heatmap (M420 V), one-click G29 Auto-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 .gcode uploads, drag-to-reorder queue, and history re-queue.
  • 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).

Screenshots

Pure Monochrome Theme — Black (BLK) & White (WHT)

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)
Dashboard Dark Dashboard Light

Interactive 3D Toolpath Visualizer & Motion / Z-Offset Control

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).

3D Toolpath Visualizer and Motion Controls

Continuous Print Queue & Automation Rules

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.

Print Queue and Automation Controls

Calibration — 5×5 Bed Mesh (M420 V), Paper-Test Wizard & Maintenance

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.

Calibration View with 5x5 Bed Mesh and Paper-Test Wizard

File Library & Live G-Code Serial Console

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
File Library G-Code Console

Mobile Responsive UI

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.

Mobile Responsive Dashboard and 3D Toolpath


Quick Start

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 web

Open 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.


Makefile Commands

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

CLI Usage (Without make)

# 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-connect

kobra-queue remains as a compatibility alias for the same CLI entry point.


Architecture & Project Structure

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

Firmware & Calibration

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.


Testing

uv run --with pytest pytest -v

License

Use and modify freely for personal and workshop printing workflows. Contributions welcome via pull request.

About

ForgeQueue — continuous Marlin print queue, auto cooldown & push-off ejector, and monochrome live 3D web dashboard for Anycubic Kobra Neo (Windows/Linux/macOS)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages