How To Flip 10.8" Touchscreen 180 degrees

Flip 10.8" Touchscreen 180 degrees

CAUTION: This is an unsupported procedure. Onefinity has explicitly stated this in post #2 of this thread as seen here.

If you still choose to continue you should consider creating a backup of the Onefinity Micro SD card using this How-to


Follow these steps to flip the Onefinity 10.8" touchscreen 180 degrees so the cables exit from the left side of the screen.

Things you need to type will follow the word Type: and be in this font
You do not type the word Type:
Special keys are denoted as follows:
<ctrl> is a modifier key, usually with the label “ctrl” on the key
<alt> is a modifier key, usually with the label “alt” on the key
<Enter> is the Enter key on your keyboard
In the case of modifier keys like <ctrl> and <alt>, they are used in conjunction with another key.
For example
Type: <ctrl>c
means you hold down the control key and press the c key before releasing.

The sudo command is used in many of the steps below. This command allows a permitted user such as our “pi” user to perform commands as the superuser. Be very cautious with this command. Things can get really screwed up if used improperly.

Steps 2 and 3 of the procedure below use the method of connecting a USB keyboard to the controller and getting into terminal mode directly on the controller’s Raspberry Pi. If you are familiar with the SSH method of accessing the Raspberry Pi remotely you can connect via SSH if you so desire in place of steps 2 and 3.

  1. Turn on your machine

  2. Connect a USB keyboard to a free USB port on the back of the Onefinity controller.

  3. Type: <ctrl-t> <ctrl-c>
    This places you in terminal mode which consists of a black screen with pi@onefinity:~ $ in blue, white, and green postitioned in the upper left corner. This is the prompt where you will type commands.

  4. Type: sudo mount -o remount,rw /boot<Enter>
    This command makes the /boot partition of the Raspberry Pi writable so we can make our changes. The pi@onefinity:~ $ prompt will appear on the next line down awaiting another command each time this and the other commands below complete.

  5. Type: sudo cp -ai /boot/config.txt /boot/config.txt.orig<Enter>
    This command makes a backup copy of the file we will be editing in case it is necessary to fall back.

  6. Type: sudo nano /boot/config.txt<Enter>
    This command places you in the nano editor and displays the contents of the file.
    Extreme caution should be exercised here as any errant key presses will alter the file and not in a good way.
    The image below shows what the screen should look like. The bottom two rows show some of the keystroke commands used in the nano editor. The ^ symbol denotes you press and hold the <ctrl> key followed by the key to its right and the M- combo denotes you press and hold the <alt> key followed by the key to its right. In addition, the arrow keys on the keyboard move the cursor around in the file.

  7. Type: <alt>/
    This keystroke combination will move the cursor to the bottom of the file. This can also be accomplished by using the down arrow key.

  8. Type: display_rotate=2<Enter>
    This entry tells the display driver to rotate the screen 180 degrees.

  9. Type: <ctrl>x
    This keystroke combination is the command to exit the nano editor. The editor will prompt you at the bottom left of the screen “Save modified buffer?”

  10. Type: y<Enter>
    Pressing y will bring up a second prompt asking for the file name but it defaults to the original file name. By pressing <Enter> right after pressing y we are accepting the original file name.

  11. Type: diff /boot/config.txt /boot/config.txt.orig<Enter>
    Note that sudo is not needed for this command as the the user pi has read permissions on these files.
    This command will display the differences between the file we just modified and the copy of the original file we made as a sanity check. The expected outcome is 2 lines. The first line is line numbers of the difference and can be safely ignored if it doesn’t match exactly what follows below:

     71d70
     < display_rotate=2
  1. Verify there are only 2 lines and line 2 displays as above. If both of these can be verified, skip to step 15.
  2. If verification in step 12 failed, then
    a. Type: sudo cp -ai /boot/config.txt.orig /boot/config.txt<Enter>
    This command will restore the original file while keeping our backup of the original intact.
    b. Go back and perform steps 6 through 12. We need to go back and edit the file once again.
  3. else if verification in step 12 succeeded, then continue:
  4. Type: sudo mount -o remount,ro /boot<Enter>
    Perform this command ONLY after verification has PASSED in step 12.
    This command makes the /boot partition of the Raspberry Pi read only once again.
  5. Type: cd /usr/share/X11/xorg.conf.d<Enter>
    Note the prompt will change to pi@onefinity:/usr/share/X11/xorg.conf.d $
    This command changes to a directory where our second and final edit is needed. This edit flips the touchscreen interface 180 degrees.
    Note sudo is not needed for this command as the directory is readable by the pi user.
  6. Type: sudo cp -ai 40-libinput.conf 40-libinput.conf.orig<Enter>
    This command makes a backup copy of the file we will be editing in case it is necessary to fall back.
  7. Type: sudo nano 40-libinput.conf<Enter>
    This command places you in the nano editor and displays the contents of the file.
    Extreme caution should be exercised here as any errant key presses will alter the file and not in a good way (trust me on this one).
  8. Visually locate the section with the identifier "libinput touchscreen catchall"
    This is the section where we must make the edit.
    Reference the image below. Note the image below has the edit already in place. When you first view the file you will of course not see this line.

  1. Using the down and right arrows on the keyboard, place the cursor at the end of the line that contains "Driver libinput" in the correct section.
  2. Type: <Enter>
    This places the cursor on a new line ready for our edit.
  3. Type: Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
    NOTE do not press <Enter> or any other key after typing this.
    NOTE You may enter eight spaces before “Option” if you wish to line it up with the other entries however it is not necessary.
    NOTE there are spaces between all the numerals but no space between the “-” and “1”
  4. Type: <ctrl>x
    This keystroke combination is the command to exit the nano editor. The editor will prompt you at the bottom left of the screen “Save modified buffer?”
  5. Type: y<Enter>
    Pressing y will bring up a second prompt asking for the file name but it defaults to the original file name. By pressing <Enter> right after pressing y we are accepting the original file name.
  6. Type: diff 40-libinput.conf 40-libinput.conf.orig<Enter>
    Note that sudo is not needed for this command as the the user pi has read permissions on these files.
    This command will display the differences between the file we just modified and the copy of the original file we made as a sanity check.
    The expected outcome is 2 lines.
    The first line is line numbers of the difference and can be safely ignored if it differs from your output. I say this because versions supplied in subsequent releases may differ in the number of lines in the file.
    The second line should match exactly to one of the outputs shown below.
   
     Output 1: no additional spaces in front of "Option"
         28d27
         < Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
     Output 2: optional 8 additional spaces in front of "Option"
         28d27
         <         Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
  1. Verify there are only 2 lines and line 2 displays as above. If both of these can be verified, skip to step 29.
  2. If verification in step 26 failed, then
    a. Type: sudo cp -ai 40-libinput.conf.orig 40-libinput.conf<Enter>
    This step will restore the original file while keeping our backup of the original intact.
    b. Go back and perform steps 18 through 26.
    We need to go back and edit the file once again.
  3. else if verification in step 26 succeeded, then continue:
  4. Type: sudo reboot<Enter>
    Perform this command ONLY after verification has PASSED in step 26.
    This command reboots the controller.
    The display and touchscreen should now be rotated 180 degrees.
8 Likes