Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PiTFT Plus 2.8 Resistive Screen - Touch Issues
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Wed Sep 30, 2020 2:03 pm

Hello Forum members,

I purchased a piTFT Plus (assembled) 2.8" resistive touchscreen and have had a lot of problems getting the touchscreen functionality to work. Some inforomation:

I have a raspberry pi Zero W and a raspbery pi 3b
I have used the latest up-to-date raspbian pacakge as well as the 2018 raspbian that is suggested in the quick start documentation.
I have tested both of these multiple times and while the screen always turns on and functions (be it as a terminal or as the HDMI GUI option), yet the touchscreen has yet to function once.
I have also reseated the flex cable on the back of the screen and have made sure both of the grey connectors are clicked in thoroughly.

I have runt he software as intended, and have checked to make sure that /dev/input/touchscreen/ exists and that there is an event associated with smtpe rules.

I'm sort of at a loss at this point and am hoping that someone from Ada's tech support could tell me what it is i'm doing wrong or if there is a chance the screen itself is faulty? Here are some photos of the screen, as well.

Any help you could provide, be it diagnosing something that I am doing wrong or if there is something that I could test on the screen, would be most appreciated. Thank you!
Attachments
IMG_6437.jpg
IMG_6437.jpg (211.7 KiB) Viewed 133 times
IMG_6440.jpg
IMG_6440.jpg (175.95 KiB) Viewed 133 times
IMG_6439.jpg
IMG_6439.jpg (161.64 KiB) Viewed 133 times

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Thu Oct 01, 2020 4:03 pm

I'm going to bump this as I would love some help. At least to know there are additional avenues to explore as opposed to hitting the dead end I'm at now. Thanks!

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Thu Oct 01, 2020 5:21 pm

Hello aaaltomare,

When you follow the "Easy Install" instructions and move down to the calibrate section what happens when you run evtest?

viewtopic.php?f=57&t=170064&p=831642#p831642

Code: Select all | TOGGLE FULL SIZE
sudo evtest /dev/input/touchscreen

mikeysklar
 
Posts: 1958
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Thu Oct 01, 2020 7:31 pm

Hello - thanks for the reply.

Here is the output from evtest. Touching the screen does nothing and generates nothing on the terminal.


Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo evtest /dev/input/touchscreen
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "stmpe-ts"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     4095
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
Testing ... (interrupt to exit)


Anything else I could try? Currently, which is the best version of Rasbian to use for maximum compatibility?

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Fri Oct 02, 2020 12:18 pm

You will want to run the Aug. 2020 PiOS (was Raspbian Buster) with the full updates:

Code: Select all | TOGGLE FULL SIZE
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade


In terms of the evtouch let's make sure your SPI is enabled in `raspi-config`:

https://learn.adafruit.com/adafruits-ra ... guring-spi

Also please save a log of the adafruit-pitft.sh script output using the `script` command so I can see if there is anything failing during install.

You should also be able to re-run the above install script and get an automatic calibration.

If you rotate the display you need to recalibrate the touchscreen to work with the new screen orientation. You can manually run the calibration processes in the next section, or you can re-run the installer script and select a new rotation:
adafruit_products_rotation.png
Try using this default calibration script to easily calibrate your touchscreen display. Note that the calibration values might not be exactly right for your display, but they should be close enough for most needs. If you need the most accurate touchscreen calibration, follow the steps in the next section to manually calibrate the touchscreen.

mikeysklar
 
Posts: 1958
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Fri Oct 02, 2020 7:07 pm

Thanks. So today I started fresh. Downloaded the latest piOS, installed it, enabled spi, ran the adafruit TFT script and still no touch.

I ran it again, recording the output via script, here is that output:

Code: Select all | TOGGLE FULL SIZE
This script downloads and installs
PiTFT Support using userspace touch
controls and a DTO for display drawing.
one of several configuration files.
Run time of up to 5 minutes. Reboot required!

Select configuration:
1. PiTFT 2.4", 2.8" or 3.2" resistive (240x320)
2. PiTFT 2.2" no touch (240x320)
3. PiTFT 2.8" capacitive touch (240x320)
4. PiTFT 3.5" resistive touch (320x480)
5. PiTFT Mini 1.3" or 1.54" display (240x240) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
6. MiniPiTFT 1.14" display (240x135) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
7. ST7789V 2.0" no touch (240x320) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
8. Uninstall PiTFT
9. Quit without installing

SELECT 1-9: 1
Select rotation:
1. 90 degrees (landscape)
2. 180 degrees (portrait)
3. 270 degrees (landscape)
4. 0 degrees (portrait)

SELECT 1-4: 1
[PITFT] Checking init system...
Found systemd
/boot is mounted
[PITFT] System update
Updating apt indexes...
...
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

......
Reading package lists...
.........
[PITFT] Installing Python libraries & Software...
Installing Pre-requisite Software...This may take a few minutes!
[PITFT] Updating /boot/config.txt...
Already have an adafruit-pitft-helper section in /boot/config.txt.
Removing old section...
[PITFT] Updating SysFS rules for Touchscreen...
[PITFT] Updating TSLib default calibration...
Would you like the console to appear on the PiTFT display? [y/n] n
[PITFT] Making sure console doesn't use PiTFT
Removing console fbcon map from /boot/cmdline.txt
Screen blanking time reset to 10 minutes
Would you like the HDMI display to mirror to the PiTFT display? [y/n] y
[PITFT] Adding FBCP support...
Installing cmake...
Downloading rpi-fbcp...
/tmp /home/pi
Uncompressing rpi-fbcp...
Building rpi-fbcp...
Installing rpi-fbcp...
/home/pi
Remove fbcp from /etc/rc.local, if it's there...
We have systemd, so install fbcp systemd unit...
Setting raspi-config to boot to desktop w/o login...
Configuring boot/config.txt for forced HDMI
Using x2 resolution
[PITFT] Updating X11 default calibration...
[PITFT] Success!

Settings take effect on next boot.

REBOOT NOW? [y/N] n
Exiting without reboot.
pi@raspberrypi:~ $ exit
exit
Script done, file is adafruitlog
pi@raspberrypi:~ $ sudo reboot now
Connection to raspberrypi.local closed by remote host.
Connection to raspberrypi.local closed.
applesauce:~ photobuffalo$ ssh pi@raspberrypi.local
pi@raspberrypi.local's password:
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Oct  2 23:45:22 2020

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~ $ ls
adafruitlog  adafruit-pitft.sh  Bookshelf  Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
pi@raspberrypi:~ $ vim adafruitlog
-bash: vim: command not found
pi@raspberrypi:~ $ nano adafruitlog

  GNU nano 3.2                                             adafruitlog                                                       

Script started on 2020-10-02 23:43:08+01:00 [TERM="xterm-256color" TTY="/dev/pts/0" COLUMNS="134" LINES="25"]
^[]0;pi@raspberrypi: ~^G^[[01;32mpi@raspberrypi^[[00m:^[[01;34m~ $^[[00m sudo ./adafruit-pitft.sh script^M^[[C^[[C^[[C^[[C^[$
^[[H^[[2J^[[3JThis script downloads and installs
PiTFT Support using userspace touch
controls and a DTO for display drawing.
one of several configuration files.
Run time of up to 5 minutes. Reboot required!

Select configuration:
1. PiTFT 2.4", 2.8" or 3.2" resistive (240x320)
2. PiTFT 2.2" no touch (240x320)
3. PiTFT 2.8" capacitive touch (240x320)
4. PiTFT 3.5" resistive touch (320x480)
5. PiTFT Mini 1.3" or 1.54" display (240x240) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
6. MiniPiTFT 1.14" display (240x135) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
7. ST7789V 2.0" no touch (240x320) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
8. Uninstall PiTFT
9. Quit without installing

SELECT 1-9: 1
Select rotation:
1. 90 degrees (landscape)
2. 180 degrees (portrait)
3. 270 degrees (landscape)
4. 0 degrees (portrait)

SELECT 1-4: 1
[^[[1;32m^[[40mPITFT^[[0m] Checking init system...
Found systemd
/boot is mounted
[^[[1;32m^[[40mPITFT^[[0m] System update
Updating apt indexes...
...
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

......
Reading package lists...
.........
[^[[1;32m^[[40mPITFT^[[0m] Installing Python libraries & Software...
Installing Pre-requisite Software...This may take a few minutes!
[^[[1;32m^[[40mPITFT^[[0m] Updating /boot/config.txt...
Already have an adafruit-pitft-helper section in /boot/config.txt.
Removing old section...
[^[[1;32m^[[40mPITFT^[[0m] Updating SysFS rules for Touchscreen...
[^[[1;32m^[[40mPITFT^[[0m] Updating TSLib default calibration...
Would you like the console to appear on the PiTFT display? [y/n] n
[^[[1;32m^[[40mPITFT^[[0m] Making sure console doesn't use PiTFT
Removing console fbcon map from /boot/cmdline.txt
Screen blanking time reset to 10 minutes
Would you like the HDMI display to mirror to the PiTFT display? [y/n] y
[^[[1;32m^[[40mPITFT^[[0m] Adding FBCP support...
Installing cmake...
Downloading rpi-fbcp...
/tmp /home/pi
Uncompressing rpi-fbcp...
Building rpi-fbcp...
Installing rpi-fbcp...
/home/pi
Remove fbcp from /etc/rc.local, if it's there...
We have systemd, so install fbcp systemd unit...
Setting raspi-config to boot to desktop w/o login...
Configuring boot/config.txt for forced HDMI
Using x2 resolution
[^[[1;32m^[[40mPITFT^[[0m] Updating X11 default calibration...
[^[[1;32m^[[40mPITFT^[[0m] Success!

Settings take effect on next boot.

REBOOT NOW? [y/N] n
Exiting without reboot.
^[]0;pi@raspberrypi: ~^G^[[01;32mpi@raspberrypi^[[00m:^[[01;34m~ $^[[00m exit
exit

Script done on 2020-10-02 23:45:04+01:00 [COMMAND_EXIT_CODE="0"]



After I stopped the script, i promptly rebooted and tried evtest again.

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo evtest /dev/input/touchscreen
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "stmpe-ts"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     4095
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
Testing ... (interrupt to exit)


But still no input. When trying to run the calibration scripts that you alluded to in the previous post
Code: Select all | TOGGLE FULL SIZE
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
, I am only met with a blank screen with a blinking cursor in the upper left-hand corner, no crosshairs what to speak of.

Screen Shot 2020-10-02 at 3.52.42 PM.png
Screen Shot 2020-10-02 at 3.52.42 PM.png (789.05 KiB) Viewed 110 times


Also, here is the output of ls -l /dev/input/
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ ls -l /dev/input/
total 0
drwxr-xr-x 2 root root     140 Oct  2 23:45 by-id
drwxr-xr-x 2 root root     160 Oct  2 23:45 by-path
crw-rw---- 1 root input 13, 64 Oct  2 23:45 event0
crw-rw---- 1 root input 13, 65 Oct  2 23:45 event1
crw-rw---- 1 root input 13, 66 Oct  2 23:45 event2
crw-rw---- 1 root input 13, 67 Oct  2 23:45 event3
crw-rw---- 1 root input 13, 68 Oct  2 23:45 event4
crw-rw---- 1 root input 13, 69 Oct  2 23:45 event5
crw-rw---- 1 root input 13, 63 Oct  2 23:45 mice
crw-rw---- 1 root input 13, 32 Oct  2 23:45 mouse0
crw-rw---- 1 root input 13, 33 Oct  2 23:45 mouse1
lrwxrwxrwx 1 root root       6 Oct  2 23:45 touchscreen -> event5


Any other thoughts or ideas?

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Mon Oct 05, 2020 10:04 am

I see there has been a lot of people struggling with getting the display going. One user account suggests that the configuration script might be doing something incorrectly.

Are you able to see your spi devices in `dmesg` and the /dev/*spi* tree?

Please take a look at the PDF that one of our forum users put together in this thread.

viewtopic.php?f=50&t=164996&p=810195&hilit=pitft+plus+touch#p810195

mikeysklar
 
Posts: 1958
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Tue Oct 06, 2020 3:10 pm

I'm going to start over this morning with raspbian lite, as this is something that I haven't tried yet. I will post the output of dmesg | grep spi when it's done and if there is still no luck.

I'm not sure how to check the device tree for traces of spi, how would you recommend going about that?

I have to say that these screens either work or cause headaches. I'm wondering if this is a hardware issue at this point, perhaps it has a bad touch layer.

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Tue Oct 06, 2020 3:45 pm

Still no touch capability after that. Here are the results of dmesg:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ dmesg | grep spi
[    6.555391] stmpe-spi spi0.1: stmpe610 detected, chip id: 0x811
[    8.798899] input: stmpe-ts as /devices/platform/soc/3f204000.spi/spi_masterspi0/spi0.1/stmpe-ts/input/input5
[    8.852476] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB buffer memory, fps=33, spi0.0 at 64 MHz
pi@raspberrypi:~ $

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Tue Oct 06, 2020 4:04 pm

Okay so I figured out my way around the devicetree. Here are two text files.

The first is the output of:
Code: Select all | TOGGLE FULL SIZE
dtc -I fs /sys/firmware/devicetree/base

full_device_tree.txt
(50.6 KiB) Not downloaded yet


The second is the output of:
Code: Select all | TOGGLE FULL SIZE
dtc -I fs /sys/firmware/devicetree/base | grep spi

devicetree_spi.txt
(9.78 KiB) Downloaded 1 time


What should we be looking for in here? Just as a refresher, this is on a fresh install of Raspbian Lite, current build, followed the instructions from the Lady Ada guide.

Code: Select all | TOGGLE FULL SIZE
sudo evtest /dev/input/touchscreen
brings up the interface on the screen but does not register inputs.

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Tue Oct 06, 2020 5:49 pm

What is the result of :

Code: Select all | TOGGLE FULL SIZE
ls /dev/*spi*

mikeysklar
 
Posts: 1958
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Tue Oct 06, 2020 6:31 pm

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ ls /dev/*spi*
ls: cannot access '/dev/*spi*': No such file or directory


Here are all the contents of /dev/
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:/dev $ ls
autofs           initctl       ram1     tty10  tty35  tty6       vcsa3
block            input         ram10    tty11  tty36  tty60      vcsa4
btrfs-control    kmsg          ram11    tty12  tty37  tty61      vcsa5
bus              log           ram12    tty13  tty38  tty62      vcsa6
cachefiles       loop0         ram13    tty14  tty39  tty63      vcsm
char             loop1         ram14    tty15  tty4   tty7       vcsm-cma
console          loop2         ram15    tty16  tty40  tty8       vcsu
cpu_dma_latency  loop3         ram2     tty17  tty41  tty9       vcsu1
cuse             loop4         ram3     tty18  tty42  ttyAMA0    vcsu2
disk             loop5         ram4     tty19  tty43  ttyprintk  vcsu3
dma_heap         loop6         ram5     tty2   tty44  uhid       vcsu4
dri              loop7         ram6     tty20  tty45  uinput     vcsu5
fb0              loop-control  ram7     tty21  tty46  urandom    vcsu6
fb1              mapper        ram8     tty22  tty47  v4l        vhci
fd               media0        ram9     tty23  tty48  vchiq      video10
full             media1        random   tty24  tty49  vcio       video11
fuse             mem           raw      tty25  tty5   vc-mem     video12
gpiochip0        mmcblk0       rfkill   tty26  tty50  vcs        video13
gpiochip1        mmcblk0p1     serial1  tty27  tty51  vcs1       video14
gpiochip2        mmcblk0p2     shm      tty28  tty52  vcs2       video15
gpiochip3        mqueue        snd      tty29  tty53  vcs3       video16
gpiomem          net           stderr   tty3   tty54  vcs4       watchdog
hidraw0          null          stdin    tty30  tty55  vcs5       watchdog0
hidraw1          ppp           stdout   tty31  tty56  vcs6       zero
hidraw2          ptmx          tty      tty32  tty57  vcsa
hidraw3          pts           tty0     tty33  tty58  vcsa1
hwrng            ram0          tty1     tty34  tty59  vcsa2

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Tue Oct 06, 2020 8:11 pm

Let's start with the SPI issue.

PiTFT displays use SPI to communicate, so make sure that’s enabled using the raspi-config utility:


https://learn.adafruit.com/adafruit-pit ... pace-tools

Code: Select all | TOGGLE FULL SIZE
sudo raspi-config


You will want to run the above command and make sure SPI is enabled under "Interfacing Options".

It is a good sign your dmesg is finding the device.

The PiTFT should mirror the contents of the Raspberry Pi’s HDMI output at this point. Text and everything will be microscopic, but we’re just checking that the program runs. If not, confirm that the file /dev/spidev0.0 exists — this should happen when SPI is enabled. Double-check raspi-config and it never hurts to reboot.

mikeysklar
 
Posts: 1958
Joined: Mon Aug 01, 2016 8:10 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Tue Oct 06, 2020 8:31 pm

From my config.txt:

Code: Select all | TOGGLE FULL SIZE
# --- added by adafruit-pitft-helper Tue  6 Oct 20:11:51 BST 2020 ---
hdmi_force_hotplug=0
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft28-resistive,rotate=90,speed=64000000,fps=30
# --- end adafruit-pitft-helper Tue  6 Oct 20:11:51 BST 2020 ---


went into raspi-config and enabled it again, after a reboot, still no /dev/spidev0.0

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Tue Oct 06, 2020 8:34 pm

Also from following the directions on the troubleshooting page that you had linked:

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~/Adafruit_Userspace_PiTFT-master $ sudo ./tftcp
Can't open /dev/spidev0.0 (try 'sudo')

aaaltomare
 
Posts: 17
Joined: Thu Sep 03, 2020 6:44 pm

Please be positive and constructive with your questions and comments.