User Tools

Site Tools


rebuilding

This is an old revision of the document!


Sovol KlipperScreen

Rebuilding

Sovol's KlipperScreen is running on debian buster, which is outdated now, meaning you can no longer update system packages like ssh, etc.

The default armbian kernels do not work, e.g. the screen will stay black (no /dev/spidev*.* gets created).

There are recent images provided by Maxim Medvedev (redrathnure) on github, which can be used as a base:
https://github.com/redrathnure/armbian-mkspi
These images do not support the KLIPAD50's internal wifi out of the box, so you would either have to replace a devicetree file (see bottom of the page) or use external USB-wifi(*) or USB-ethernet adapters. But the screen is working and spidev is available. It's spidev0.2 instead of spidev0.0, so adjust your printer.cfg accordingly.
(*) These adapters may require additional firmwares. You can try to install them with sudo apt update ; sudo apt install firmware-misc-nonfree if yours is not detected automatically. On the other hand, this specific firmware package can break the internal wifi, even with the replaced dtb file.

Steps to set up:

Base system

  1. Reboot the device and connect a keyboard (or use an USB-cable for a serial connection)
  2. Create root password
    • freely choose your own
  3. Choose default system command shell
    • if unsure, choose “1” (bash)
  4. Please provide a username
    • use “mks” if you want to stay compatible with makerbase services
  5. Create user (mks) password
    • freely choose your own
  6. Set user language based on your location?
    • if unsure, choose “Y”
    • otherwise, choose the setting according to your location/needs

Klipper

  1. Log into device using ssh, putty or serial connection
  2. cd into home dir:
    cd
  3. install KIAUH:
    git clone https://github.com/dw-0/kiauh
  4. start KIAUH:
    cd kiauh ; ./kiauh.sh
  5. install klipper components (that's mostly pressing “1” or <ENTER>):
  6. choose “Install” (1)
  7. enter your password
  8. choose “Klipper” (1)
    1. choose “Python 3.x” (1)
    2. choose number of instances (1)
    3. wait for install to finish
  9. choose “Moonraker” (2)
    1. confirm with “Y” or <ENTER>
    2. wait for install to finish
  10. choose “Mainsail” (3)
    1. when asked “Download recommended macros”: confirm with “Y” or <ENTER>
    2. wait for install to finish
  11. choose “Fluidd” (4)
    1. when asked “Please enter a new Port”: enter “81”
    2. when asked “Download recommended macros”: confirm with “Y” or <ENTER>
    3. wait for install to finish
  12. choose “KlipperScreen” (5)
    1. wait for install to finish (will take quite a while)
    2. when asked “Install as a service?”: confirm with “Y” or <ENTER>
  13. choose “Crowsnest” (12)
    1. wait for install to finish
    2. when asked “Do you want to add 'update manager'”: confirm with “Y” or <ENTER>
    3. when asked “Reboot NOW? [y/N]”: answer “N” or <ENTER>
  14. choose “Back” (B)
  15. choose “Advanced” (4)
    1. choose “G-Code Shell Command” (8)
    2. when asked “Do you want to continue?”: confirm with “Y” or <ENTER>
    3. when asked “Create an example shell command?”: confirm with “Y” or <ENTER>
  16. choose “Quit” (Q)
  17. Set up secondary mcu: (see https://www.klipper3d.org/RPi_microcontroller.html)
    cd ~/klipper ; make menuconfig
    1. select “Micro-controller Architecture” (press <ENTER>)
    2. select “Linux process” (press <ENTER>)
    3. press “Q” and “Y” to quit and save
    4. sudo make flash
    5. sudo cp ./scripts/klipper-mcu.service /etc/systemd/system/
    6. sudo systemctl enable klipper-mcu.service
    7. sudo service klipper restart
  18. Fix screen rotation:
    sudo nano /etc/X11/xorg.conf.d/01-armbian-defaults.conf
    1. copy this text:
      Section "Device"
              Identifier "default"
              Driver "fbdev"
              Option "Rotate" "CW"
      EndSection
      Section "InputClass"
              Identifier "libinput touchscreen catchall"
              MatchIsTouchscreen "on"
              MatchDevicePath "/dev/input/event*"
              Driver "libinput"
              Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
      EndSection
    2. press <CTRL-X> to quit
    3. press “Y” to save
    4. press <ENTER> to confirm filename
    5. restart KlipperScreen:
      sudo service KlipperScreen restart
  19. Freeze the kernel
    1. sudo armbian-config
    2. select “System”
    3. select “Freeze”

Now you should have a working (and recent) klipper installation on the Sovol KlipperScreen.

Copy your old printer.cfg - or take one of Sovol's files for your device: https://github.com/Sovol3d/SOVOL_KLIPAD50_SYSTEM/tree/main/klipper_configuration

You will probably have to change “spidev0.0” to “spidev0.2” inside your “printer.cfg”
(unless you've installed the wifi-enabled dtb below - in that case, it will be spidev0.0 again).

Sovol mods

  • Beeps when pressing touchscreen
    • Related files: makerbase-beep-files
    • To install:
      • Upload the *.deb to your device, e.g. using the web-frontend: Navigate to “G-CODE-FILES”, then use the upload button (the one with the up-arrow). Or use scp, winscp or whatever you like.
      • Log into the device (ssh/putty/serial)
      • sudo dpkg -i printer_data/gcodes/makerbase-beep-service.deb
      • (change the path, if you've uploaded to a different location)
      • fix access rights to gpio82:
        • sudo nano /etc/rc.local
        • add following lines (before the exit 0 line)
        • chgrp mks /sys/class/gpio/gpio82/value
        • chmod g+w /sys/class/gpio/gpio82/value
    • To uninstall:
      • sudo dpkg -r makerbase-beep-service

Internal wifi

This is experimental and may not work for you.

The following change to the source of rk3328-roc-cc.dtb (Sovol's version) enables the internal wifi of the KLIPAD50 board.

--- rk3328-roc-cc-org.dts	Sat Mar 09 16:36:40 2024
+++ rk3328-roc-cc-new.dts	Sat Mar 09 17:33:57 2024
@@ -860,7 +860,7 @@
 
 		spi_for_cs2@0 {
 			reg = <0x00>;
-			compatible = "rockchip,spi_test_bus1_cs2";
+			compatible = "armbian,spi-dev";
 			pinctrl-names = "default";
 			pinctrl-0 = <0x35>;
 			spi-max-frequency = <0x4c4b40>;

Source of Sovol's rk3328-roc-cc.dtb from 5.16.20 kernel rk3328-roc-cc_dts

Successfully tested with these images:
0.3.2-24.2.0-trunk: Armbian-unofficial_24.2.0-trunk_Mkspi_bookworm_current_6.1.76.img.xz
0.3.4-24.2.0-trunk: Armbian-unofficial_24.2.0-trunk_Mkspi_bookworm_current_6.6.17.img.xz
0.3.4-24.2.0-trunk: Armbian-unofficial_24.2.0-trunk_Mkspi_bookworm_edge_6.7.5.img.xz

Additional notes:

  • I had some wifi-performance issues with 6.7.5, not sure if that was just by chance.
  • The wlan0 device did not show up when “firmware-misc-nonfree” was installed. Reverting to armbian-firmware fixed this.
  • The dtb files reside in the fat32 partition, you can easily replace them directly after writing the USB-stick or eMMC. So on the first boot you will automatically be asked to configure wifi. If you set it up using an USB-keyboard instead of a serial line, keep in mind that it uses US-keylayout when entering the passwords.

Here is a compiled version of the devicetree file: rk3328-roc-cc.dtb

Download and replace /boot/dtb/rockchip/rk3328-roc-cc.dtb with this version and reboot.

rebuilding.1710156936.txt.gz · Last modified: 2024/03/11 12:35 by torte