Screen rotation
Configure the server to start in the desired orientation, there are many ways to achieve this, here are some examples:
Warning
Rotation is handled by the OS and not by KlipperScreen, if you can't rotate your screen it's usually an issue with the OS configuration
Examples of rotation
Universal xorg configuration
Universal xorg configuration
Find the identifier use xrandr
it will output something like:
Screen 0: minimum 320 x 200, current 1024 x 600, maximum 8192 x 8192
HDMI-1 connected primary 1024x600+0+0 (normal left inverted right x axis y axis) 800mm x 450mm
Take not that the screen is HDMI-1
(it could be HDMI-A-1
or many other names)
Create /usr/share/X11/xorg.conf.d/90-monitor.conf
Paste this section modifying the options to suit your needs:Section "Monitor"
Identifier "HDMI-1"
# This identifier would be the same as the name of the connector printed by xrandr
# for example "DVI-I-1 connected primary" means that the identifier is "DVI-I-1"
# another example "Unknown19-1 connected primary" some GPIO screens identify as Unknown19
Option "Rotate" "left"
# Valid rotation options are normal,inverted,left,right
Option "PreferredMode" "1920x1080"
# May be necesary if you are not getting your prefered resolution.
EndSection
if KlipperScreen doesn't restart:
you may have to adjust the touch rotation
Raspberry Pi using kernel cmdline
Raspberry Pi using kernel cmdline
To set screen orientation when in console mode, you will need to edit the kernel command-line to pass the required orientation to the system.
To rotate by 90 degrees clockwise, add the following to the cmdline, making sure everything is on the same line, do not add any carriage returns. Possible rotation values are 0, 90, 180 and 270.
For example a DSI screen:
To find the identifier on a terminal run:
it will output something like:Screen 0: minimum 320 x 200, current 1024 x 600, maximum 8192 x 8192
HDMI-1 connected primary 1024x600+0+0 (normal left inverted right x axis y axis) 800mm x 450mm
in this case the identifier is HDMI-1 and a simple cmdline arg would be something like:
To apply changes do a reboot:
Read the official docs for more infoRaspberry Pi legacy mode (works with vc4-fkms-v3d)
Raspberry Pi legacy mode (works with vc4-fkms-v3d)
add to config.txt
To apply changes do a reboot:
Warning
At the moment of writing Pi4 didn't support 90 and 270 degrees with this method, see the official docs
Value | result |
---|---|
0 | no rotation |
1 | rotate 90 degrees clockwise |
2 | rotate 180 degrees clockwise |
3 | rotate 270 degrees clockwise |
0x10000h | horizontal flip |
0x20000 | vertical flip |