Raspberry Pi Zero built into a NES Controller (Buttons won't work in Retroarch, but do work in Emulationstation) [SOLVED]
-
Hey,
i did build a Zero into an original NES Controller, wired up the Buttons (Up, Down, Left, ...., B, A) and created a dts-overlay so it will be recognized as a keyboard.
The Buttons work in Emulationstation and in the Ports, but i cant get them to work in Retroarch (NES/SNES/Megadrive...)
i did find this tutorial but i think im missing something important https://hackaday.io/post/28804
Did even try to map the keys directly in retroarch, but it wont recognize and button press, the attached USB keyboard works, which sends the same commands
If i reconfigure the Controller it shows up as keyboard and it doesnt matter if i press the keyboard or the buttons on the NES they act like the same
Any help is appreciated!!
br
NeoTrace -
@NeoTrace
Wow! Great work! :-)I'm not sure, but I think this issue have something related to the
input_libretro_device_p1
option in retroarch.cfg. I've read these comments in the file, and I think it can help you to solve your problem.Try to set it to 3 and see if it works, like this:
input_libretro_device_p1 = 3
-
Thanks for the tip
I do think I have tried that before but I will give it another try -
any other suggestions?
-
@NeoTrace sorry for the lack of a concrete help, I'm away from my RetroPie now. But I suggest you to search in the RGUI
Settings
->Input
section for something related to your problem. -
If I'm understanding you correctly, it seems as though your controller is configured as a series of keyboard keys. RetroArch can be a bit picky about what it sees as a keyboard. I have a few controllers mapped to keyboard keys and I have to add a udev rule that makes sure the device is actually seen as a keyboard at a system level.
The rule I use is:
SUBSYSTEM=="input", ATTRS{name}=="The Name of Your Device Goes Here", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
Edit: If this does apply to you and you are unfamiliar with creating a udev rule, I can walk you through it.
-
the thing is the usb keyboard attached which sends the same signals do work in retroarch.
does your tip the trick?
-
It worked for me in what seems to be similar circumstances, but our situations may be different. The easiest way to find out is to try it. You can always remove the udev rule if you need to.
-
allright then :)
silly question where do i put this?
-
@NeoTrace said in Raspberry Pi Zero built into a NES Controller (Buttons won't work in Retroarch, but do work in Emulationstation):
silly question where do i put this?
Not silly at all.
First, drop to the command line by pressing the 'F4' key on your keyboard. from there type:
sudo nano /etc/udev/rules.d/99-keyboard.rules
Press enter and then type the rule into the empty field as follows:
SUBSYSTEM=="input", ATTRS{name}=="The Name of Your Device Goes Here", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
If you need to get the name of your device, do a 'evtest' on the proper event listing at
/dev/input/
and the name will be at the top. If you need to know more about that I can elaborate. Next, save the rule and close it out by pressing 'ctrl+o' to save, 'enter' to confirm and 'ctrl+x' to exit. Finally, type:sudo reboot
Press enter and when it reboots, you should be able to enter RetroArch and test to see if the controls are recognized. You might have to remap in Emulation Station also, but I don't think it will be necessary. It's also worth repeating for others who might try this, that this trick is specifically intended for a controller device that is already configured to present itself as a keyboard, but fails to be recognized as a keyboard by some software.
-
thank you, will try it out in a second :)
-
Thank you so much, that did the trick!
Working now :) -
@mediamogul Hey, i'm kinda new to this and having the same problem. Wired up with GPIOs, compiled the overlay, and is working in ES, but it's not working within the emulators. i did what you said above, but since i'm not a pro at this, i'm not sure if i typed it and executed it correctly. Do i change any of the other quotes besides the Device Name (which is retropie by default, right)?
i've mapped the buttons again in ES and restarted the Pi a couple of times. i tried mapping it inside of the RetroArch menu too, but the button presses won't register in there, only in ES. The funny thing is that i noticed it registers the button presses for the USB controller as the same keyboard presses that i have my GPIO controller buttons set at. I'm doing all this with a Pi Zero that i'm trying to fit inside a NES controller :) Thanks for any help.
-
@KairosZenith said in Raspberry Pi Zero built into a NES Controller (Buttons won't work in Retroarch, but do work in Emulationstation) [SOLVED]:
Do i change any of the other quotes besides the Device Name (which is retropie by default, right)?
The device name is actually not 'retropie', but instead the name of your specific input device. You can get that name using
evtest
. The full command isevtest /dev/input/eventX
, with 'X' being the event number of your device. The resulting text output from the command will list the name at the top. -
everything has been said :D
-
@mediamogul Thank you so much for the fast reply, that worked :)
That made sense, i feel so foolish, lol. i should've known you were talking about the input device because that's what the discussion was about. The name for it was "gpio_keys".
-
Nice! I'm glad it worked.
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.