Skip to content

freakydude/klipper-touch

Repository files navigation

Klipper-Touch

Klipper-Touch is an alternative web-based UI for Klipper3d/Moonraker that focuses on small touch screens without keyboard or mouse.

This is currently nothing more than a personal experiment and a project to learn - even if it works.

Caution

First of all, and as always with my other posts and projects. I am not a company. I'm doing this in my spare time and mostly because I'm really excited about making these things work and improving them.

I have tested all this stuff only with my own printer and the constellation around it. I have done my best to make it all work without problems. However, this is a work in progress. There is no guarantee. Be careful, watch your printer, double check things. Use it as is. I am not responsible for any damage or consequences of any kind.

And yes, help and improve if you find something.

Some early screens

Connect Screen

Printing Screen

Print Done Screen

Temperature Screen

Prepare Bigtreetech CB1

  • Install Btt image with panfrost support. >= v 2.3.3

  • Update to debian bookworm

  • sudo nano /etc/apt/sources.list

    replace bullseye by bookworm, add non-free-firmware to all entries

    deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    
    # deb-src <http://deb.debian.org/debian> bookworm main contrib non-free non-free-firmware
    
    deb < http://deb.debian.org/debian > bookworm-updates main contrib non-free non-free-firmware
    # deb-src <http://deb.debian.org/debian> bookworm-updates main contrib non-free non-free-firmware
    
    deb < http://deb.debian.org/debian > bookworm-backports main contrib non-free non-free-firmware
    # deb-src <http://deb.debian.org/debian> bookworm-backports main contrib non-free non-free-firmware
    
    deb < http://deb.debian.org/debian-security > bookworm-security main contrib non-free non-free-firmware
    # deb-src <http://deb.debian.org/debian-security> bookworm-security main contrib non-free non-free-firmware
  • Upgrade system from bullseye to bookworm

    sudo apt update
    sudo apt dist-upgrade
    sudo apt autoremove
  • Install xinit and input drivers sudo apt install xinit xf86-input-evdev

Install and run Klipper-Touch

  • Download it from https://github.com/freakydude/klipper-touch/releases

  • Install Klipper-Touch

    • Go to your manual downloaded package directory and run

      sudo apt install ./klipper-touch_0.1.0_arm64.deb
  • Configure your cors_domains in moonraker.conf to allow Klipper-Touch to access the moonraker apis

  • Run Klipper-Touch

    • exclusive: /usr/bin/startx /usr/bin/klipper-touch -- -nocursor or
    • in a window manager: /usr/bin/klipper-touch
  • Klipper-Touch listen on url: http://127.0.0.1/ and ws://127.0.0.1/websocket for a moonraker api connection.

    • To use another url, use the commandline parameters

      -m <Moonraker-HTTP-URL>  eg. `http://192.168.1.1/`
      -w <Moonraker-Websocket-URL>  eg. `ws://192.168.1.1/websocket`
    • To start in fullscreen mode

      -f
  • Run standalone without xinit and window manager

    /usr/bin/startx /usr/bin/klipper-touch -f -- -nocursor
  • Run standalone with wayland and cage. On rpi4, disable dma buffer renderer for webkit to avoid black screen issues. This is a workaround and should be fixed in the future.

    • install cage

      sudo apt install cage
    • run with wayland and cage

      export WEBKIT_DISABLE_DMABUF_RENDERER=1
      export GDK_BACKEND=wayland
      
      cage -- klipper-touch -f             

Development

Prequisities

Install dependencies on ArchLinux / WSL2 ArchLinux

  • Install docker and docker-compose

    pacman -S docker docker-compose
  • Install rust (if skipped before)

    pacman -S rustup
    rustup default stable

Run or Build project local

  • Install dependencies in the project root folder with

    npm install && npm install --save-dev @tauri-apps/cli
  • Run:

    npm run tauri dev

    or with custom moonraker urls

    npm run tauri dev -- -- -- -m "http://<moonraker-ip>" -w "ws://<moonraker-ip>/websocket"

    or configure your config.json in the local storage folder (e.g. ~/.config/klipper-touch/config.json) with or on windows in %APPDATA%\klipper-touch\config.json with

    {
      "fullscreen": false,
      "moonrakerApi": "http://<moonraker-ip>",
      "moonrakerWs": "ws://<moonraker-ip>/websocket"
    }

    and run without parameters

    npm run tauri dev

    or with fullscreen mode

    npm run tauri dev -- -- -- -f
  • Build:

    npm run tauri build

CrossCompile with docker

  • CrossCompile:

    pacman -S qemu-user-static docker-buildx
  • Build debian bullseye arm32v7 package (RPi 32 bit)

    docker compose up klipper-touch_build_arm32v7
  • Build debian bullseye arm64v8 package (RPi 64 bit)

    docker compose up klipper-touch_build_arm64v8

Final words

Feel free to create pull requests and discussions. I can't solve anything alone.

Have fun!

If you like, buy me a coffee

ko-fi

freakyDude

About

Klipper-Touch is an alternative web-based UI for Klipper3d/Moonraker that focuses on small touch screens without keyboard or mouse.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

Contributors