Skip to content

Tigerspool for OpenCreator - #32

Closed
BastiMila wants to merge 11 commits into
TigerTag-Project:mainfrom
BastiMila:main
Closed

BastiMila wants to merge 11 commits into
TigerTag-Project:mainfrom
BastiMila:main

Conversation

@BastiMila

@BastiMila BastiMila commented Oct 30, 2026 •

Copy link
Copy Markdown

What this changes

Add a Klipper backend for AFC printers (draft)

Closes #31 (as far as OpenCreator / AFC printers go).

A PT_KLIPPER backend that talks to Moonraker over a WebSocket, the same
transport the Snapmaker backend uses (ws://<ip>:7125/websocket, no
authentication). It is written to fit the existing PrinterBackend interface and
changes nothing in it.

  • Reads the four AFC lanes extruder0..extruder3 as slots T0..T3: material,
    colour, remaining weight as a percentage, and the active tool.
  • Writes a scanned tag with one TT_SET_LANE call, then reads the lane back
    and reports confirmed, sent, not confirmed after 12 s, or Moonraker's own
    error text. This follows the comment on refresh() that an acknowledged
    command is not proof it landed.
  • Does not write while the printer is printing or paused.
  • Reuses the Snapmaker backend's WebSocket setup, including the empty Origin
    header that Moonraker's authorisation component needs.

The printer side is a small Klipper config, tigertag.cfg (two macros,
TT_SET_LANE and TT_LOAD). TT_SET_LANE calls AFC's SET_MATERIAL,
SET_COLOR and SET_WEIGHT, and keeps brand, variant, nozzle temperature and
tag id in save_variables, because AFC has no fields for them.

Files

File Change
src/backend_klipper.h, src/backend_klipper.cpp new backend
src/printer.h PT_KLIPPER = 7
src/printer_budget.h load slots for PT_KLIPPER
src/main.cpp #include, typeTag, ctrlPort, backend factory, link cost, brand name
src/tigertag_cloud.cpp "klipper" in BRANDS / BRAND_TYPE, mapType
src/webcfg.cpp "Klipper" in the brand list of the web page
klipper/tigertag.cfg printer-side macros
README.md new section

Testing

Fill in before marking ready. Do not tick what was not done.

  • pio run -e tigerspool builds without errors or new warnings
  • pio run -e tigerspool-bench builds
  • Flashed to a TigerSpool: the printer is listed and connects
  • The four slots show the lane data read from Moonraker
  • A scan writes material and colour to a lane, and the status shows confirmed
  • A refused command (for example a wrong lane name) shows Moonraker's message
  • Assigning during a print is refused
  • Other brands behave as before after the account import
  • Printer: FlashForge Creator 5 Pro, OpenCreator, AFC 1.2.8, Klipper with Moonraker
  • Spool firmware base: v1.72.0

Open points, where I would like a decision or a correction

  1. Lane layout. Only extruder0..extruder3 is handled. Printers with other
    AFC lane names or counts would need the lane list read from the AFC object.
  2. Weight. The remaining weight is sent only when the tag's unit label starts
    with g. The percentage shown is relative to AFC's own initial_weight,
    which this code does not set.
  3. Where the config lives. I put tigertag.cfg in klipper/. Move it if
    there is a better place.
  4. Patch scripts. I applied the small edits to main.cpp, tigertag_cloud.cpp
    and webcfg.cpp with scripts that are not part of this PR.

Notes

The backend and the macros were written with an AI assistant (Claude) from the
existing Snapmaker backend, the repository's architecture notes and the data a
real printer reports. They were reviewed and tested by me as listed above.

Checklist

  • One concern. A rename and a behaviour change in one diff cannot be reviewed.
  • English — comments, identifiers, log messages.
  • No credentials, keys or tokens added anywhere.
  • Any hardware constant carries a comment saying what breaks without it.
  • Docs updated if behaviour changed.
  • CHANGELOG.md updated for anything user-visible.

@BastiMila BastiMila closed this Nov 1, 2026
@BastiMila

Copy link
Copy Markdown
Author

I will push some updates next days and restart Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] No Klipper printer on Tiger Spool

1 participant