0

pygame problem with adafruit-pitft on raspbian jessie
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: pygame problem with adafruit-pitft on raspbian jessie

by adafruit2 on Wed Apr 25, 2018 2:38 pm

spoth, whee linux! what exact hardware are you using?

adafruit2
Site Admin
 
Posts: 17498
Joined: Fri Mar 11, 2005 7:36 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by spotrh on Wed Apr 25, 2018 2:55 pm

PiTFT 2.8 capacitive screen, Raspberry Pi 3.

spotrh
 
Posts: 4
Joined: Mon Jun 25, 2012 3:34 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by spotrh on Wed Apr 25, 2018 2:59 pm

Another useful datapoint: I have a jessie based Raspbian image and it works properly, with libsdl1.2debian 1.2.15-5 and libts-0.0-0 1.0-12

spotrh
 
Posts: 4
Joined: Mon Jun 25, 2012 3:34 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by adafruit2 on Wed Apr 25, 2018 3:22 pm

capacitive touch broke in the console, its 'mouse only' - we dont have a fix right now. its a device driver change :(

adafruit2
Site Admin
 
Posts: 17498
Joined: Fri Mar 11, 2005 7:36 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by spotrh on Wed Apr 25, 2018 4:39 pm

Bummer. We will keep using the jessie image for now, but if you find a fix for this, please update the thread!

spotrh
 
Posts: 4
Joined: Mon Jun 25, 2012 3:34 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by adafruit2 on Wed Apr 25, 2018 4:43 pm

thanks for understanding!

adafruit2
Site Admin
 
Posts: 17498
Joined: Fri Mar 11, 2005 7:36 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by nnifinn on Fri May 18, 2018 3:40 am

I experienced similar issues with the touchscreen reading incorrect values in pygame (Pi Zero W, Raspbian Stretch 3/14/18, 3.5" PiTFT, easy install script, tslib calibration worked) and after awhile trying different solutions online, I found that adding two lines to my code makes it work correctly. Turns out I needed to read further down in the linked pygame tutorial!

Code: Select all | TOGGLE FULL SIZE
os.environ["SDL_MOUSEDRV"] = "TSLIB"
os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"


Hope this helps.

nnifinn
 
Posts: 1
Joined: Fri May 18, 2018 2:26 am

Re: pygame problem with adafruit-pitft on raspbian jessie

by willcooke on Fri May 25, 2018 11:55 am

Joshb08 wrote:The installsdl.sh script in the tutorial needs to be updated again. If you run it as-is you get:

Code: Select all | TOGGLE FULL SIZE
E: The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources


"stable" is no longer valid for wheezy, instead it needs to be "oldstable" The fix is to change line 8 in the script to:

Code: Select all | TOGGLE FULL SIZE
echo "APT::Default-release \"oldstable\";


It works great with that change.



This needs updating again, this time to "oldoldstable".
willcooke
 
Posts: 2
Joined: Fri Jan 03, 2014 3:33 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by adafruit2 on Fri May 25, 2018 1:03 pm

will, can you verify what version of the Raspbian OS you're using so we can replciate/check? thx!

adafruit2
Site Admin
 
Posts: 17498
Joined: Fri Mar 11, 2005 7:36 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by przemo on Wed Jul 04, 2018 5:49 pm

Anyone know what is the actual problem in libsdl? We're dealing with workarounds for ~3 years. Maybe we can fix it upstream? I don't see any bug reports in SLD bugzilla [1]

[1] https://bugzilla.libsdl.org/

Edit: bug filled: https://bugzilla.libsdl.org/show_bug.cgi?id=4212
Edit2: I'll try with SDL crowd directly: https://discourse.libsdl.org/t/pitft-ca ... lems/24664
Last edited by przemo on Wed Jul 04, 2018 7:08 pm, edited 2 times in total.

przemo
 
Posts: 43
Joined: Tue Jul 22, 2014 4:28 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by adafruit2 on Wed Jul 04, 2018 5:54 pm

we recently udpated the guide - but yeah pygame and the touch support is still dependant on libsdl 1.2 as far as we know!

adafruit2
Site Admin
 
Posts: 17498
Joined: Fri Mar 11, 2005 7:36 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by przemo on Wed Jul 04, 2018 7:31 pm

This is strange..
1. I went back to libsdl1.2.15-5
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ dpkg -l | grep libsdl
ii  libsdl-image1.2:armhf          1.2.12-5+deb8u1                   armhf        Image loading library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-mixer1.2:armhf          1.2.12-11+b1                      armhf        Mixer library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-ttf2.0-0:armhf          2.0.11-3                          armhf        TrueType Font library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl1.2debian:armhf          1.2.15-5                          armhf        Simple DirectMedia Layer
rc  libsdl2-2.0-0:armhf            2.0.2+dfsg1-6                     armhf        Simple DirectMedia Layer
rc  libsdl2-image-2.0-0:armhf      2.0.0+dfsg-3+deb8u1               armhf        Image loading library for Simple DirectMedia Layer 2, libraries
rc  libsdl2-mixer-2.0-0:armhf      2.0.0+dfsg1-5                     armhf        Mixer library for Simple DirectMedia Layer 2, libraries
rc  libsdl2-ttf-2.0-0:armhf        2.0.12+dfsg1-2                    armhf        TrueType Font library for Simple DirectMedia Layer 2, libraries

and now I'm getting a new error message:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
xres = 240, yres = 320
selected device is not a touchscreen I understand
^Csignal 2 caught
pi@raspberrypi:~ $ sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test
selected device is not a touchscreen I understand
^Csignal 2 caught

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ sudo python3 pygame_test.py
selected device is not a touchscreen I understand

evtest works OK as far as I can tell. Do I need adafruit kernel?

przemo
 
Posts: 43
Joined: Tue Jul 22, 2014 4:28 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by adafruit2 on Wed Jul 04, 2018 10:51 pm

is this capacitive touch?

adafruit2
Site Admin
 
Posts: 17498
Joined: Fri Mar 11, 2005 7:36 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by przemo on Thu Jul 05, 2018 5:22 am

adafruit2 wrote:is this capacitive touch?

Yes

przemo
 
Posts: 43
Joined: Tue Jul 22, 2014 4:28 pm

Re: pygame problem with adafruit-pitft on raspbian jessie

by przemo on Thu Jul 05, 2018 7:04 am

That looks like a potential solution [1]. I'll report back if it works.

[1] https://github.com/turboturbonet/ft6236-pitft

Edit: I'm trying to follow [2], and output of "dmesg | grep ft6" is empty!

[2] https://learn.adafruit.com/adafruit-2-8 ... ouchscreen

przemo
 
Posts: 43
Joined: Tue Jul 22, 2014 4:28 pm

Please be positive and constructive with your questions and comments.