Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with AdaFruit touchscreen #3

Open
FrankPGH opened this issue Nov 22, 2020 · 10 comments
Open

Trouble with AdaFruit touchscreen #3

FrankPGH opened this issue Nov 22, 2020 · 10 comments

Comments

@FrankPGH
Copy link

FrankPGH commented Nov 22, 2020

The application works great and I love the new graphic layout, but I've been struggling with the 3.5" 480x320 AdaFruit touchscreen. I'm doubting it's the application, but the touchscreen test and calibration tools all work fine. When I run screen.py, however, the touchscreen buttons don't work at all. If I set the application resolution to 320x240, the touch registration areas are rotated 90 degrees, right along the side edge of the screen, so only a selection are accessible. I surmise that at 480x320, they're off the edge of the screen completely. Is this something you've run into with the AdaFruit screen and do you have any suggestions? The documentation is kind of a mix of old (LCD plate) and new, so piecing it together is a little challenging.

@devdupont
Copy link
Owner

My initial guess is that PyGame is not understanding the display properties. Not sure what's going on yet. What happens if you run it as 320x240 with fullscreen disabled?

@FrankPGH
Copy link
Author

I've tried on 320x240 but I'm not sure how to disable fullscreen. I agree that this is either a pygame or an SDL problem. It looks like current versions of RPI have some issues with Adafruit touchscreens. So far, the various forum postings I've seen either haven't worked or are a year or more out of date.

@devdupont
Copy link
Owner

Fullscreen is a setting in config.py. The out of date postings would make sense since that's when the last update happened.

@FrankPGH
Copy link
Author

Looks like this is going to end up being a non-starter. Pygame seems to be joined to libsdl1.2 at the hip while the rest of the world has moved on. The last working version I can find is Wheezy, which is years old and doesn't play nice with RPI 4. Even patching libsdl as noted in some forum posts hasn't worked. The combination of RPI 4, Adafruit, and pygame/libsdl isn't happening.

@helloworld123YY
Copy link

couldn't get my adafruit 2.8 TFT to work; too many screen.py errors when trying to import avwx data. darn.

@devdupont
Copy link
Owner

Unsure if this was you. Just got an email with the error trace which tails with:

    from .search import search
  File "/home/pi/.local/lib/python3.7/site-packages/avwx/station/search.py", line 10, in <module>
    from rapidfuzz import fuzz, process  # type: ignore
  File "/home/pi/.local/lib/python3.7/site-packages/rapidfuzz/__init__.py", line 8, in <module>
    from rapidfuzz import process, fuzz, utils, levenshtein, string_metric
  File "/home/pi/.local/lib/python3.7/site-packages/rapidfuzz/process.py", line 7, in <module>
    from rapidfuzz.cpp_process_cdist import cdist
  File "cpp_process_cdist.pyx", line 1, in init cpp_process_cdist
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject

The avwx-engine library uses rapidfuzz for fuzzy string searching, but the Pi doesn't appear to have the needed C binary with the install. Wouldn't be an issue otherwise since this project doesn't use it.

I can update the library code to handle a bad import and disable the search functions rather than error at runtime.

@spenadel
Copy link

spenadel commented Dec 29, 2021 via email

@bjustison
Copy link

bjustison commented Dec 30, 2021 via email

@devdupont
Copy link
Owner

Pushed an update for version numbers. Should hopefully help. Checked that it runs fine with the pygame 1.x to 2.x upgrade. Let me know if you're still getting screen errors.

@helloworld123YY
Copy link

helloworld123YY commented Jan 1, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants