Rotate display 90º?

The official Raspbery Pi touch display

67 posts   Page 3 of 3   1, 2, 3
by alphanumeric » 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.
Posts: 1070
Joined: Tue Jan 19, 2016 2:17 pm
by blucap » 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.
Posts: 1
Joined: Wed Jun 29, 2016 9:22 am
by tsaG » 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 :)
Posts: 80
Joined: Thu Jun 26, 2014 1:30 pm
by alberto.tagliavini » 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!
Posts: 5
Joined: Mon Mar 14, 2016 1:28 pm
by Cindella » 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.
Posts: 2
Joined: Tue Sep 06, 2016 2:25 am
by Cindella » 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!!!
Posts: 2
Joined: Tue Sep 06, 2016 2:25 am
by alphanumeric » 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.
Posts: 1070
Joined: Tue Jan 19, 2016 2:17 pm
by JimmyN » 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.
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA
by alphanumeric » Tue Sep 06, 2016 11:28 am
OK, bummer, the other way looks like a lot of work.
Posts: 1070
Joined: Tue Jan 19, 2016 2:17 pm
by kevinva » 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
Posts: 2
Joined: Mon Sep 12, 2016 1:21 pm
by doj » 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.
Posts: 9
Joined: Sat Oct 31, 2015 5:35 am
by Schneggli92 » 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?
Posts: 1
Joined: Sun Dec 11, 2016 6:36 pm
by oink » 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)
Posts: 1
Joined: Tue Dec 20, 2016 11:27 am
by tigerhawk » 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
Posts: 1
Joined: Tue Jan 31, 2017 3:05 am
by AgiRPI » 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?
Posts: 3
Joined: Fri Feb 10, 2017 8:44 am
by dom » Fri Feb 10, 2017 12:50 pm
Info on touchscreen flips/rotations with latest Pixel here:
https://www.raspberrypi.org/forums/view ... 8&t=172025
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5078
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by LetHopeItsSnowing » 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/raspberry-pi-touchscreen-portrait.html
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"
User avatar
Posts: 337
Joined: Sat May 26, 2012 6:40 am
Location: UK