Stephan3 / dwc2-for-klipper

A translator between DWC2 and Klipper
GNU General Public License v3.0
160 stars 38 forks source link

DO NOT USE THIS ANYMORE!

This is only here for refference. please use:

Socket version


dwc2-for-klipper

A translator between DWC2 and Klipper

Alt text Alt text

What works

What is not working

Things you should know

Installation

Prerequisites

Python 2, Tornado, gunzip, unzip and wget.

On ArchLinux:

sudo pacman -Syu python2 python2-tornado wget gzip

Maybe you´ll need to change the startup system for Klipper to access ~/klipper/klippy/klippy.py.

On Debian-based systems such as Octopi or Ubuntu:

I asume here that you used the Octopi install script from Kevin's GitHub repository.

sudo apt install wget gzip tar

Then switch to your klipper user and:

sudo systemctl stop klipper
cd ~
mv klipper klipper_backup 
PYTHONDIR="${HOME}/klippy-env"
virtualenv ${PYTHONDIR}
${PYTHONDIR}/bin/pip install tornado==5.1.1

git clone https://github.com/KevinOConnor/klipper.git
git clone https://github.com/Stephan3/dwc2-for-klipper.git
ln -s ~/dwc2-for-klipper/web_dwc2.py ~/klipper/klippy/extras/web_dwc2.py

mkdir -p ~/sdcard/dwc2/web
mkdir -p ~/sdcard/sys
cd ~/sdcard/dwc2/web 
wget https://github.com/Duet3D/DuetWebControl/releases/download/3.1.1/DuetWebControl-SD.zip
unzip *.zip && for f_ in $(find . | grep '.gz');do gunzip ${f_};done
sudo systemctl start klipper

If you want backwards compatibility to DWC1:

cd ~/sdcard/dwc2/web 
wget https://github.com/chrishamm/DuetWebControl/releases/download/1.22.5/DuetWebControl-1.22.5.zip
unzip DuetWebContro*.zip
for f_ in $(find . | grep '.gz');do gunzip ${f_};done

Klipper config example:

[virtual_sdcard]
path: /home/pi/sdcard

[web_dwc2]
# optional - defaulting to Klipper
printer_name: Reiner Calmund
# optional - defaulting to 127.0.0.1
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