Lakka GPIO buttons - ANY WAY possible?

Hello guys! New to Lakka, and the forums.

So I have created a gameboy using DMG button board. GPIO buttons. I’m coming from retropie, where everything was configured and works. I’ve hit snags there, and FULLY decided to use Lakka instead. I love it. I’m running a raspberry pi zero, with gpio buttons. I’ve designed an audio board, added charging indicators/ low battery indicators/ power on indicators.

Everywhere I look, resources are scarce. I fully understand this is a work in progress. I need help getting the gpio buttons to work! People are talking about cross-compiling, but I have yet to see someone with actual gpio buttons working. Is this in ANY way possible? From start to finish, has this been done? Img the sdcard, turn it on, configure some things, set pins, and test? Not to be rude AT ALL, but is this really a retroarch build for old school games with no way to integrate it into an old school handheld? I’m probably blind. It might be right in front of my eyes. I’m just not seeing it :frowning:

If anyone has an inkling of direction to point me in, please do. I’m desperate, lol. I’m not new to this, definitely, but Lakka is new territory for me.

      Thanks guys. If I can contribute in any way possible, please don't hesitate to ask. I'm certainly not a moocher.

RetroArch/Lakka doesn’t have any built-in GPIO control but there shouldn’t be anything stopping you from tying into them. If you decide it’s not doing what you need, you can always just install RetroArch over the top of raspbian and end up with a similar outcome.

Thank you for the lead! I guess what I’m appreciative of from your post is it puts it into a way that I can formulate a lead from; the other posts offer theories.

How would I manipulate the file system, as it is read-only? What tools would you suggest with this distro?

Thank you!

Lakka is just a modified fork of LibreElec, so I think this page should be helpful: http://www.barryhubbard.com/raspberry-pi/howto-raspberry-pi-install-rpi-gpio-openelec-rev-a-b-b/

1 Like

Once again, thank you! That page has given me what I need. I now have RPi.GPIO added. Do you think I could use the retrogame script from Adafruit’s tutorial here: https://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons ? I used this with retropie, and it worked flawlessly. I just don’t know enough of the system in Lakka to know if there will be hiccups. I would normally say just blow it up and see, but I’m doing it on a test machine without the gpio buttons currently. Thanks man.

So I’ve found some information on scripting in some gpio commands but it’s written in python. I don’t notice python in Lakka. Is this possible?

My problem is once I can actually communicate with the GPIO pins(which I also have to figure out), I don’t fully understand how to get Lakka to understand that (example) gpio 17 pulled up means “up” or that gpio 8 means “start”. There was a script for that in retropie, but I’d really like to get this going in Lakka. I will 100% contribute to a write-up on the forums if I can just piece this together and make it work. I will do my part.

Sorry guys, I’m trying here. Google hates me right now, lol.

I don’t actually use Lakka, personally, so I can’t tell you whether it has python installed or not, but is there a reason you can’t just take the retropie script and use it in Lakka? Again, I’m not super-familiar with Lakka but I typically add scripts to ~/.bashrc to make them run at login.

Is that really a thing? Wouldn’t it just add RetroArch and the emulators to a system that already has them, just in different locations?

I really need the UI of Lakka and the read-only file system as my device needs to cut power at any time. Lakka IS perfect for this and I have found that no other alternative (even RetroPie) is.

I can’t understand how this gorgeously crafted distribution has no support for gpio… And I sadly don’t understand the front-end or RetroArch enough to write a script to translate buttons into commands. :frowning: I tried Adafruit’s retrogame.c but it appears not to have the c language either. It doesn’t know what structs or ints are :frowning:

I love this os. The image size, smoothness and interface is why I’m willing to try so hard.

Can we explore some of your additional ideas on getting this working? Even if it doesn’t require Python.

Thank you so much. You’ve been much help so far.

Hi, I have been looking for the exact same thing. Currently on Recalbox, because of the convenient implementation of the “WiringPI” - GPIO Interface library for the Raspberry Pi. http://wiringpi.com/

I´m thinking this would be te way to go asi for implementing the GPIO for buttons “out of the box” for LAKKA, just as RECALBOX does.

I hope they can add this feature as soon as posible. I like how in Recalbox i can make the wiring to my arcade buttons and joystick and it just works. Also I´m saving 2 extra PC PCB.


We have this issue related to GPIO topic.

The beauty of WiringPi is that you can bypass the entire PCB of any controller at hand, and just map the buttons directly into the gpio inputs an common ground. This way one can implement virtualy any controller into GPIO. Ive got 2 players into GPIO in Recalbox 4. Honestly prefer LAKKA, but this implementation of WiringPi is the only thing holding me back for the migration into LAKKA. It works perfect. and I imagine the input lag is better than any PCB in between the buttons and the rPi.


We can enable WiringPi if you need it.

I use it for GameGirl anyway. So I could add it to any RPi image.

Thanks Kivutar, that would be great!. Just to add clarity, will it work just as recalbox 4?, “invisible” or “under the hood”?. this way y could swap microSD´s and mantain the wiring intact…

Also in recalbox they said: “Added rpi gpio and wiringpi” . Not sure what they mean by “rpi gpio”…

This is the diagram I have used to connect inputs to the GPIO.


Many thanks!

Hi, just noticed the latest major release! Didi you manage to enable the WiringPi?. If not I would still like that Rpi2/3 image. Sorry to insist in this subject, but I believe this feature will improve the overall system. Thanks.

Please open an issue so that we won’t forget to enable this feature on RPi2/3 platform :wink:

Thank you.

[QUOTE=gouchi;48932]Please open an issue so that we won’t forget to enable this feature on RPi2/3 platform :wink:

Thank you.[/QUOTE]

Issue added! https://github.com/libretro/Lakka/issues/506 Many thanks.

I guess for all intents and purposes I’m reopening this thread.

I’ve been attempting to design out a portable raspberry Pi setup with lakka, modeling it after the Adafruit Super Pi Boy. However I keep running into a snag with the GPIO ports. Since Lakka seems to have no compatibility with the ports, or any allowance to add in the Adafruit retrogame.sh installation or Wiring Pi.

I really enjoy the other features of Lakka, and would rather not have to switch back to Retropie due to project limitations. I’ve been digging around attempting to find a solution that allows me to utilize the GPIO headers.

Any help at this point would be greatly appreciated.

Hey @DrOctavius, I’ve been successful at that recently. I got a NESPI case and was able to put together a script that enables that in the latest Lakka.

https://github.com/marcelonovaes/lakka_nespi_power

Please let me know if you have any questions

2 Likes

Anyone successful at incorporating GPIO controls into lakka?