pmb-pitft icon indicating copy to clipboard operation
pmb-pitft copied to clipboard

Can only start ui.py one time hangs on reconnect?

Open mrWheel opened this issue 10 years ago • 2 comments

Hi, I have followed your excellent instructions to install everything for the Adafruit PiTFT 2.8"resistive display. Now everything works until something goes wrong ;-) If I start ui.py for the first time I get the following info:

0.17.0
0
fbcon

And than it all works great. If ui.py crashes or if I 'pkill -9 ui.py' and than start ui.py again I only get the first two lines of information:

0.17.0
0

I have to press <Ctrl>+C or 'pkill ui.py' and then I get the messages:

fbcon
Not connected
'ConnectionError' object has no attribute 'errno'
Connection Established!

Am I doing something wrong? Can it be fixed? Thanks in advance!

mrWheel avatar Jan 16 '15 10:01 mrWheel

Newest commit should fix this. You should try it and report back. Thanks.

edit: Forgot to add import for that commit, but its fixed now.

ISO-B avatar Jan 19 '15 18:01 ISO-B

I will try this today.

Could you please, in pitft-ui.py, change the lines 431-432 from

430    if coverart_url:
431                 subprocess.check_output("wget -q --limit-rate=40k %s -O %s/cover.png" % (coverart_url, self.path), shell=True )
432                 coverart=pygame.image.load(self.path + "cover.png")
433                 self.image["cover"] = pygame.transform.scale(coverart, (163, 163))

to:

430  if coverart_url:
431                  subprocess.check_output("wget -q --limit-rate=40k %s -O %s/cover.png" % (coverart_url, "/tmp/"), shell=True )
432                  coverart=pygame.image.load("/tmp/" + "cover.png")
433                  self.image["cover"] = pygame.transform.scale(coverart, (163, 163))

So the script can be run on a RO filesystem? Also, does adding the next two lines after 34 in ui.py interfere with normal operation? They are needed when using a USB-DAC so pygame does not lock the USB audio DAC.

os.environ["SDL_AUDIODRIVER"] = "disk"
os.environ["SDL_PATH_DSP"] = "/dev/null"

Would be nice if you could add them to the source.

mrWheel avatar Jan 20 '15 08:01 mrWheel