Page 1 of 2

Guide : LCD-PI Screen Rotation

PostPosted: Mon Apr 14, 2014 7:52 pm
by intika
Hi all...

Here is how to rotate the screen

Info :
0 = No rotation
1 = 90° Rotation
3 = 180° Rotation

On boot rotation :
Edit "cmdline.txt" present on your SD
add fbcon=rotate:1
Code: Select all
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=rotate:1


Rotation On Demand :
Use this command :
echo 1 | sudo tee /sys/class/graphics/fbcon/rotate

Enjoy
;)

Re: Guide : LCD-PI Screen Rotation

PostPosted: Mon Apr 28, 2014 6:59 pm
by studunihd
This method (on boot rotation) rotates the screen of the boot console but if I use
Code: Select all
FRAMEBUFFER=/dev/fb1 startx
the screen is in default landscape mode again. Is there a way to rotate the X window manager?

The rotation on demand does not work at all.

Re: Guide : LCD-PI Screen Rotation

PostPosted: Wed Apr 30, 2014 6:48 pm
by intika
hello...

if hwlevel screen would be supported on fbtft it would be easy to do many stuff like rotating the gui... and playing hd videos... will see later if it will be available.

Therefore there is a solution to rotate the Gui (startx) you have to modify the xorg.config file

edit your x11 config file with gedit, it's present on \etc\x11\xorg.conf
you could play with the file by adding/removing this lines :
Code: Select all
Option "rotate" "CW"
Option "SwapAxes" "True"
Option  "InvertY" "True"
Option  "InvertX" "True"   


don't use all the line at the same time.

you can create a copy of your config file and indicate to startx what config file to load by this command

Code: Select all
startx -- -config /etc/X11/yournewcfgfile


...

Rotation on demand does not work under the gui interface

you have to edit /sys/class/graphics/fbcon/rotate value to rotate the screen on demand
you could try
echo 1 > /sys/class/graphics/fbcon/rotate
echo 0 > /sys/class/graphics/fbcon/rotate

cheers

Re: Guide : LCD-PI Screen Rotation

PostPosted: Thu May 01, 2014 9:51 pm
by studunihd
It's not working for me. It either throws errors or nothing happens at all. Could you post a complete xorg.conf file please, so I can see where exactly it's supposed to go?

Re: Guide : LCD-PI Screen Rotation

PostPosted: Fri May 09, 2014 7:34 am
by intika

Re: Guide : LCD-PI Screen Rotation

PostPosted: Sun May 11, 2014 4:31 pm
by berbano
Hi!, Isn't working for me too (the startx rotation) :(.
Adafruit have that https://learn.adafruit.com/adafruit-pit ... stallation, they can easily setup the screen for rotation. Do we have something similar to easily rotate the screen in lcd32?. Thanks. Ber

Re: Guide : LCD-PI Screen Rotation

PostPosted: Mon May 12, 2014 10:28 am
by intika
Adafruit is using/compatible fbtft wich is not available for HWLevel for the moment...
the only way i know is the one i posted... maybe admin will post something else

give us a chance to help when you post...

what system are you using ?
What kernel version ?
What did you done exactly ?

Note : Edit "cmdline.txt" present on your SD
cmdline.txt could be also present on /boot/

Re: Guide : LCD-PI Screen Rotation

PostPosted: Mon May 12, 2014 2:00 pm
by berbano
Hi Intika!
My system is the Raspbian version of "Hwlevel",
My kernel is 3.10.32+
I done:
Code: Select all
 fbcon=rotate:1
in the cmdline.txt, thats made my console go in 90° (cool :) )
I done in /etc/X11/xorg.conf differents combinations of:
Code: Select all
Option "rotate" "CW"
Option "SwapAxes" "True"
Option  "InvertY" "True"
Option  "InvertX" "True"

I tryed rebooting, with and with out the HDMI tv connected --> didn't work :(
I tryed
Code: Select all
startx -- -config /etc/X11/xorg.conf
with and without sudo and with and without FRAMEBUFFER=/dev/fb1 (or fb0) at the begin. And didn't work aswell.
startx -- -config /etc/X11/xorg.conf -> gove me the next error:
Fatal server error / cannot move old log file "/var/log/Xorg.0.log" to "/var/log/Xorg.0.log.old"
xinit. giving up
xinit:unable to connect to X server: Bad file descriptor
xinit: server error.

Really thanks for your help.

Re: Guide : LCD-PI Screen Rotation

PostPosted: Sun May 18, 2014 1:14 pm
by markdoll01
Hi,

Got the X server rotation working. The description in here is not very good and to get the X rotation working, one needs to add a new section to the xorg.conf. First section is "Device" and it configures the Display and this is where you Rotate the output. CW for ClockWise and CCW for CounterClockWise. The second section is for the touch input "InputClass". Here is my whole xorg.conf file:

# configuration for LCD-PI43 and LCD-PI50
Section "Device"
Identifier "LCD-PI32"
Driver "fbdev"
Option "rotate" "CW"
Option "fbdev" "/dev/fb1"
EndSection

Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
# Option "SwapAxes" "True"
Option "InvertY" "False"
Option "InvertX" "False"
EndSection

Re: Guide : LCD-PI Screen Rotation

PostPosted: Wed May 28, 2014 9:45 am
by berbano
Wow!, thanks intika and markdoll01. I use the instructions of markdoll01 and the rotation in X works amazing. Thanks you!!!