alphanumeric
Posts: 1275
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Rotate display 90º?

Sun May 15, 2016 8:09 pm

lincolnberryiii wrote:
alphanumeric wrote:Did you try the lcd_rotate=1 config.txt edit? It's a lot easier. It works for me.
Thanks, but I need my display rotated at 270° and lcd_rotate=3 doesn't work for me. I'm running Raspbian Jessie on the Pi 2 B.
Ok, I've only ever flipped it 180, lcd_rotate=2, on my Pi 2B. Just be sure you used lcd_rotate and not display_rotate. display_rotate only rotates the image, it doesn't rotate the touch to match.

blucap
Posts: 1
Joined: Wed Jun 29, 2016 9:22 am

Re: Rotate display 90º?

Wed Jun 29, 2016 9:32 am

This will do it: open /boot/config.txt in your favourite editor and add the line:

Code: Select all

lcd_rotate=2
Don't use the documented display_rotate, it performs a performance expensive rotation of the screen and does not rotate the touch input.

tsaG
Posts: 80
Joined: Thu Jun 26, 2014 1:30 pm

Re: Rotate display 90º?

Sat Jul 23, 2016 9:35 pm

When can we get this bug fixed (that lcd_rotate=1 doesnt work). Im trying to run a embedded QT app so I cant use xinput since Im not using Xorg :)

alberto.tagliavini
Posts: 7
Joined: Mon Mar 14, 2016 1:28 pm

Re: Rotate display 90º?

Thu Aug 25, 2016 10:42 am

mikearnoldsmith wrote:
Theo1966 wrote:As usual, after long try and error post the problem in a forum and find the solution rather quickly after doing so :lol:

I was thinking it must be something about the difference between commandline and gui.
-> so maybe run the bash after the gui is started
-> So I put the command to run the script in " /home/pi/.config/lxsession/LXDE-pi/autostart "
........ and it worked !!!! :o

Now the input of the touchscreen is rotated 270 degrees @ startup
I edited /home/pi/.config/lxsession/LXDE-pi/autostart
and added @/etc/xdg/lxsession/LXDE-pi/screenflip.sh
And my touchscreen works in 270 rotation on Raspbian Jessie.

Thanks for the post.
Hello, i have followed this istructions but the script when execute xinput row send in output the following error:
Unable to connect to X server


If i launch the same script from a new console, it works!
How can i solve it?


Thanks!

Cindella
Posts: 2
Joined: Tue Sep 06, 2016 2:25 am

Rotated display but now touchscreen?

Tue Sep 06, 2016 2:31 am

Hello,
I'd lost without theses forms i'm so glad for all of you guys, and man what a learning curve already. I'm so excited about my Pi 3 its has the "official" 7in screen and I finally was able to change the screen but now i need to have the touch capabilities the same way. although it works fine with the mouse it would be nice to have that as access if need be.

Cindella
Posts: 2
Joined: Tue Sep 06, 2016 2:25 am

Re: Rotated display but now touchscreen?

Tue Sep 06, 2016 5:37 am

Cindella wrote:Hello,
I'd lost without theses forms i'm so glad for all of you guys, and man what a learning curve already. I'm so excited about my Pi 3 its has the "official" 7in screen and I finally was able to change the screen but now i need to have the touch capabilities the same way. although it works fine with the mouse it would be nice to have that as access if need be.

I figured it out yay!!!

alphanumeric
Posts: 1275
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Rotate display 90º?

Tue Sep 06, 2016 10:08 am

Did you guys try the lcd_rotate ? For me it flips the screen and the touch orientation to match.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Rotate display 90º?

Tue Sep 06, 2016 11:24 am

alphanumeric wrote:Did you guys try the lcd_rotate ? For me it flips the screen and the touch orientation to match.
It works using "lcd_rotate=2" (180deg rotation). However, when using "lcd_rotate=1" or "lcd_rotate=3" (90 or 270deg rotation) the touch orientation is not rotated correctly, thus the need to manually invert some of the input axes.

alphanumeric
Posts: 1275
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Rotate display 90º?

Tue Sep 06, 2016 11:28 am

OK, bummer, the other way looks like a lot of work.

kevinva
Posts: 2
Joined: Mon Sep 12, 2016 1:21 pm

Re: Rotate display 90º?

Mon Sep 12, 2016 2:27 pm

Hi,

Like many of you, I am also having trouble rotating the touchscreen when the RPi3 powers up. I can run the screenflip.sh script manually and the touchscreen works fine. I have tried running this script from the following locations:

/etc/xdg/lxsession/LXDE-pi/autostart
/home/pi/.config/lxsession/LXDE-pi/autostart

Neither of these options work so I tried the idea by Theo1966 to write a message to a text file. This is not working so it appears neither of these autostart files are running (or maybe they stop running before the screenflip script is run). Are there any other locations to run this script?

Thanks,
Kevin

doj
Posts: 9
Joined: Sat Oct 31, 2015 5:35 am

Re: Rotate display 90º?

Wed Nov 09, 2016 6:01 pm

Hello to all,

like many on the thread I seriously struggled with this seemingly simple issue, an issue one would hope is addressed by the foundation in an upcoming update.

I eventually got it all working perfectly using this post:-

by twuelfing » Sat Oct 10, 2015 7:26 pm

that post is on the first page of the thread.

First may I thank twuelfing for this information, without which I would not have got very far with the project I am working on.

initially this method failed for me, and it was not until I realized one simple point that was missed in his post, and that was simply about PERMISSIONS of the screenflip.sh script.

once I changed the permission to 'Only Owner' it worked exactly as I had hoped.

I hope others get the same results.

as a footnote, I am not using raspbian, but rather a very lightweight version called DietPi that is based upon raspbian but does not have all the unnecessary bloat that I did not need in my particular project.
that meant I very slightly changed the 'autostart' entry to use LXDE directory as opposed to LXDE-pi.

Schneggli92
Posts: 1
Joined: Sun Dec 11, 2016 6:36 pm

Re: Rotate display 90º?

Sun Dec 11, 2016 7:59 pm

Is there a solution now? Can it be that I am the only one in the world who would like to operate the Raspberry Touch Display in portrait mode?

oink
Posts: 1
Joined: Tue Dec 20, 2016 11:27 am

Re: Rotate display 90º?

Tue Dec 20, 2016 11:42 am

i do like this

0.
install xinput

Code: Select all

sudo apt-get install xinput
1.
to rotate the screen, edit this file

Code: Select all

sudo nano /boot/config.txt
add this line at the end

Code: Select all

display_rotate=1
for the other direction, you can use

Code: Select all

display_rotate=3

exit and save

2.
create a script for flipping touchscreen

Code: Select all

sudo nano /home/pi/Desktop/fliptouch.sh
add these lines

Code: Select all

xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
exit and save

if you use

Code: Select all

display_rotate=3
add theses lines

Code: Select all

xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
3.
chmod this script

Code: Select all

sudo chmod 777 /home/pi/Desktop/fliptouch.sh
4.
to launch the script with the session, edit this file

Code: Select all

sudo nano ~/.config/lxsession/LXDE-pi/autostart
add this line at the end

Code: Select all

@/home/pi/Desktop/fliptouch.sh
exit and save

5.
reboot

Code: Select all

sudo reboot

work like a charm for me :-)

(i wrote english like a spanish cow, hope it helps)

tigerhawk
Posts: 1
Joined: Tue Jan 31, 2017 3:05 am

Re: Rotate display 90º?

Tue Jan 31, 2017 3:18 am

Hey all,

Complete rookie with Linux here. I've been able to install xinput and view the list, however, when I run "xinput set-prop 'FT5406 Memory based driver' 'evdev axes swap' 1" I get "Property 'evdev axes swap' doesn't exist, you need to specify its type and format".

I do have the FT5406 btw.

So, looking through the forum I saw that I may need to install the evdev files, so i ran "sudo pip install evdev". This leads to a small paragraph of red text. The main line being " command 'arm-linux-gnueabihf-gcc' failed with exit status 1"

Thoughts? Where should I go from here?

Thanks

AgiRPI
Posts: 3
Joined: Fri Feb 10, 2017 8:44 am

Re: Rotate display 90º?

Fri Feb 10, 2017 11:04 am

I have the same problem like tigerhawk
I gues it's because the Raspberry use (not more) the evdev driver
if i type:

Code: Select all

xinput list-props 9
I can't found anything with evdev, but instead libinput.
some research say it's also some kind of touch and mouse event driver.
but how to deal with this now?

I use the newest image and can't switch to an older one.

all what I want is to rotate the touch functionality by 90º

Any ideas what I can try?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5106
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Rotate display 90º?

Fri Feb 10, 2017 12:50 pm

Info on touchscreen flips/rotations with latest Pixel here:
viewtopic.php?f=28&t=172025

User avatar
LetHopeItsSnowing
Posts: 354
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Rotate display 90º?

Sun May 14, 2017 8:45 pm

After a change to Pixel the instructions in this post no longer work so I have pulled together an end 2 end set of instructions to rotate the touchscreen 90 degrees:

http://www.stuffaboutcode.com/2017/05/r ... trait.html
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

rpasc
Posts: 1
Joined: Sat Jul 22, 2017 11:02 am

Re: Rotate display 90º?

Sat Jul 22, 2017 11:11 am

Would like to thank those who have contributed with the xinput information.
Besides correcting the touch digitizer in a script, the correct values can be automatically chosen within the script as well. I leave a sample for rotation to 90º. Using RPi3 and official touch. This code is for example in rotatetouch.sh and, as many have mentioned, would be called within /home/pi/.config/lxsession/LXDE-pi/autostart

Code: Select all

#!/bin/bash

KRED='\033[0;31;7m'
KGRN='\033[0;32;7m'
KNRM='\033[0m' # No Color

# this is for a 90 degree rotation in /boot/config.txt

#internal field separator
configfile=/boot/config.txt

while IFS= read -r line
do
	commandname=$(echo $line | cut -f1 --delimiter='=' -s)
	commandvalue=$(echo $line | cut -f2 --delimiter='=' -s)
	
	if [ "$commandname" == "display_rotate" ] && [ $commandvalue -eq 1 ] 
	then
		echo -e "${KGRN}----------------------"
		echo 	"Swap and rotate $commandvalue"
		echo -e "----------------------${KNRM}"
		xinput --set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
		xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
	fi
done < "$configfile"

User avatar
DougieLawson
Posts: 30450
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Rotate display 90º?

Sat Jul 22, 2017 3:37 pm

tsaG wrote:When can we get this bug fixed (that lcd_rotate=1 doesnt work). Im trying to run a embedded QT app so I cant use xinput since Im not using Xorg :)
It's not a bug. It's a design choice in the bootcode for the RPF official display. They only support rotate=0 and rotate=2.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

osowiecki
Posts: 11
Joined: Tue Jan 19, 2016 6:45 pm

Re: Rotate display 90º?

Thu Aug 03, 2017 10:38 am

Experimental OpenGL driver allows rotation, right?
It's still kind of unstable atm.

User avatar
DougieLawson
Posts: 30450
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Rotate display 90º?

Thu Aug 03, 2017 11:10 am

osowiecki wrote:
Thu Aug 03, 2017 10:38 am
Experimental OpenGL driver allows rotation, right?
It's still kind of unstable atm.
We'll find out when it's no longer experimental. I'm not prepared to do anything with that as it still isn't out of early alpha testing.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

Return to “Official Foundation Display”

Who is online

Users browsing this forum: No registered users and 4 guests