Skip to content

📦 Docker image for Danger Klipper with Simulavr, Moonraker, and mjpg-streamer

License

Notifications You must be signed in to change notification settings

pedrolamas/docker-danger-klipper-simulavr

Repository files navigation

docker-danger-klipper-simulavr

Project Maintenance License

Release

Follow pedrolamas on Twitter Follow pedrolamas on Mastodon

Simple Docker image running Danger Klipper with Simulavr, Moonraker, and mjpg-streamer.

This repo will run a GitHub action every hour to check for new code on the "master" branches of the Danger Klipper and Moonraker repositories, and creates a new Docker image if there are any modifications.

Usage

Create and run the new container as you would normally do:

docker run -d \
  --name danger-klipper-simulavr \
  --net=host \
  ei99070/docker-danger-klipper-simulavr

This will start Klipper with a simulated Atmel ATmega micro-controller, Moonraker on port 7125, and mjpg-streamer on port 8080.

If you need to remap the default ports, run the container under the bridge network instead:

docker run -d \
  --name danger-klipper-simulavr \
  -p 7125:7125 \
  -p 8080:8080 \
  ei99070/docker-danger-klipper-simulavr

The default configuration files used can be found on the klipper_config folder.

This is the runtime folder structure:

/printer
  /klipper
  /klippy-env
  /mjpg-streamer
  /moonraker
  /moonraker-env
  /printer_data
    /config
      /moonraker.conf
      /printer.cfg
    /database
    /gcodes
    /logs
      /klippy.log
      /moonraker.log
      /supervisord.log
    /moonraker.asvc
  /pysimulavr

Any of these files can be overrided by mapping the folder or the specific file.

For example, here is how to override the default printer.cfg:

docker run -d \
  --name danger-klipper-simulavr \
  --net=host \
  -v my-printer.cfg:/printer/printer_data/config/printer.cfg \
  ei99070/docker-danger-klipper-simulavr

Klippy Extras

Some Klipper extra modules are included as part of this image, specifically:

Convenience scripts

The image includes the following convenience scripts:

  • enable-timelapse - installs the Moonraker Timelapse dependencies, updates the configuration files, and restart Klipper and Moonraker
  • restore-klipper-repo - restores the Klipper git repository to the same point where the docker image was created
  • restore-moonraker-repo - restores the Moonraker git repository to the same point where the docker image was created

Once the Docker container has started, these can be easily run:

docker exec -it klipper-simulavr enable-timelapse

Available tags

  • latest: points to Danger Klipper and Moonraker "master" branches
  • klipper-sha-<hash>: points to the Danger Klipper GitHub commit hash
  • moonraker-sha-<hash>: points to the Moonraker GitHub commit hash

FAQ

I keep getting "MCU 'mcu' shutdown: Timer too close"

Start the container with SIMULAVR_PACING_RATE environment variable set to something like 0.2, like this:

docker run -d \
  --name klipper-simulavr \
  --net=host \
  -e SIMULAVR_PACING_RATE=0.2
  ei99070/docker-danger-klipper-simulavr

Support my work

A lot of time and effort goes into the development of this and other open-source projects.

If you find this project valuable, please consider supporting my work by making a donation.

Donate on Paypal Buy me a coffee Support me on Patreon Sponsor me on GitHub

Thank you for your generosity and support! 🙏

License

MIT