Skip to content

bnaya63/klipper-screen-vnc-postarketOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

KlipperScreen on a PostmarketOS phone - Configuration Manual

for some time I had a crealty ender 3 that had klipper installed. I wanted to use klipper screen insted of the trush blue lcd. I have a poco x3 phone that running PostmarketOS (https://postmarketos.org) so thoght way not to try using it as a screen. my goal was making the experiance as smooth as possible, so I`have tried to reduce the steps from power on to usable state.

The setup

printer

  1. a 3D printer running klipper with kiauh.
  2. setting Up klipperscreen with kiauh.
  3. installing vnc server on the printer
  4. create /home/user/KlipperScreen/scripts/launch_KlipperScreen.sh
  5. set up network settings

phone

  1. install pmOS stable with Xorg window manager - xfce, open box, etc..
  2. set up network settings
  3. set auto loggin tty
  4. set up startx

1. Setting Up Remmina with VNC

Description

This section covers how to configure Remmina to automatically connect to a VNC server and retry if disconnected.

Configuration

Create or modify ~/.xinitrc:

#!/bin/sh
exec startxfce4 & exec remmina -c vnc://user@172.16.42.2 --disable-news --disable-stats --disable-toolbar --enable-fullscreen

This ensures that Remmina starts with XFCE and automatically connects to the VNC server.


2. Rotating and Resizing the Display

Description

To ensure the display is correctly rotated and sized for VNC usage.

Configuration

Run the following command to set the correct resolution and rotation:

xrandr --output VNC-0 --mode 1080x2400 --rotate right

To make this change permanent, add it to a startup script or the VNC startup configuration.


3. Preventing Screen from Turning Off

Description

This prevents the screen from going into power-saving mode.

Configuration

Add the following command to the startup script:

xset s off -dpms

This disables screen blanking and power management.


4. Auto Shutdown on Network Disconnection

Description

Automatically powers off the system if usb0 network interface loses connectivity.

Script

Create a script at /usr/local/bin/usb0-shutdown.sh:

#!/bin/sh
while true; do
    if ! ping -c 1 172.16.42.2 >/dev/null 2>&1; then
        echo "Network lost, shutting down..."
        poweroff
    fi
    sleep 5
done

Make the script executable:

chmod +x /usr/local/bin/usb0-shutdown.sh

Create an OpenRC service at /etc/init.d/usb0-shutdown:

#!/sbin/openrc-run
depend() {
    need net
}

start() {
    /usr/local/bin/usb0-shutdown.sh &
}

stop() {
    pkill -f usb0-shutdown.sh
}

Enable and start the service:

chmod +x /etc/init.d/usb0-shutdown
rc-update add usb0-shutdown default
rc-service usb0-shutdown start

5. Configurations on the Printer

Description

This section details the VNC setup and display configuration on the printer.

Configuration

Modify the VNC startup script:

#!/bin/bash
# Use display 10 to avoid clashing with local X server, if any
Xtigervnc -rfbport 5900 -noreset -AlwaysShared -SecurityTypes none :10&
DISPLAY=:10 $KS_XCLIENT&
wait

Ensure the correct resolution and rotation are applied:

xrandr --output VNC-0 --mode 1080x2400 --rotate right

This manual serves as a reference for configuring the system with these customizations. Let me know if anything needs to be added or changed!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors