Retropie error trying to use 2nd screen to display rom art and options with 2 switch's for select and option scrolling.
-
Hi All
was reading a few post from @moosepr and thought you guys seem like the ones to ask.
I have a raspberry pi setup with retropie and am trying to make a 2nd screen to display rom art and options with 2 switch's for select and option scrolling. I'm using a Raspberry pi 2b & 3b+ and have a ILI9341 2.2 inch screen. I found a script that seems to do the trick (with my screen type/model) but unlike for the creator it does not work for me.
He has it working with a screen built into a 3d printed arcade hub and looks amazing he has detailed plans here.
Walkthrough: https://romtastick.grousset.fr/#/
Printable files: https://www.thingiverse.com/thing:2478934
might make the whole thing sometime if worked. he also has 3 other models that are not with screen on there.
The creator does not seem to be around anymore as I cannot get hold of him (tried several methods).
please can someone help.
script is here:
https://github.com/zippy1978/RomTaStickitalicised text
to install:
Quick edit when installing the pillow 1 module failed to install so had to run this first to fix it:
sudo apt-get install libtiff-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl-dev tk-dev python-tk
failed module was "sudo pip install Pillow"
git clone https://github.com/zippy1978/RomTaStick.git RomTaStick
cd RomTaStick
./install.sh
restart EmulationStation or the whole system
to configure:
enable SPI via: sudo raspi-config - Interfacing options - spi - enable yes.
From EmulationStation - setlect Retropie - ROMTASTICK - enable 2nd screen ili9341 - ok
ERROR
(when I first did this I got an error as there was a problem with a file "/home/pi/RomTaStick/bin/read_value.py" I did not have execute access. So I used ssh to go into the file and give execute permissions to the owner. then it worked and aloud me to select the option)now everything should work but I am getting an error everytime I load or exit a game I get error "failed to push event".
So nothing comes up on my screen.
from the look of it its using python 2.7.
(not going to start on the screen setup as it doesn't matter if the code isn't working, plus I tested my screen with other scripts and its working fine so would just need to tweek the DC and RST GPIO ports)I have check all the scripts and cannot find the problem basically after everything is setup it does the following.
you launch a game so it runs "/opt/retropie/configs/all/runcommand-onstart.sh" (has a script there for when a game ends too.
The launch game script:#!/bin/sh
#/home/pi/RomTaStick/bin/game_info.py --system "$1" --rom "$3"
/home/pi/RomTaStick/bin/push_event.py --type start_game --data "{"system":"$1","rom":"$3"}"The file its calling does as following:
#!/usr/bin/env python
-- coding: utf-8 --
import argparse
import sys
import json
import requestssys.path.append('../lib')
sys.path.append('/home/pi/RomTaStick/lib')from service.http_service import *
parser = argparse.ArgumentParser(description='Push external event to service.')
parser.add_argument('--type', help='Event type', type=str, required=True)
parser.add_argument('--data', help='Event data as JSON', type=str, required=False)Parse input
args = parser.parse_args()
Post
server = HTTPService()
try:
# Decode JSON data
data = None
if args.data != None:
data = json.loads(args.data)
# Prepare JSON message
json_data = {}
json_data['data'] = data
json_data['type'] = args.type
requests.post(('http://localhost:%s/event' % server.port), data=json.dumps(json_data))
except ValueError:
print('Failed to parse data')
sys.exit(1)
except:
print('Failed to push event')
sys.exit(1)Can anyone help as I cant seem to find the issue.
Hopefully some one can help and at least confirm that the wiring of the screen or the 2 switch buttons would have no bearing on the error above.
as I have been working on this for a while now.Thanks any help would be amazing!!!
-
I fixed it after writing it all out above I figured it out.
First off I needed to run the below and reboot as it turns out not all functions where doing there job:
sudo apt-get install build-essential python-dev python-smbus python-pip python-imaging python-numpy git
Then when you restart the error goes away.
Also the site has the GPIO pins incorrect as it should of been as follows.
Now all works with options and game name displaying will check album art later.
-
I too found this arcade 3D print and had huge problems getting the diplay to work. Thanks to this old post I got it working after all. For all of you who also stumble over this post the code that has to be executed has changed a bit: "sudo apt-get install build-essential python-dev python-smbus python-pip python-pil python-numpy git" otherwise it aborts with an error.
Thanks watson49 for posting your solution. I wouldn't have been able to do it otherwise!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.