[Teil 2] Spoolman – Klipper Installation

English below:

Die Installation von Spoolman auf dem Raspberry (oder MKS-Mainboard), wo Klipper drauf läuft ist so simpel wie so viele andere Klipper-Plugins – es wird lediglich ein auf Debian basiertes Image vorrausgesetzt.

sudo apt-get update && \
sudo apt-get install -y curl jq && \
mkdir -p ./Spoolman && \
source_url=$(curl -s https://api.github.com/repos/Donkie/Spoolman/releases/latest | jq -r '.assets[] | select(.name == "spoolman.zip").browser_download_url') && \
curl -sSL $source_url -o temp.zip && unzip temp.zip -d ./Spoolman && rm temp.zip && \
cd ./Spoolman && \
bash ./scripts/install_debian.sh

So wird es zumindest in der Anleitung beschrieben.

Ich hingegen habe ich mich dazu entschlossen Spoolman auf einem anderen Host mit Hilfe von Docker zu installieren, da ich eh eine VM in meinem Netzwerk habe, die diverse Docker-Container bereit stellt.

Ich wiederhole einfach nur noch schnell einmal die Grundinstalltion, wie ich sie auch schon im Teil 1 von der Spoolman-Anleitung beschrieben habe.

Die entsprechende docker-compose.yml sieht dann in etwa so aus:

version: '3.8'
services:
  spoolman:
    image: ghcr.io/donkie/spoolman:latest
    restart: always
    volumes:
      # Mount the host machine's ./data directory into the container's /home/app/.local/share/spoolman directory
      - type: bind
        source: ./data # This is where the data will be stored locally. Could also be set to for example `source: /home/pi/printer_data/spoolman`.
        target: /home/app/.local/share/spoolman # Do NOT change this line
    ports:
      # Map the host machine's port 7912 to the container's port 8000
      - "7912:8000"
    environment:
      - TZ=Europe/Berlin# Optional, defaults to UTC

Wenn man also den Container installiert und am Laufen hat, dann reicht eine einfache Änderung der moonraker.conf in Klipper um Spoolman hinzuzufügen:

# moonraker.conf

[spoolman]
server: http://192.168.10.123:7912
#   URL to the Spoolman instance. This parameter must be provided.
sync_rate: 5
#   The interval, in seconds, between sync requests with the
#   Spoolman server.  The default is 5.

Und in die printer.cfg wird dann noch folgendes ergänzt:

# printer.cfg

[gcode_macro SET_ACTIVE_SPOOL]
gcode:
  {% if params.ID %}
    {% set id = params.ID|int %}
    {action_call_remote_method(
       "spoolman_set_active_spool",
       spool_id=id
    )}
  {% else %}
    {action_respond_info("Parameter 'ID' is required")}
  {% endif %}

[gcode_macro CLEAR_ACTIVE_SPOOL]
gcode:
  {action_call_remote_method(
    "spoolman_set_active_spool",
    spool_id=None
  )}

Und das war es schon – nach einem Neustart von Klipper sieht es dann so aus:

Es gibt sogar eine Integration in Home Assistant um sich dort auch die Spulen anzeigen zu lassen.

Die Einrichtung ist relativ einfach und quasi selbsterklärend.
Hier gibt es die entsprechenden Infos: Home Assistant Spoolman

PS: Damit man auch die QR Codes, die man mit Spoolmann erstellt und ausgedruckt hat lesen kann, braucht es zwingend eine https-Verbindung zu Spoolman. Das ist seitens der Browserhersteller wie Mozilla oder Google so vorgegeben.

Ich habe das ganz einfach per Nginx Proxy Manager gelöst in dem ich eine neue Subdomain angelegt habe und diese dann per Letsencrypt mit einem SSL-Zertifikat ausgestattet habe.
Aber nun ist Spoolman offen aus dem Internet erreichbar?
Ja, aber mit Hilfe einer Access List (z.B. local-only) im Nginx Proxy Manager und der entsprechenden Einstellung bei der Subdomain, dass diese Access List benutzt werden soll, habe ich so eine HTTP-Auth Passwortabfrage eingerichtet und nur Personen mit entsprechendem Passwort kommen an das Webinterface von Spoolman.

@maxheadroom hat das aber auch irgendwie in seinem Traefik-Container lösen können und schreibt hier darüber: Klick

English version:

The installation of Spoolman on the Raspberry Pi (or MKS mainboard) running Klipper is as simple as so many other Klipper plugins – it only requires a Debian based system.

sudo apt-get update && \
sudo apt-get install -y curl jq && \
mkdir -p ./Spoolman && \
source_url=$(curl -s https://api.github.com/repos/Donkie/Spoolman/releases/latest | jq -r '.assets[] | select(.name == "spoolman.zip").browser_download_url') && \
curl -sSL $source_url -o temp.zip && unzip temp.zip -d ./Spoolman && rm temp.zip && \
cd ./Spoolman && \
bash ./scripts/install_debian.sh

At least that’s how it’s described in the instructions.

However, I decided to install Spoolman on another host using Docker, as I already have a VM in my network that provides various Docker containers.

I’ll just quickly repeat the basic installation as I described in part 1 of the Spoolman guide.

The corresponding docker-compose.yml then looks something like this:

version: '3.8'
services:
  spoolman:
    image: ghcr.io/donkie/spoolman:latest
    restart: always
    volumes:
      # Mount the host machine's ./data directory into the container's /home/app/.local/share/spoolman directory
      - type: bind
        source: ./data # This is where the data will be stored locally. Could also be set to for example `source: /home/pi/printer_data/spoolman`.
        target: /home/app/.local/share/spoolman # Do NOT change this line
    ports:
      # Map the host machine's port 7912 to the container's port 8000
      - "7912:8000"
    environment:
      - TZ=Europe/Berlin# Optional, defaults to UTC

So if you have the container installed and running, a simple change to moonraker.conf in Klipper is enough to add Spoolman:

# moonraker.conf

[spoolman]
server: http://192.168.10.123:7912
#   URL to the Spoolman instance. This parameter must be provided.
sync_rate: 5
#   The interval, in seconds, between sync requests with the
#   Spoolman server.  The default is 5.

And the following is then added to printer.cfg:

# printer.cfg

[gcode_macro SET_ACTIVE_SPOOL]
gcode:
  {% if params.ID %}
    {% set id = params.ID|int %}
    {action_call_remote_method(
       "spoolman_set_active_spool",
       spool_id=id
    )}
  {% else %}
    {action_respond_info("Parameter 'ID' is required")}
  {% endif %}

[gcode_macro CLEAR_ACTIVE_SPOOL]
gcode:
  {action_call_remote_method(
    "spoolman_set_active_spool",
    spool_id=None
  )}

And that’s it – after restarting Klipper, it looks like this:

There is even an integration in Home Assistant to display the reels there too.

The setup is relatively simple and virtually self-explanatory.
You can find the relevant information here: Home Assistant Spoolman

PS: In order to be able to read the QR codes that you have created and printed with Spoolman, an https connection to Spoolman is required. This is specified by browser manufacturers such as Mozilla or Google.

I solved this quite simply using Nginx Proxy Manager by creating a new subdomain and then equipping it with an SSL certificate using Letsencrypt.
But now Spoolman is openly accessible from the Internet?
Yes, but with the help of an access list (e.g. local-only) in the Nginx Proxy Manager and the corresponding setting in the subdomain that this access list should be used, I have set up an HTTP-Auth password query and only people with the corresponding password can access the Spoolman web interface.

However, @maxheadroom has also been able to solve this somehow in his Traefik container and writes about it here: Click

One thought on “[Teil 2] Spoolman – Klipper Installation”

Leave a Reply

Your email address will not be published. Required fields are marked *