Skip to content

Docker image for running DWC2 and Klipper 3D Printer controller software

License

Notifications You must be signed in to change notification settings

stevenvo/dwc2-klipper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dwc2-klipper

Credit

This is a branch from seanauff dwc2-klipper repo (credit to seanauff).

The change is for my personal use to support multipler printers from a single Raspberry Pi.

Context

dwc2-klipper is a Docker image for running [DWC2] and [Klipper] for 3d Printing controllers. It is designed to run on Raspberry Pi or similar.

Referencs:

Pre-requisites

Ensure docker and docker-compose are installed on your host. Some references:

Prepare your printer.cfg file

Add DWC2 config

Assuming you already have a klipper printer.cfg file, add these lines into each of your printer.cfg files.

[virtual_sdcard]
path: /home/dwc2-klipper/sdcard

[web_dwc2]
## optional - defaulting to Klipper
printer_name: Klipper
# optional - defaulting to 0.0.0.0
listen_adress: 0.0.0.0
# needed - use above 1024 as nonroot
listen_port: 4750
# optional defaulting to dwc2/web. Its a folder relative to your virtual sdcard.
web_path: dwc2/web

Where to place your printer.cfg files

For each printer config file. place the printer.cfg file into a separate folder on your host (Raspberry Pi). You can rename the folder to your printer name, for example:

$ ls -lsh
4.0K drwxr-xr-x 2 pi pi 4.0K May 16 11:44 cr10s-klipper-printer.cfg
4.0K drwxr-xr-x 2 pi pi 4.0K May 16 11:34 ender3-klipper-printer.cfg
4.0K drwxr-xr-x 2 pi pi 4.0K May 16 11:35 kossel-klipper-printer.cfg

As above, cr10s-klipper-printer.cfg is a folder on host, it containers a printer.cfg file. This folder will be shared to the corresponding container. This is configured in volume section in docker-compose.yaml. Feel free to change the folder name, just needs to ensure same name is updated into docker-compose.yaml.

Why do this? This folder structure will resolve the save_config error due to Klipper unable to rename the printer.cfg to the backup config file (klipper code) due to lack of permission.

docker-compose.yaml

To add/edit/remove printers, update your docker-compose.yaml file using your text edit, notice there are 3 sections like below:

  dwc2-klipper-cr10s:
    image: "stevenvo/dwc2-klipper:arm"
    container_name: cr10s
    privileged: true
    ports:
      - "4750:4750"
    volumes:
      - "/home/pi/cr10s-klipper-printer.cfg:/home/dwc2-klipper/config"
    environment:
      TZ: America/Los_Angeles
    restart: unless-stopped

Each of that section is used for creating a docker container for each of your printer.

  • service name (dwc2-klipper-cr10s): any name you like
  • container_name: any printer name you like
  • volumes
    • path before :: the folder containing the printer.cfg file on your host.
    • path after :: the folder containing printer.cfg file on your container.

Spin up the container

On host (Raspberry Pi), execute docker-compose up -d

To ssh into the container from host, execute docker exec -it cr10s /bin/bash (change cr10s to the container name defined in docker-compose.yaml)

About

Docker image for running DWC2 and Klipper 3D Printer controller software

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 69.8%
  • Python 30.2%