mholgatem / gpioneer

A python GPIO controller
MIT License
33 stars 6 forks source link

Issues with RetroPie #1

Closed Plaputta closed 8 years ago

Plaputta commented 8 years ago

I have some issues getting your script running with RetroPie 3.2.1:

  1. The script doesn't work right away because it can't import the RPi.GPIO. I solved this like mentioned here: http://raspberrypi.stackexchange.com/questions/27407/importerror-no-module-named-gpio $ sudo apt-get install mercurial $ sudo pip install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
  2. After rebooting, the inputs are not recognized, until I connect a USB-Keyboard (I can disconnect it right after it has been recognized), then the GPIO inputs work until the next reboot.

Any ideas?

Thank you!

(Btw, I love your script because it's the only trick I found so far to properly use RetroPie with only 1 Joystick and 3 Buttons by mapping combos. Thank you!)

mholgatem commented 8 years ago

Give this a shot:

sudo nano /etc/udev/rules.d/10-gpioneer.rules

Once the nano text editor loads, copy this single line into the file:

SUBSYSTEM=="input", ATTRS{name}=="GPioneer", ENV{ID_INPUT_KEYBOARD}="1"

Save the file by pressing Ctrl-O and enter, then press Ctrl-x to exit. Restart your Raspberry Pi and run retrogame again, now button presses should register in SDL2 applications like the EmulationStation frontend to RetroPie

Plaputta commented 8 years ago

That line is already there, your installer worked fine despite the problem with the library..

It's also not EmulationStation related.

Even when in the console, pressing the buttons or joystick does nothing at first - after shortly attaching and detaching a USB keyboard, the buttons and joystick presses print their assigned keys to the console line.

mholgatem commented 8 years ago

ok, the only two things that I can think of trying at the moment would be this:

nano /etc/modules

check to make sure that uinput is listed (add it if it's not)

The other would be

sudo raspi-config

choose option 4 - Internationalisation Options, then I3 - Change Keyboard Layout If it gives you the option, select a default key mapping for your keyboard

I'll ask around to see if anyone has any ideas.

Plaputta commented 8 years ago

Hi,

thanks again for your reply!

The uinput was already there but because of that hint I compared the "lsmod" output before and after plugging in the keyboard: the "evdev" module was missing.

I added the "evdev" module to /etc/modules and now the controls work right away without any real keyboard attached!

Thank you very much!

mholgatem commented 8 years ago

Awesome! I'll add that to the install script then. Glad we got it working!