Skip to content
pdromntPublic

About

A somewhat decent web interface for your Creality K2 Plus.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

K2Dash logo

K2Dash

A local-first web dashboard for the Creality K2 Plus.

A cleaner alternative to the embedded dashboard—no cloud account or desktop app required.

Version 2.0.0 Vue.js TypeScript Vite Tailwind CSS 4 Pinia

Important

K2Dash is an unofficial community project built by reverse engineering CrealityPrint's local printer protocol. It is not affiliated with or supported by Creality.

Version 2.0 introduces a redesigned desktop and mobile workspace, explicit CFS print setup, and safe config-backup cleanup. See the changelog for the release notes.

What it does

  • Live print status — progress, layers, ETA, elapsed time, temperatures, fans, filament use, filename, and thumbnail.
  • CFS materials — physical slots and colors, material names, humidity, temperature, and explicit filament mapping before printing.
  • Live camera — WebRTC stream using the printer's native signaling service.
  • Printer controls — pause, resume, cancel, emergency stop, jog, homing, heaters, fans, and chamber light.
  • Safe utilities — filament load/unload, leveling, input shaping, belt and Z calibration, plus guarded PID calibration.
  • File management — upload, browse, rename, print, and delete G-code files.
  • Configuration editor — browse and edit printer configs; group timestamped backups separately and clean up older snapshots while keeping the latest.
  • G-code console — live responses, history, and the native Creality WebSocket transport.
  • History and timelapses — inspect and clean print history; view recordings in a modal, download, or delete timelapse videos.
  • Resilient connection — automatic WebSocket reconnection and clear offline/reconnecting states.

Potentially disruptive controls are disabled while a print is preparing, running, or paused. Maintenance operations also require confirmation where appropriate.

Workspace

Overview prioritizes the current job and camera while printing, and recent files while idle. Temperatures, materials, lights, and fans remain easy to reach. The other tabs are Files, Controls, Activity, and Console; mobile reflows the same information instead of squeezing the desktop columns.

Starting a print

Choose Print on a saved file to open setup. CFS is the safe default: review the file's used filaments and choose compatible physical slots. Unused slicer filaments are omitted when the printer explicitly reports zero usage. Missing requirements block CFS printing; they never silently select the external spool.

Choose External spool deliberately when using the spool holder. Starting another job is blocked while a print is active or a start request is pending.

CFS units are grouped by their reported hardware IDs, with independent temperature and humidity readings. Only units in the current native box list are shown; a connected unit with empty slots still appears. A global CFS disconnect clears the unit panels, and the external spool is shown separately. Print setup groups available slots by CFS and rejects mappings to removed units. Multi-unit behavior has fixture/test coverage, not a physical multi-CFS print validation.

Cleaning up config backups

Open Config → Clean up old backups. Timestamped printer-YYYYMMDD_HHMMSS.cfg snapshots are grouped in their own collapsible section.

Cleanup keeps the newest snapshot and protects backups referenced by config includes. It shows the exact deletion list and requires typing DELETE BACKUPS. Before deleting, it refreshes the list, rechecks references, and skips changed or protected files. It stops if the printer disconnects, a job starts, or a deletion fails; partial results are reported.

Cleanup is manual, never automatic after printing. It does not edit printer.cfg, run G-code, or restart the printer. Deleted backups cannot be restored through K2Dash.

Quick start

Requirements: Node.js 24+ (or 22.13+ on the 22.x line), npm, and a K2 Plus reachable on the same LAN.

git clone https://github.com/pdromnt/k2dash.git
cd k2dash
npm install
cp .env.example .env

Set VITE_PRINTER_HOST in .env, then start the development server:

npm run dev

Open http://localhost:5173.

Configuration

All connection settings live in .env. Only the printer host is normally required; the stock service ports are already supplied.

Variable Default Purpose
VITE_PRINTER_HOST (required) Printer IP address or mDNS hostname
VITE_API_PORT 7125 Moonraker REST API
VITE_WEBCAM_PORT 8000 Creality WebRTC signaling
VITE_UPLOAD_PORT 80 Creality file-upload endpoint

The native Creality WebSocket uses port 9999 and is derived automatically from VITE_PRINTER_HOST.

During development, Vite proxies printer traffic to avoid browser CORS restrictions. Production builds connect directly to the configured LAN services.

Deploy to the printer

Warning

Deployment uses root SSH access and modifies files under /mnt/UDISK. Read the script and understand the nginx change before proceeding. Firmware updates may restore Creality's original configuration.

The deploy command runs tests, type-checking, lint, and a production build before uploading:

npm run deploy

The deployer compensates for the K2's limited SSH server by using separate upload and activation sessions. It uploads to a temporary archive, extracts into a staging directory, verifies the build, and only then swaps it into /mnt/UDISK/k2dash. A failed upload or verification leaves the existing dashboard untouched.

The current script uses the stock K2 Plus SSH credentials:

user: root
password: creality_2024

Point nginx at K2Dash

This is a one-time setup. SSH into the printer:

ssh root@<printer-ip>

Back up and edit the nginx configuration:

cp /etc/nginx/nginx.conf /mnt/UDISK/nginx.conf.k2dash-backup
vim /etc/nginx/nginx.conf

Find the Fluidd root directive and change it:

# Before
root /usr/share/fluidd;

# After
root /mnt/UDISK/k2dash;

Save with :wq, then restart nginx:

/etc/rc.d/S80nginx restart

Open http://<printer-ip>:4408. Future npm run deploy runs replace only the K2Dash files; the deployer does not modify nginx.

PWA behavior

K2Dash can be installed from a compatible browser using Add to Home Screen or Install. The service worker uses network-first navigation and cache-first content-hashed assets (k2dash-v4), so new deployments appear on reload while the application shell remains available during temporary network loss.

Printer data and controls still require the printer to be reachable on the LAN; printer traffic is deliberately never cached.

Safe development previews

With the dev server running, open http://localhost:5173/?preview=idle. Other isolated fixtures are printing, paused, offline, empty, multi-cfs, spool-only, and empty-cfs. Preview mode blocks native commands, HTTP mutations, webcam signaling, and printer data requests. It is unavailable in production builds.

Preview config files include timestamped backups and a protected include so cleanup discovery and confirmation can be inspected without touching printer storage. Deletion remains blocked in preview; automated tests cover successful cleanup, failures, and interrupted operations.

Validation limits

CFS starts send native colorMatch followed by multiColorPrint, following CrealityPrint's protocol. Real native file metadata retrieval and compatible slot selection have been checked read-only on a K2 Plus.

Moonraker remains an explicit dependency for the existing file management, configuration editor, and history extension. There is no Moonraker fallback for telemetry, print lifecycle, G-code, lights, or emergency stop.

Development commands

Command Action
npm run dev Start the Vite development server
npm test Run the Vitest suite
npm run build Type-check and build for production
npx eslint src/ Lint application code
npm run preview Preview the production build locally
npm run deploy Test, validate, build, and atomically deploy to the printer

How it connects

K2Dash uses native Creality services for telemetry and controls, following CrealityPrint’s connection model:

  • Creality WebSocket (9999) for real-time state and printer commands.
  • Creality WebRTC signaling (8000) for the camera.
  • Creality HTTP upload service (80) for G-code uploads.
  • Moonraker (7125) for files, history, configuration (explicit extension features, never a fallback for controls).

Everything stays between your browser and printer on the local network.

Contributing

Run tests, build, and lint before submitting changes. Use isolated previews for destructive flows; do not treat a passed unit test or a successful deployment as proof of printer behavior. PRODUCT.md records product constraints and DESIGN.md records the visual system.


Released into the public domain under The Unlicense.

About

A somewhat decent web interface for your Creality K2 Plus.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages