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.

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Wed Oct 07, 2020 2:39 pm

As I understand it the display is being used by the OS and taking up the SPI device so it will not be available in the /dev tree once configured. It is this line in config.txt that is triggering the display to take SPI0.

I did see an example passing the touch components the driver in config.txt. Could you try this?

Code: Select all | TOGGLE FULL SIZE
dtoverlay=pitft28-resistive,rotate=90,speed=64000000,fps=30,touch-swapxy,touch-invx


Also does the touchmouse utility work for you?

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

Code: Select all | TOGGLE FULL SIZE
cd Adafruit_Userspace_<chrome_find class="find_in_page">PiTFT</chrome_find>-master
sudo python touchmouse.py

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

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Wed Oct 07, 2020 5:11 pm

So I changed that line in the config.txt and rebooted, ran
Code: Select all | TOGGLE FULL SIZE
sudo evtest /dev/input/touchscreen
and still no input.

Then I ran the python touchmouse, see output below:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~/Adafruit_Userspace_PiTFT-master $ sudo python touchmouse.py
Namespace(calibration=[0, 0, 4095, 4095], chip='STMPE', debug=False, outrange=[0, 0, 4095, 4095], rotation=90)
Traceback (most recent call last):
  File "touchmouse.py", line 64, in <module>
    spi.open(0, 1)
IOError: [Errno 2] No such file or directory
Exception TypeError: TypeError('super() takes at least 1 argument (0 given)',) in <bound method InputDevice.__del__ of InputDevice('/dev/input/event6')> ignored

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 08, 2020 10:51 am

@aaaltomare,

I'm slowly coming around to the complexities involved in getting /dev/spidev0.0 to show up and how all of our tools are dependent on it.

Can you try manually load the spidev kernel module?

Code: Select all | TOGGLE FULL SIZE
sudo modprobe spidev


If it worked it you should see it with:

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


and tftcp should work:

Code: Select all | TOGGLE FULL SIZE
cd Adafruit_Userspace_PiTFT-master
sudo ./tftcp


If the module will not load we might need to remove ads7846 which I believe could be blocking spidev.

Code: Select all | TOGGLE FULL SIZE
sudo rmmod ads7846


https://github.com/raspberrypi/linux/bl ... verlay.dts

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 08, 2020 4:29 pm

I will try this but I won't be able to get to it until a little later. In the meantime I'm wondering if you can help me understand something. Are these complications due to recent updates to the raspberry pi OS? I'm curious as to why this driver would be provided and marketed as an easy install if it weren't plug-in-play. Or is this relatedspecifically to my situation somehow?

Thanks for your help, I will get back to you in a little while once I've had a chance to test this new operation.

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 08, 2020 6:53 pm

Okay here we go:

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:/dev $ sudo modprobe -v spidev
insmod /lib/modules/5.4.51+/kernel/drivers/spi/spidev.ko
pi@raspberrypi:/dev $ ls /dev/spidev*
ls: cannot access '/dev/spidev*': No such file or directory
pi@raspberrypi:/dev $ sudo rmmod ads7846
rmmod: ERROR: Module ads7846 is not currently loaded


So spidev doesn't load into /dev/, the ads7846 overlay isn't loaded and the touchscreen doesn't work (the screen continues to work as a display, fyi).
Earlier in this thread you had said
As I understand it the display is being used by the OS and taking up the SPI device so it will not be available in the /dev tree once configured
.
If this is the way that the driver/overlay works why are we chasing spidev?

Thank you.

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

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Sun Oct 11, 2020 1:31 pm

I have found mixed discussions in other forums about the ads7846 driver not being needed for the resistive screens and blocking out the necessary spidev if loaded. Since several of the utilities have errored out based on not finding a /dev/spidevX device I was concerned about getting it back.

I take it you have been recreated the necessary udev rule after the fresh install to Raspbian Lite. Can you run this to confirm it is in place.

Code: Select all | TOGGLE FULL SIZE
cat /etc/udev/rules.d/95-stmpe.rules


Does running the manual calibration result in any response?
Code: Select all | TOGGLE FULL SIZE
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate


Unfortunatley, the touchscreen portion seems to have always been a little troubled with the autoconfig script not handling everything, but we would like to resolve that.

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

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Mon Oct 12, 2020 2:50 pm

Yes, I've been checking for that rule. Here is the output of that command:

Code: Select all | TOGGLE FULL SIZE
SUBSYSTEM=="input", ATTRS{name}=="*stmpe*", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"


And when I run the touch calibration command you posted in your last video, I'm met with a blank screen with just a small white dash in the upper right-hand corner.

The output on the terminal reads:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
xres = 320, yres = 240


HOWEVER, when I changed "/dev/fb1" to "/dev/fb0", I get this:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
xres = 640, yres = 480


and then I get the touch calibration interface on the screen. it does not work, though.

Also for full disclosure, after not hearing back for a few days I tried a new install of full raspbian with a GUI to see if I could plunk away at getting this to work. I discovered changing the framebuffer brought that interface up on the last raspbian lite install I had before starting over.

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 13, 2020 6:35 pm

Okay, if your using /dev/fb0 then we might need to adjust /dev/input/touchscreen to /dev/input/touchscreen0.

When you look in /dev/input what do you see?

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


If it is indeed touchscreen0 (or some other final numeric value) then try re-running some of the commands like evtest and ts_calibrate.

Code: Select all | TOGGLE FULL SIZE
TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/touchscreen0 ts_calibrate
xres = 640, yres = 480


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

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 16, 2020 12:46 am

unfortunately there is no /dev/input/touchscreen0, simply /dev/input/touchscreen.

It was a change in the framebuffer that amounted to the programming successfully running, but without registering touch inputs

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate


Is there a way to check to see which framebuffer the screen/touch overlay are actually using and which is being called to listen for inputs?

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

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Fri Oct 16, 2020 12:51 am

Also - I'm not sure if this is of any help or interest, but with nothing else connected to the pi, no keyboard, no mouse, etc, this is the result of running lsinput

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ lsinput
/dev/input/event0
   bustype : BUS_I2C
   vendor  : 0x0
   product : 0x0
   version : 0
   name    : "stmpe-ts"
   phys    : "stmpe-ts/input0"
   bits ev : EV_SYN EV_KEY EV_ABS

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

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by mikeysklar on Sat Oct 17, 2020 5:19 pm

Just grabbing at straws here since the device tree names are all over the place.

Can /dev/input/event0 or /dev/stmpe-ts/input0 be used:

Code: Select all | TOGGLE FULL SIZE
TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate xres = 640, yres = 480


Code: Select all | TOGGLE FULL SIZE
TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/stmpe-ts/input0 ts_calibrate
xres = 640, yres = 480

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

Re: PiTFT Plus 2.8 Resistive Screen - Touch Issues

by aaaltomare on Sun Oct 18, 2020 9:52 pm

Hey sorry for the delay on this, the results of:
Code: Select all | TOGGLE FULL SIZE
TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate xres = 640, yres = 480


are the same as before, it displays the target for the calibration but registers no touch input.

The other command gives me an error:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo TSLIB_FBDEVCE=/dev/fb0 TSLIB_TSDEVICE=/dev/stmpe-ts/input0 ts_calibrate xres = 640, yres = 480
ts_setup: No such file or directory


I'm wondering, do you have one of these touchscreens and a pi near you? I'd be curious to know if you are having the same kind of difficulty setting this up. I've spoken with other who have one and have had very few issues, let alone weeks of troubleshooting. Thanks for your help thus far, I'd really love it if we could get this thing working.

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 19, 2020 11:25 am

@aaaltomare,

It is starting to look like we are looking for the touchscreen on the device name. Is it event0 or event2? Can you try running evtest with no args and see if it outputs a list of devices found and their corresponding inputs?

I don't have a PiTFT 2.8" on hand or I would set it up myself.

Also it might be necessary to not use sudo in front of your testing as it could be dropping the EXPORT libraries when switching to root. Either run the commands as root or yourself if permissions allow it.

Does this command work when you walk through the different event# devices?

Code: Select all | TOGGLE FULL SIZE
export TSLIB_TSDEVICE=/dev/input/event0
ts_uinput -d -v

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

Please be positive and constructive with your questions and comments.