Cannot Successfully Calibrate TouchUI on my Screen

Hey Guys -

I added a 3.5 touchscreen to my Ender 3 Pro a couple of weeks ago and installed TouchUI. Everything seems to appear on the screen correctly, but despite trying tons of configuration settings, I cannot get touch calibrated. Seemingly the X + Y axis need to be swapped (for touch), but editing conf files doesn't make a difference.
Example of Issue:

  • When clicking / touching the upper right corner, the arrow appears in the lower right
  • When clicking / touching the lower left corner, the arrow appears in the upper right

Below is a list of hardware, current conf files, and things I've tried. Any assistance would be appreciated!

Hardware

- Raspberry Pi 3 B+
- [kuman for Raspberry Pi 3B+ TFT LCD Display, 3.5 Inch 480x320 TFT Touch Screen Monitor for Raspberry Pi Model B A+ SPI Interface with Touch Pen SC06](https://www.amazon.com/gp/product/B01CNJVG8K/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1)
- USB Logitech Camera
- Ender 3 Pro
- Power supplied via Ender 3 power supply converted down to 5V

/boot/config.txt

disable_overscan=1
dtparam=audio=on
[all]
#dtoverlay=vc4-fkms-v3d
hdmi_force_hotplug=1
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtoverlay=tft35a:rotate=270
start_x=1
gpu_mem=128

/usr/share/X11/xorg.conf.d/99-calibration.conf

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "1373 1407 3140 3034"
        Option  "SwapAxes"      "1"
        Option "InvertX" "true"
        Option "InvertY" "true"
EndSection

#Section “Device”
#  Identifier “touchscreen”
#  Driver “fbdev”
#  Option “fbdev” “/dev/fb1”
#EndSection

/usr/share/X11/xorg.conf.d/99-fbdev.conf

Section "Device"
  Identifier "touchscreen"
  Driver "fbdev"
  Option "fbdev" "/dev/fb1"
EndSection

What I've Tried

  • Everything on the TouchUI Trousbleshooting page - multiple times
  • Adding / removing InvertX/InvertY lines
  • A variety of settings found when searching for similar issue including

I'm rebooting after each change, but still no-go. Any suggestions? Thanks!

I don't know if it helps but the manual says you should put this calibration option into /etc/X11/xorg.conf.d/99-calibration.conf

Section "InputClass" 
        Identifier      "calibration" 
MatchProduct    "ADS7846 Touchscreen" 
Option  "Calibration"   "3951140 3998261"
Option  "SwapAxes"      "0" 
EndSection 

source:
https://mega.nz/#F!XUl2gKAB!GXSGWcAkm3IuX-Hoeyj01A!LcUWTSAA

Read this issue I created on the Adafruit repository. It's how you orient the TFT part of the driver in conjunction with orienting the display side.

In other words, there's a console-based driver and an x-windows-based driver. Most install scripts (like Adafruit's) assumes that you'll be always running in the Desktop (x windows) so they never worry about the non-Desktop setup. If the configuration file is /etc/X11... or similar, that's the x windows system.

You're looking for something where you're adjusting /boot/config.txt and the dtoverlay add-on.

Thanks for the reply, guys...

I understand what you are saying, OutsourceGuru, but I was under the impression that TouchUI installed X to a degree. I tried the config PrintedWeezl (without changing anything else) and it made a difference - almost resolving the issue. Below are configs I tried with results for each. I'm so close, but can't find the setting to get me there. Suggestions?

Test 1
I first tried keeping my initial "Option Calibration" line since it's what the utility spit out for me to use...

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"         
 #       Option          "Calibration"   "3951140 3998261"
        Option  "Calibration"   "1373 1407 3140 3034"
        Option          "SwapAxes"      "0"
 #       Option  "InvertX"       "true"
 #       Option  "InvertY"       "true"
EndSection

Test 1 Result
No difference

Test 2
Found that I accidentally added a "[" to the beginning of "Section" therefore I assume made entire config invalid.

 [Section "InputClass"
         Identifier      "calibration"
         MatchProduct    "ADS7846 Touchscreen"
    #     Option          "Calibration"   "3951140 3998261"
         Option  "Calibration"   "1373 1407 3140 3034"
         Option          "SwapAxes"      "0"
    #     Option  "InvertX"       "true"
    #     Option  "InvertY"       "true"
 EndSection

Test 2 Result
Y seemed to work, but X was reversed

Test 3
Removed the "[" and used "Option Calibration" line PrintedWeezl suggested

Section "InputClass"
        Identifier      "calibration"         
        MatchProduct    "ADS7846 Touchscreen"
        Option          "Calibration"   "3951140 3998261"
#        Option  "Calibration"   "1373 1407 3140 3034"
        Option          "SwapAxes"      "0"
#       Option  "InvertX"       "true"
#       Option  "InvertY"       "true"
EndSection

Test 3 Result
X & Y touch axis were reversed (Moving to right moved cursor left, moving up moved cursor down) Cursor was actually close to where I was touching, though; as it wasn't even close previously

Test 4
Changed "SwapAxes" value from 0 to 1

 Section "InputClass"
         Identifier      "calibration"
         MatchProduct    "ADS7846 Touchscreen"
         Option          "Calibration"   "3951140 3998261"
 #        Option  "Calibration"   "1373 1407 3140 3034"
         Option          "SwapAxes"      "1"
 #       Option  "InvertX"       "true"
 #       Option  "InvertY"       "true"
 EndSection

Test 4 Result
Similar to test 2 results, Y seemed to work, but X was reversed

Test 5
Enabled the XInput True line...

 Section "InputClass"
         Identifier      "calibration"
         MatchProduct    "ADS7846 Touchscreen"
         Option          "Calibration"   "3951140 3998261"
 #        Option  "Calibration"   "1373 1407 3140 3034"
         Option          "SwapAxes"      "1"
         Option  "InvertX"       "true"
 #       Option  "InvertY"       "true"
 EndSection

Test 5 Result
Same result as Test 4 - Y axis looked good but X was reversed

Test 6
Changed the value of InvertX from "true" to "1" (had previously seen it set like this when initially troubleshooting

 Section "InputClass"
         Identifier      "calibration"
         MatchProduct    "ADS7846 Touchscreen"
         Option          "Calibration"   "3951140 3998261"
 #        Option  "Calibration"   "1373 1407 3140 3034"
         Option          "SwapAxes"      "1"
         Option  "InvertX"       "1"
 #       Option  "InvertY"       "true"
 EndSection

Test 6 Result
Same as last two tests - Y good, X reversed.

Any suggestions would be appreciated - Thank You!

Anyone have other suggestions? Still in same spot - Thanks

Anyone ever get this figured out? I have the same problem as well.