printlog-bridge
printlog-bridge is a small open-source program that watches your Klipper printers through Moonraker and logs every print to 3D Print Log by itself. You don't type anything in, and you don't have to edit the printer's configuration by hand.
It runs either on the printer's own host or in a Docker container on another computer on your network, and one bridge can watch several printers. It also watches Bambu Lab, Prusa, OctoPrint, Elegoo Centauri Carbon, Duet, FlashForge and Anycubic printers over your network: see Supported printers. The source is on GitHub under the MIT license: HoffmanEngineering/printlog-bridge. For a short overview to share, see Automatic print logging for Klipper.
The bridge is new
If something doesn't work the way this page says, troubleshooting explains how to send a report.
Supported printers
| Printer | How the bridge reads it | Filament usage | Guide |
|---|---|---|---|
| Klipper with Moonraker (Voron, Snapmaker U1, Creality and others running Klipper) | Moonraker, on the printer or over the network | What Klipper measured, per tool | Install on the printer or run it in Docker |
| Bambu Lab X1, P1, A1, H2 | The printer's LAN connection (LAN Only Mode and Developer Mode) | The slicer's estimate per AMS tray | Bambu Lab printers |
| Prusa MK4/MK4S, MK3.5/3.9, Core One, MINI, XL | PrusaLink, built into the firmware | The slicer's estimate per tool | Prusa printers (PrusaLink) |
| Printers run by OctoPrint (an OctoPi, or OctoPrint on any computer) | OctoPrint's API, over the network | The slicer's estimate per tool | OctoPrint |
| Elegoo Centauri Carbon | SDCP, the printer's local protocol | The slicer's estimate | Elegoo Centauri Carbon (SDCP) |
| Duet 2 and Duet 3 boards running RepRapFirmware (Railcore, E3D ToolChanger, Jubilee and custom builds) | The HTTP API Duet Web Control uses, standalone or with a Raspberry Pi | What RepRapFirmware measured, per tool | Duet / RepRapFirmware |
| FlashForge Adventurer 5M, 5M Pro, AD5X | The printer's LAN API (LAN-only mode) | The slicer's estimate, per IFS slot on an AD5X | FlashForge |
| Anycubic Kobra S1, Kobra 3, Photon P1 Max (resin) | The printer's LAN mode | What the printer reports, marked estimated: filament, or resin in mL | Anycubic (LAN mode) |
The Bambu, PrusaLink, Elegoo, Duet and FlashForge adapters are new: they're built from the printers' documented protocols and haven't been checked on real printers yet. The Anycubic adapter has been checked on an idle Kobra S1, not yet through a print. A Duet measures the filament each tool feeds, as Klipper does. The other printers don't, and neither does OctoPrint, so their usage is an estimate, marked with a * on the print and left out of the accuracy stats. Elegoo's resin printers and other brands are planned.
A paired bridge also finds the printers on its network and lists them on the Bridges screen, where you connect them to 3D Print Log with no config file to edit: see Bridges and printers found on your network. It never logs a printer you haven't connected. To set a printer up in the config file instead, the printer's Edit Page shows the steps and a config section for its type under Connections, with its number filled in.
In this guide
- Install on the printer (local mode): run the bridge as a service on the printer's own host and connect it to your account.
- Run it in Docker (remote mode): one container on a NAS, home server or Pi watches your printers over the network.
- Bridges and printers found on your network: see each bridge's health, connect the printers it found in the app, and add others by address.
- Bambu Lab printers: log an X1, P1, A1 or H2 over its LAN connection, with grams per AMS tray.
- Prusa printers (PrusaLink): log an MK4, MK3.5, Core One, MINI or XL through PrusaLink, with the slicer's estimate per tool.
- OctoPrint: log a printer run by an OctoPi or any OctoPrint server, with the slicer's estimate per tool and a webcam snapshot.
- Elegoo Centauri Carbon (SDCP): log a Centauri Carbon over its local protocol, with the slicer's filament estimate.
- Duet / RepRapFirmware: log a Duet 2 or Duet 3, standalone or with a Raspberry Pi, with the filament each tool measured.
- FlashForge: log an Adventurer 5M, 5M Pro or AD5X over its LAN API, with the slicer's estimate per IFS slot.
- Anycubic (LAN mode): log a Kobra S1, Kobra 3 or Photon P1 Max in LAN mode, with filament or resin in mL.
- Assign spools with PRINTLOG_SET_SPOOL: tell 3D Print Log which spool is in each tool from Klipper's console or a macro.
- Snapmaker U1: filament per tool on all four tools, with spools assigned from their RFID tags.
- Troubleshooting: the
doctorandstatuscommands, logs, traces and common problems. - Privacy and security: every connection the bridge makes, what it sends, and how it keeps your key.
- Switch from the Moonraker notifier: move a printer from the notifier to the bridge, and how the two run side by side.
- Switch from the OctoPrint webhook: set the bridge up for a printer run by OctoPrint, then turn off the Webhooks plugin's 3D Print Log hook.
- Connect Klipper via Spoolman: your 3D Print Log spools in the Mainsail, Fluidd and KlipperScreen spool pickers, with nothing to install.
- Moonraker notifier (legacy): the older way to log Klipper prints, for printers that still use it.
What it logs
When a print starts, a new print appears on your Print List with the status Printing. Its title comes from the file name, and it carries the slicer's estimated print time and filament when the file has them. The largest thumbnail the slicer embedded in the file (OrcaSlicer, PrusaSlicer, Cura and SuperSlicer all embed one) becomes its picture. Shortly after, the print gets the slicer and its version, and the slicer settings it was sliced with in its notes.
When the print ends, the bridge records the outcome, the print time and the filament Klipper actually fed, and adds one frame from the printer's webcam. For a failed print, that frame becomes the picture shown.
| Moonraker ends the job as | The print becomes | Note added to the print |
|---|---|---|
completed | Success | |
cancelled | Cancelled | |
error | Failed | "Klipper error", with Klipper's message when the bridge saw it |
klippy_shutdown | Failed | "Klipper shutdown" |
klippy_disconnect | Failed | "Lost connection to Klipper" |
interrupted, server_exit | Failed | "Moonraker stopped during the print" |
Each tool's filament is linked to a spool. The bridge links each tool's usage to the material loaded in that tool's slot in 3D Print Log, so your inventory stays current. You can load spools in the app, or assign them from the printer's console with the spool macros.
What you change in the app while it prints is kept: the title, your notes (the bridge adds its note after them), the spool on a usage row, and a status you already chose, such as Partial Success. A print you delete stays deleted.
Nothing is lost while 3D Print Log is out of reach. The bridge writes each event to an outbox on disk before sending it, and sends it once the connection is back, oldest first, even if the bridge was restarted in between. When the bridge itself was stopped, it catches up on jobs that started or ended while it was away. On its very first run it picks up a print that is already running, but not older history.
Slicer settings
Each print records the settings it was sliced with, as the Slic3r uploader and the Cura plugin do. Once a print starts, the bridge sends the settings the slicer wrote into the file, along with the summary Moonraker read from it (slicer, layer heights, nozzle, filament name and type, first layer temperatures). In 3D Print Log:
- the print's Slicer and slicer version are filled in;
- a Slicer settings section is added to the end of its notes, between
--- Slicer settings (…) ---and--- End of slicer settings ---. If the settings are sent again, that section is replaced, not added twice, and the notes you wrote are kept.
It is on by default. To turn it off, set slicer_settings = false in [bridge] for every printer, or in a printer's section for just that one; the bridge then never reads the G-code file.
Good to know:
- Only the settings are read, never the toolpaths, and the file is never uploaded. Hosts, API keys, passwords and other credentials are blanked before anything leaves the printer. Privacy and security lists exactly what is read and sent.
- OrcaSlicer, PrusaSlicer, Anycubic Slicer Next and their forks write the full settings block the bridge reads. Bambu Studio and FLSun Slicer put their settings near the top of the file, so for their prints only Moonraker's summary is recorded today.
- The uploader's and the plugin's settings win. When the bridge logs a job to a print you already made with the Slic3r uploader or the Cura plugin, that print keeps the richer settings they recorded, and the bridge doesn't send its own.
Printers with more than one tool
On a toolchanger, an IDEX printer or a Snapmaker U1, each tool gets its own usage row, numbered from 0 the way Klipper numbers its extruders (extruder is T0, extruder1 is T1). The bridge follows which extruder is active while Klipper's filament count grows, so the rows add up to the job's total. When the slicer listed a weight per filament (PrusaSlicer, OrcaSlicer, Snapmaker Orca), the print starts with an estimate on each tool's row.
With Spoolman
If the printer's [spoolman] section points at 3D Print Log (the block from Connect Spoolman), the bridge keeps Moonraker's active spool and the spools in 3D Print Log's slots in sync both ways. A spool picked on the printer is loaded into the active tool's slot. A spool loaded in the app, with PRINTLOG_SET_SPOOL or by the U1's RFID reader becomes Moonraker's active spool when that tool is active. The bridge also sets the active spool on each tool change. If [spoolman] points at another server, the bridge leaves it alone. While the bridge runs for a printer, the block's notifier is ignored, so prints aren't logged twice.
Not covered yet:
- A multi-material unit feeding one extruder (ERCF, Happy Hare, AFC). Everything is counted on T0.
- IDEX copy or mirror mode, where Klipper counts what two heads print only once.
Local mode and remote mode
The bridge talks to Moonraker, so it can run anywhere Moonraker can be reached.
| Local mode | Remote mode | |
|---|---|---|
| Runs on | The printer's own host (MainsailOS, FluiddPi, any Klipper install with Moonraker) | Any computer on your network: a NAS, a home server, a Raspberry Pi |
| Talks to Moonraker over | Its local socket | Its WebSocket, at the printer's address |
| Installed with | install.sh, as a systemd service | The Docker image |
| Updates | From the update panel in Mainsail or Fluidd | By pulling the image again |
| Spool macros | Installed for you | Copied to the printer by hand, where the printer allows it |
| Best for | Printers you can install software on | Printers you can't, such as the Snapmaker U1, and watching several printers from one place |
Moonraker accepts one bridge per printer, so pick one mode for each printer. A second bridge waits until the first one stops.
Requirements
- A printer running Klipper and Moonraker, with Moonraker's job history (
[history]inmoonraker.conf). Most installs have it already, and the bridge tells you when it's missing. - A 3D Print Log account, with the printer added on the Printers page.
- A way for the bridge to sign in: pairing it with your phone, or a personal API key.
- Local mode: Python 3.9 or newer on the printer's host (Raspberry Pi OS Bullseye or later), and a user that can use
sudoto install the service. - Remote mode: Docker on a computer that is always on. The image is built for
linux/amd64,linux/arm64andlinux/arm/v7.
Signing in
Pair the bridge with your account: run printlog-bridge pair on the computer it runs on. In Docker, a container started without a key pairs by itself, in its log. The bridge shows a QR code, an address and a short code. Scan the QR code with your phone, or open the address and type the code, then sign in to 3D Print Log and approve the bridge. There's nothing to copy: the bridge keeps its own device token, which works only for what the bridge does (logging prints, its printers' spools and its heartbeat), not for the rest of your account. For each printer in its config without a printer_id, pair also lets you pick the printer in 3D Print Log, or create it.
Each paired bridge is listed under Paired devices in the Connected Agents section of Settings, with when it was paired, when it was last used and what it may do. Revoke one you no longer use, or one you've lost track of: it stops logging prints at once. Prints it finishes after that wait on the bridge, which says re-pair needed in its log, status and doctor. Run printlog-bridge pair again and it logs them and carries on. Pairing the same bridge again replaces its token instead of adding a second entry.
With two or more paired, Revoke all devices revokes every one at once, for example after you lose track of where they run. Their bridges and the printers connected to them on the Bridges screen are removed too, and your past prints are kept. Pair each bridge again to bring it back.
Instead of pairing, the bridge can sign in with a personal API key, which you create on the Personal API Keys page and store with printlog-bridge store-key. Use one for a scripted install, or when pair says pairing isn't available. Each install page's Connect to your account section has the steps for both.
Already using the Moonraker notifier?
If the printer still sends prints through the Moonraker notifier, 3D Print Log logs each print only once, from the bridge, and shows a banner suggesting you remove the notifier. Switch from the notifier has the steps and the exact rule.
Once it runs
Once the bridge runs, the printer's Edit Page lists it under Connections as printlog-bridge (voron), with the name you gave the printer in the bridge's config. It checks in every 5 minutes, and the app shows it as Stale after 15 minutes without hearing from it.
Update
The bridge tells you when a newer version is out. 3D Print Log answers each check-in with the latest version, so the bridge asks nobody else. When yours is older:
- the printer's Connections say printlog-bridge 0.2.0 is available (with the new version);
- the bridge writes
printlog-bridge 0.2.0 is available (this is 0.1.0)in its log, once for each new version; printlog-bridge statusshows anUpdate:line, andprintlog-bridge doctora warning.
To update:
- In Docker: in the folder with
docker-compose.yml, rundocker compose pull, thendocker compose up -d. Your config and everything in/datastay as they are. See Run it in Docker. - On the printer: update printlog-bridge in the update panel of Mainsail or Fluidd, next to Klipper and Moonraker. See Install it on the printer.
To stop the notice in the bridge's log, status and doctor, set update_check = false in [bridge]. The bridge sends the same check-in either way.