I recently resumed a project I started years ago to make a simple alarm clock with a Pi (Original Model B) and a 2.8" PiTFT (with the buttons at the bottom).
I am not sure what is going on, but suddenly, the touch aspect of the screen is not working. And it's not only with this particular pairing; I had another Pi B laying around, as well as a Pi 2 and purchased another brand new Pi 2 and a brand new assembled PiTFT, and keep having the same problem. I had cobbled together the basics of my project, and was doing fine with pygame. I'm able to display images/videos, as well as program to the pitft with python. However, in all of the combinations I have tried, suddenly the touch doesn't work. I have gone through the installation tutorial at least 10 times to see where I missed a step. I'm not really sure where to look anymore.
There are two things going on that I feel are the key to solving this problem:
1) In dmesg, I see this error:
Code: Select all
edt_ft5x06 1-0038: touchscreen probe failed
edt_ft5x06: probe of 1-0038 failed with error -121
I can load the stmpe-ts module, but it doesn't seem to make any difference. I get no /dev/input/touchscreen or /dev/input/event entries no matter what I try. The display continues to work and my program runs without error if (see below).
2) In my code, if I include the references to the touchscreen that are passed to pygame, I get an error about the video subsystem not being initialized. If I comment out the two lines referring to the touchscreen, the code runs without error. These are the lines that are causing the error (If I comment out the two SDL_MOUSEDRV lines, everything goes fine):
Code: Select all
def initializePygame(screenSize):
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
os.environ["SDL_MOUSEDRV"] = "TSLIB"
pygame.init()
pygame.mouse.set_visible(False)
return pygame.display.set_mode(screenSize)
Code: Select all
for event in getEvent():
if event.type == TOUCHEVENT:
pos = getTouchPosition()
print("screen pressed" + str(pos))
I really don't know where else to look. I don't believe that it is a soldering issue, as the screen works, and I had the same errors with the brand new pitft that I tried. This same exact issue comes up with two separate Pi 1s and Pi 2s, as well as two separate PiTFTs. I have activated the SPI and I2C interfaces in raspi-config. I had been using the 2013-3-13 image, which was working just fine. Right now, I just used the newest raspbian-lite, and ran the Easy Install script over it, which ran without error. My code will run just fine without the touchscreen lines active in the file.
I had this all working fine for weeks, and I am missing something very stupid and/or small.
I am hoping that someone can help me see what I am doing wrong. I really believe it is a step or setting that I am missing, but I can't see it!
Thanks in advance for any help you can provide.