Picade Hat joystick not detected w/out usb keyboard plugged in

I’ve just set up a fresh RetroPie image and installed the Picade HAT software. I’m seeing the same problem as you.

Looks like I’ve got some tinkering to do.

I think I’ve fixed it, using some information I found yesterday when trying to figure out what could be the problem.

Could you grab the picadehatd file from this branch on GitHub? https://github.com/pimoroni/picade-hat/tree/keyboard-detect-fix

There are a few ways to do this, but I’d suggest plugging a keyboard into your RetroPie box and running:

git clone http://github.com/pimoroni/picade-hat -b keyboard-detect-fix
cd picade-hat
sudo cp daemon/usr/bin/picadehatd /usr/bin/picadehatd

And then unplug your keyboard and reboot!

If you’ve set up keyboard controls already, you may have to delete any EmulationStation key bindings to get the Picade HAT controls bound properly.

THAAAAANK YOU! I’ll be giving this an update this evening when I’m back from work!

1 Like

So, one step forward: I can now boot up & navigate emulationstation / attract mode w/out having a USB keyboard plugged in. Hooray! However, I can’t figure out how to reset my key bindings so that I can actually play any games that use Retroarch (advmame controls work fine). I’ve tried deleting the retroarch.cfg file in the opt/all section, copying back in my old ones, but nothing seems to work.

Any idea on how I can restore / reset joystick controls for retroarch? Right now I can’t play any retroarch games (ex: FBA, SNES, etc).

I can’t remember where on earth I found the menu option for it, but I’ll fire up this Picade and find it for you.

Guessing your controls are too messed up to press whatever button is currently bound to “Start” and navigate to “Configure Input”

You should just be able to delete /home/pi/.emulationstation/es_input.cfg

1 Like

Well, the problem is not emulationstation – that (and attract mode) works a treat! The problem now is the underlying “retroarch” system that provides keyboard mappings for the majority of retropie emulators is for some reason not working. So, to be clear:

  • I can navigate ES and Attract Mode w/ no difficulties, including launching games & accessing the “configure input” controls (which didn’t help the problems below)
  • When I launch an emulator that requires retroarch, for some reason the controls do not respond.(I’m guessing a mapping issue somehow? Very vexxing).
  • When I launch an emulator that does not use retroarch (like AdvMame) it runs fine - my old keyboard mappings work great.

I’ll try to delete the es_input configs just in case that helps… thanks for the advice, I’m so close to a fully functional picade-hat powered console!

From what I understand, EmulationStation is supposed to auto-configure RetroArch with the same bindings. This might be useful: https://github.com/retropie/retropie-setup/wiki/retroarch-configuration

Re-configuring the EmulationStation input might fix this functionality. Worth a punt!

OK, I’m totally stumped. If I start w/ the USB keyboard for any retroarch games, I can use the USB keyboard, but the joystick & buttons don’t get recognized at all.

Can you offer any other advice? I’ve deleted the opt/all/retroarch.cfg file, I’ve deleted the es_input file, I’ve looked through all the likely directories, but I’m stuck. This stinks as this means that 90% of the games are now unplayable, even with the keyboard plugged in.

Hi

My advice would be to wipe the SD card and start again. At the moment the config has been changed several times so there is no valid starting point.

I am running a Picade with just the built in controls no keyboard attached and haven’t had any issues.

Cheers

Paul

Oof - I have spent so much time configuring everything & getting all my roms / etc in the right place, configuring it to work w/ attract mode, etc. Starting over would be terrible. Is there any other solution? I don’t want the picade hat to have ruined my previous setup. Note that this is not the standard picade, but the picade hat card I just got.

could it just be that you had a custom keycode mapping implemented in the pcb picade? by default the HAT shares the ‘factory’ keycodes with the AVR/PCB version.

… as @gadgetoid said earlier, EmulationStation is supposed to auto-configure RetroArch. if you deleted es_input.cfg then it should allow you on next run of ES to reconfigure the bindings. Did that happen?

Hi

Sorry I can’t offer any other advice as I find its best to start from a know position when trying to debug issues.

Personally I would have taken a backup before I started.

Cheers

Paul

I deleted the es_input.cfg (it was created again when I restarted) and have gone through input bindings multiple times via emulationstation as well as manually editing retroarch.cfg files (even deleting them), but even though retrorarch.cfg is updated, it doesn’t appear to fix it.

Some more debugging I’ve done:

When I launch an emulator, I’ve also SSH’d in to the Pi so I can issue debugging commands. I ran showkey and was able to confirm that the pi is responding to the joystick / button commands (keycode 103 press, etc), but the emulator does not. What’s strange is that if I plug in a USB keyboard as well, I can see that the OS receives the same commands from the keyboard as the joystick (ex: keycode 103 press is shown for both keyboard & joystick actions), but the emulator will only respond to the action if it’s done from the actual keyboard.

Is there any chance that I need to somehow configure a “named controller” in retroarch? The fix to get emulationstation to respond was captured here:

https://github.com/pimoroni/picade-hat/commit/aab9b1d209c088c6c976aa0289adaae8dec19bbf

The only thing I can guess now is that maybe the input is “named” now (name=“Picade-HAT”) and needs to be specifically identified in retroarch? Can anyone else reproduce this after running the same script that gadgetoid provided earlier in the thread?

Thanks for bearing with me on this!

I have exactly the same issue as martymoo. When this topic first started I discounted it as being the same as mine because I could navigate in emulation station with my Picade joystick, but reading the latest posts it seems to have evolved into the same problem as I have. I’ve a separate forum post on Retropie but with no answer yet either: https://retropie.org.uk/forum/topic/7063/controls-not-working-in-game-ok-on-retropie

Basically, I can fully navigate with all buttons in Retropie, but if I launch a game in SNES or GBA (using libretro emulators), none of the buttons or joystick works, but the keyboard does.

I did a fresh build of Retropie 4.1 last night, and after configuring wifi on my RPi 3 and installing the Picade HAT software, the same issue occurs. I’m sure this is reproducible given my stock setup and it still not working with a fresh image.

I was going to look into showkey but I’ll probably see the same results as martymoo. My next steps were to go back to the USB PCB to see if there’s still an issue.

1 Like

OK - if you manually roll back the “fix to allow daemon detection in ES” (change line 106 back to ui = UInput() ) then you can at least play games with the joystick by booting with a USB keyboard plugged in. This returns back to the original problem of requiring a keyboard at boot. Somehow RetroArch is not picking up on the uiinput command that emulation station is!

right, I was able to reproduce and implement a (hopefully) universal fix… to get it, simply re-run the one-line installer:

curl https://get.pimoroni.com/picadehat | bash

I have tested the fix only with lr-picodrive but since I was in the dead end you described after implementing @gadgetoid earlier workaround I think it’s hopeful it will work with all libretto emulators (can’t speak of the others, I have no roms to test them with).

if that still does not work for you, check there is a udev rule at:

/etc/udev/rules.d/10-picadehatd

and check that evtest has a virtual input device named exactly “Picade-HAT” (it should, but just in case your manually touched up file doesn’t get overwritten as expected).

2 Likes

Thanks for the update! I have just left on a trip, but I’ll be back this weekend & will report back how the fix works!!

Thank you RogueM, I can confirm this now works for me as well!

1 Like

Thank you! The last fix worked perfectly - I’m back in business!!

1 Like

Set up a new Picade and ran into this same issue. This thread helped immensely, thank you. One item I would add: my /etc/udev/rules.d/10-picade.rules file was blank (0 bytes), so I had to populate the following lines from the github here (https://github.com/pimoroni/picade-hat/blob/master/lakka-driver/10-picade.rules).

sudo nano /etc/udev/rules.d/10-picade.rules
SUBSYSTEM==“input”, ATTRS{name}==“gpio_keys”, ENV{ID_INPUT_KEYBOARD}=“1”

This immediately fixed my issue where the joystick would work in RetroPie but not in games.

2 Likes