From e0af63774db6cd56ab4757190a72cac286cffead Mon Sep 17 00:00:00 2001 From: alfrix Date: Sat, 2 Mar 2024 00:38:02 -0300 Subject: [PATCH] changes for bookworm --- docs/Hardware/GPIO_35.md | 37 ++++++++++++++++++++++++++------ scripts/KlipperScreen-install.sh | 17 ++++++--------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/docs/Hardware/GPIO_35.md b/docs/Hardware/GPIO_35.md index 4d608f18..8c9b4270 100644 --- a/docs/Hardware/GPIO_35.md +++ b/docs/Hardware/GPIO_35.md @@ -31,19 +31,44 @@ Close the nano editor using `ctrl`+`x` (exit), then `y` for yes (save). sudo reboot ``` -## Wrong colors +## Wrong colors or graphical corruption -Some screens will not behave correctly and display wrong colors, +Some screens will not behave correctly and/or display wrong colors, this usually due to the wrong [SPI](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface) speed -In my case I had to use 16 Mhz (default is 24Mhz) +In my case the maximum i could achieve is 22.22Mhz (400mhz core / 18) ``` -dtoverlay=piscreen,drm,speed=16000000 +dtoverlay=piscreen,drm,speed=22222222 ``` +As you may predict speed has a big impact in usability as it dictates how often the display will refresh + +reboot to test any changes. ## Rotation +!!! bug + The current Rpi Kernel v6.1.77 has a bug in the dtb and rotate doesn't work, fix has been merged in v6.6 + you can copy the dtb from the new kernel into the old one if needed + + You can rotate the screen adding a rotate line with the degrees [0, 90, 180, 270] ``` -dtoverlay=piscreen,drm,speed=16000000,rotate=180 +dtoverlay=piscreen,drm,rotate=180 ``` -Screen rotation will require adjusting the touch matrix see [Touch issues](../../Troubleshooting/Touch_issues/) \ No newline at end of file +Screen rotation will require adjusting the touch matrix see [Touch issues](../../Troubleshooting/Touch_issues/) + +## Console + +To make the console work: + +```sh +sudo nano /boot/firmware/cmdline.txt +``` + +add at the start or end: + +``` +fbcon=map:11 +``` + +!!! warning Important + do not add newlines to the file, it must be 1 line with the options separated by spaces diff --git a/scripts/KlipperScreen-install.sh b/scripts/KlipperScreen-install.sh index 484c0326..632be222 100755 --- a/scripts/KlipperScreen-install.sh +++ b/scripts/KlipperScreen-install.sh @@ -151,6 +151,7 @@ install_systemd_service() sudo systemctl daemon-reload sudo systemctl enable KlipperScreen sudo systemctl set-default multi-user.target + sudo adduser $USER tty } create_policy() @@ -160,8 +161,7 @@ create_policy() echo_text "Installing KlipperScreen PolicyKit Rules" sudo groupadd -f klipperscreen - sudo groupadd -f netdev - sudo groupadd -f tty + sudo adduser $USER netdev if [ ! -x "$(command -v pkaction)" ]; then echo "PolicyKit not installed" return @@ -233,14 +233,11 @@ EOF update_x11() { - if [ -e /etc/X11/Xwrapper.config ] - then - echo_text "Updating X11 Xwrapper" - sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config - else - echo_text "Adding X11 Xwrapper" - echo 'allowed_users=anybody' | sudo tee /etc/X11/Xwrapper.config - fi + echo_text "Adding X11 Xwrapper" + sudo /bin/sh -c "cat > /etc/X11/Xwrapper.config" << EOF +allowed_users=anybody +needs_root_rights=yes +EOF } fix_fbturbo()