mholgatem / gpionext Goto Github PK
View Code? Open in Web Editor NEWThe next evolution of GPioneer! Create virtual gamepads with your GPIO pins!
License: MIT License
The next evolution of GPioneer! Create virtual gamepads with your GPIO pins!
License: MIT License
So I was able to wire up and successfully configure a joystick and buttons with GPIOnext with the config wizard.
Now, I wired up a second joystick and I can't reconfigure anything.. I get to the part where it wants me to hold the joystick UP and it doesn't recognize the switch. The strange thing is this same joystick is still working fine in retropie as a joystick device.
I tried checking the GPIO pins with the gpio command and they are showing as triggered there just fine.
I tried running the remove script and the GPIOnext folder and reinstalling from scratch, same issue.
Really not looking forward to reinstalling retropie from scratch again :(
Update.. I have a pin ouput I use to control the lights on my cabinet.. seems to confuse the config utility in GPIOnext. Workaround of unplugging that pin during configuration solves the problem.
Hi there,
I am currently facing a problem that makes my GPIOnext not working. But it was yesterday :/
Here are the pins I am using 3,5,7,8,9,12,31,33,35,36,37,40.
And the message I do get:
May 18 18:22:14 retropie systemd[1]: Started gpionext-daemon.
May 18 18:22:17 retropie python3[10706]: /home/pi/GPIOnext/config/gpio.py:55: RuntimeWarning: A physical pull up resistor is fitted on this channel!
May 18 18:22:17 retropie python3[10706]: GPIO.setup(number, GPIO.IN, pull_up_down=pull)
May 18 18:22:17 retropie python3[10706]: Traceback (most recent call last):
May 18 18:22:17 retropie python3[10706]: File "gpionext.py", line 116, in
May 18 18:22:17 retropie python3[10706]: GPIOnext( args )
May 18 18:22:17 retropie python3[10706]: File "gpionext.py", line 54, in init
May 18 18:22:17 retropie python3[10706]: gpio.setupGPIO( self.args )
May 18 18:22:17 retropie python3[10706]: File "/home/pi/GPIOnext/config/gpio.py", line 99, in setupGPIO
May 18 18:22:17 retropie python3[10706]: pins.append( pin(pinNumber, pull, args) )
May 18 18:22:17 retropie python3[10706]: File "/home/pi/GPIOnext/config/gpio.py", line 55, in init
May 18 18:22:17 retropie python3[10706]: GPIO.setup(number, GPIO.IN, pull_up_down=pull)
May 18 18:22:17 retropie python3[10706]: ValueError: The channel sent is invalid on a Raspberry Pi
May 18 18:22:18 retropie systemd[1]: gpionext.service: Main process exited, code=exited, status=1/FAILURE
May 18 18:22:18 retropie systemd[1]: gpionext.service: Unit entered failed state.
May 18 18:22:18 retropie systemd[1]: gpionext.service: Failed with result 'exit-code'.
May 18 18:22:19 retropie systemd[1]: gpionext.service: Service hold-off time over, scheduling restart.
May 18 18:22:19 retropie systemd[1]: Stopped gpionext-daemon.
Any idea why?
Thanks!
Thanks for making this, but there should be an equally easy way to uninstall it. Now I unfortunately have to understand the code to undo the installation.
I had seen it suggested over Adafruit-Retrogame, but it was not immediately clear that it couldn't be configured on its own but requires being run with Retropie. The "gpionext config" also allows setting the target keys, but there's confusingly no way to either manually set the mapping or have it auto-detect while in configure. I recommend that you make that clear in the README as it certainly wasn't obvious to me.
After the installation, when I try to config, I obtain this error:
Traceback (most recent call last): File "/home/pi/GPIOnext/config_manager.py", line 14, in <module> from evdev import ecodes as e ImportError: No module named 'evdev'
I'm trying to install it on retropie (last version) on a rpi3
mholgatem, hello how are you? Greetings here from BRAZIL!
First of all, I would like to thank you. His project solved an old problem of the RETROPIE, in relation to the GPIO.
I would like you to clarify two issues that I believe have been misunderstood in GITHUB:
It would be very interesting a video of you on this. But I would be grateful if you answer here too.
Request for adding i2c analog controllers. I can see some i2c implementation on GPIOneer but sadly it seems the work didnt progress to GPIOnext.
Can you provide details on how analog is supported in GPIOnext?
Hi,
I have Retropie running on an Asus Tinkerboard and I've tried to install GPIOnext, I have run into a few install issues and now seem to have hit a brick wall running gpionext config. I get an error with the RPi.GPIO module, it only runs on a Raspberry Pi. Do you know of any work around?
Thanks
I am trying to follow the tutorial on https://ubuntuforums.org/showthread.php?t=1595666 to order the joysticks to make GPIOnext always the main joystick.
In it, I found that doing
udevadm info -q all -n /dev/input/js0
you should get these 2 values
ID_VENDOR=
ID_MODEL=
I dont get any of those with GPIOnext, so the question is.
Is there any chance to make these 2 values available and configurable in any way ?
Thanks !
holding a button, then pressing other buttons several times while the first button is still held, makes CPU usage according to htop go from 0.0% to 40% on a pi zero. this seems to persist regardless of configuration flags. it also creates a lot of python processes. releasing all buttons makes CPU usage go back to zero and removes the extra processes.
Hi,
I am actually using GPIONext without resistors in my buttons. They are directly connected.
Should I use any on my buttons and joystick?
My GPIONext config for "gpionext set pulldown" is as default [false] .
Thanks !!
My Problem is, after installing a fbtp driver driver link( https://retropie.org.uk/forum/topic/295/retropie-and-waveshare-32b/36) for a Waveshare 32b screen i cannot add any buttons. If i type in evtest GPIOnext is not available. I know this seems like a problem that you shouldnt care about but adafruits parts are way to expensive and that display is working pretty fine i just cannot get evtest working . Can you please help, many of us who are Retropie are forced to use adafruits Display and its way to expensive. here is the code
Would you like to run the configuration manager now? [y/n]y
Traceback (most recent call last):
File "/home/pi/GPIOnext/config_manager.py", line 315, in
ConfigurationManager(args)
File "/home/pi/GPIOnext/config_manager.py", line 85, in init
gpio.setupGPIO( self.args )
File "/home/pi/GPIOnext/config/gpio.py", line 99, in setupGPIO
pins.append( pin(pinNumber, pull, args) )
File "/home/pi/GPIOnext/config/gpio.py", line 59, in init
bouncetime = args.debounce)
RuntimeError: Failed to add edge detection
-------------> Setup Complete!
I notice that there is way too much sensitivity for the direction pad. It really gets in the way of a good user experience (even navigating through ES menus is a pain) - playing games such as Pacman or any S'MUPs (any game that relies heavily on direction control) becomes a nightmare sometimes, as the buttons seem to be doing whatever they want to do, due to their extreme "out-of-center" (for the lack of a better term) sensitivity.
An easy fix for this is to add a specific config for setting deadzone values. By deadzone, I mean the threshold value for the daemon to detect a transition from the center (all 4 direction buttons released) to any direction. The greater this value, the more the direction pad must be moved to any direction.
Thank you.
Hi,
Is there have any way to configure second player/joyistik? So, i needed like two different keyboards emulation at the same service. Thanks..
I have GPIOnext working great with two buttons (thank you!), one for volume up and one for volume down. I'd really like to be able to hold the volume buttons and they fire the increase or decrease volume commands numerous times. Is this possible with GPIOnext?
Hi i want to make a gba sp raspberry pi my question is if i want to add y x button in a new loop cause the other loop is on a gba sp board and there no connection for that, so i have two loop and two ground so my question is does i can with gpionext make on joypad from that also does i need a anolog to digital for psp 1000 joystick
Hi,
Somehow the script is working, but I had some installation issues, so I would like to share my complete experience here. I don't know if this can be classified as an issue 'per se'.
Thanks to the author. Now I'm closer to finish my GBZ.
Hello, first of all thanks in advance. I would like to know if it is possible to execute a Python script through the command option in gpionext. I tried to run with "sudo python /home/pi/script.py" and it did not work but if I execute a normal command I can make it work. I do not know if it's because gpionext is not designed to run Python scripts or if I'm doing something wrong.
Thanks
Hello,
Thx a lot for this. It seems to work great.
Anyway when I'm playing it goes to pause mode each time I'm using to keys at the meantime (up+left for example)
Any idea how to fix this ?
Thx a lot.
Hi all
I installed GPIOnext, configured joysticks and buttons for 2 players (26 entries in total; 1 joystick and 10 buttons for player 1 and 1 joystick and 8 buttons for player 2).
I also tweeked a little with combo_delay and debounce values to get a better gameplay but I don't remember the last numbers I set. Is there a way to check?
I quicky noticed in emulationstation menus that 1 single button press jumps 2 lines not always but happens alot. Some times it get stuck and keeps scrolling in one direction.
Here you can see the system output when I pressed 3 diferent buttons (1 click each).
But in game happens a worst cenario. In games that you need to keep pressing a button, for example a racing game that you need to keep pressing the accelarator, all buttons stop working after pressing the same button for 15 or 30 seconds.
This is the error I got:
I'm using a Raspberry Pi 3b+, running retropie 4.6. All gpio are connected this way: GPIO pin -> microswitch -> ground
Hi,
I just installed GPIOnext and everything appears to have installed correctly. I run the config manager, select Joypad 1, select 0 sticks, select Start, then press enter. The screen instructs to Hold Start Button but does not recognize the button press. I've got my button wired as in this tutorial and set GPIOnext to pulldown. I verified the button is wired correctly by running GPIO.input(10) and checking for 0's and 1's. I have tried moving the input wire to other GPIO ports just in case, but have not been able to setup this button yet
I am using a Raspberry Pi 4 running RetroPie 4.6. Button is wired VCC -> 1k resistor -> button -> GPIO board pin 10
I've gotten it to detect a game pad tons of times but all of the sudden after I configure some more buttons it just doesn't detect a game pad anymore
when running the gpio-next program, everything goes well but it fails to recognize pins 0 and 1.
Hi all
I have used gpionext it great sucess and most it simple programmable buttons like:
sudo halt
or volume+ or down:
/usr/bin/amixer -q -c 1 sset Headphone 4dB- unmet no cap
But now i am stuck it running scripts, for example "/home/pi/screen.sh", programmable with or without sudo it full paths and the script simple don´t run. The script are mark it executable and i test the script first running ./screen.sh.
What is wrong ? How i put the script working it a button from gpionext...
Sorry, newb here so please feel free to ask questions of me.
Raspberry PI 3 B, GPIOnext joypad, Arcade Game, Power Control System (Jaycar XC9062 and XC9064). Using current RetroPie build.
Steps taken:
Boot ok,
launches into EmulationStation,
press F4, as per included 1 page instruction;
sudo apt update,
sudo apt install git python3-dev -y,
git clone blah GPIOnext.git,
sudo ./install.sh
Follow all prompts to setup joystick, buttons, etc
gpionext test 1
All results seem correct and successful.
launch EmulationStation, Welcome screen, 1 Gamepad detected.
As soon as I press any key to configure device, “GPIOnext Joypad 1” on screen with “OK” below and that’s it. Nothing progresses except F4.
Please, pulling what’s left of my hair out, have honestly searched multiple forums, no close results.
Thank you kindly,
Ed.
I have a Waveshare 32b and a Gameboy Zero Button PCB wired up to my Raspberry Pi Zero W. Both the Waveshare and the Button PCB work separately (so I know everything is functionality correct) but I have run into an issue with GPIOnext. Some of my Button PCB wires go to "no-connect" connections that the Waveshare 32b has (specificaly pins 3, 5, 7, 8, and 10) so if I configured GPIOnext on a fresh install of RetroPie - GPIOnext works great. However, once I use the "LDC-Show" driver from Waveshare, GPIOnext will fail to start due to the "Failed to add edge detection" error message above. I completely understand why this error is occurring (and would love to know about any workarounds,) but my issue is with GPIOnext.
I've run the "remove.sh" done a reboot, and then run the "install.sh" only to find I can't run "gpionext config" because it fails for the same reason. I've made sure to run "gpionext stop" first, and tried to do "gpionext set pins default" and many combinations of the above...but there must be some remaining configuration laying around the filesystem that is preventing me from cleaning/reinstalling GPIOnext. Any idea what would cause this?
I realize I could just reimage the sdcard and start from scratch to not use the same pins, but that seems like overkill for something that appears to be a GPIOnext issue. Any idea what this could be?
Thank you for making GPIOnext and thanks for the help!
Update: I even tried removing the entire GPIOnext folder from my ~/ directory, and then getting a fresh copy from Git, but I run into the same issue. Also, just from a cursory glance, it looks like GPIOnext is using a SQLlite database? It seems to not be persisted outside the ~/GPIOnext directory, but obviously something is stored elsewhere.
Hi !! I got GPIONext installed on Retropie. I configured 1 controller. Everything if working perfectly....except that I am getting a lot of lag on inputs. I try setting up a Joypad and Keyboard...same issue. I am testing in Track and Field where you have to rapidly press the button to run faster....With GPIONext...I have a hard time running....But with my USB Keyboard , USB Gamepad and USB Control Stick....everything is fine.
I've a SpotPear 1.54 display with some GPIO buttons in snes configuration, when i try to config I have the error Failed to add edge detection
Trying to use gpionext causes a restart every time.
Tried:
Switching to and running commands as root user still results in the same behaviour.
Any attempt at using GPIOnext results in a restart of the system.
I am using the latest Raspbian Stretch based RetroPie image (4.4).
Hardware: Raspberry Pi 3 B
Hello, i am making micro console on raspberry pi zero W. I want to set up virtual keyboard. Once i am configuring it up, emulationstation can't recongize it. In system journal i am getting errors like this:
Jun 08 18:17:54 retropie systemd[1]: gpionext.service: Main process exited, code=exited, status=1/FAILURE
Jun 08 18:17:54 retropie systemd[1]: gpionext.service: Failed with result 'exit-code'.
Jun 08 18:17:55 retropie systemd[1]: gpionext.service: Service RestartSec=1s expired, scheduling restart.
Jun 08 18:17:55 retropie systemd[1]: gpionext.service: Scheduled restart job, restart counter is at 74.
Jun 08 18:17:55 retropie systemd[1]: Stopped gpionext-daemon.
Jun 08 18:17:55 retropie systemd[1]: Started gpionext-daemon.
Jun 08 18:17:57 retropie python3[2348]: Traceback (most recent call last):
Jun 08 18:17:57 retropie python3[2348]: File "gpionext.py", line 116, in <module>
Jun 08 18:17:57 retropie python3[2348]: GPIOnext( args )
Jun 08 18:17:57 retropie python3[2348]: File "gpionext.py", line 54, in __init__
Jun 08 18:17:57 retropie python3[2348]: gpio.setupGPIO( self.args )
Jun 08 18:17:57 retropie python3[2348]: File "/home/pi/GPIOnext/config/gpio.py", line 99, in setupGPIO
Jun 08 18:17:57 retropie python3[2348]: pins.append( pin(pinNumber, pull, args) )
Jun 08 18:17:57 retropie python3[2348]: File "/home/pi/GPIOnext/config/gpio.py", line 55, in __init__
Jun 08 18:17:57 retropie python3[2348]: GPIO.setup(number, GPIO.IN, pull_up_down=pull)
Jun 08 18:17:57 retropie python3[2348]: ValueError: The channel sent is invalid on a Raspberry Pi
Install Complete!
Would you like to run the configuration manager now? [y/n]Install Complete!
Would you like to run the configuration manager now? [y/n]y
Traceback (most recent call last):
File "/home/pi/GPIOnext/config_manager.py", line 15, in
from config import gpio, menus, SQL
File "/home/pi/GPIOnext/config/gpio.py", line 2, in
import RPi.GPIO as GPIO
RuntimeError: This module can only be run on a Raspberry Pi!
-------------> Setup Complete!
Hello,
I'm new in raspberry pi and don't know a lot of things.
Following a tutorial, I made a handheld gaming device similar to the one that Adafruit made.
Using GPIOnext, I successfully configured and mapped each button, and I configured them fine in emulationstation. The problem occurs when I restart the raspberry pi, some buttons get mixed up and when I re-configure in emulationstation, every time I press hold the buttons A, B and X, it says KEYBOARD instead of GPIOXX. The other buttons are fine, it's just these three.
So I have to re-configure in GPIOnext and type "gpionext start" every time I turn on the raspberry pi.
What causes this and how do I solve it permanently?
Thanks!
Image RetroPie 4.4 was used. Everything seemed to work out, I was able to configure every button. But in Emulationstation everything works except the four directions of the Dpad. When I run gpionext test 1 also every single button is recognized. Why does this issue occur?
Hi !!
I stoped the daemon and made some tests with the command with flags.
Now that I have found how I want the daemon to run, how do I tell the daemon to run with certain flags?
thanks
Hi,
A little background, I initially set up GPIOnext on a Pi Zero without any issues however I noticed when any button was held the PWM audio out would stop and would only resume after the key was released. I thought I would try to see if switching to Pull Down switches solved this issue. However, I have run into an issue when using the GPIOnext pull-down flags. I'll try to explain as best as I can. I have installed a completely fresh RetroPie and have installed both WiringPi and GPIOnext. I have simplified the project to a singular GPIO input as shown below:
In the boot config:
Sudo nano /boot/config.txt
I have changed the pin state by adding the line:
gpio=_PIN_=ip,pd
Then by running the gpio read 28
I was able to confirm that that pin was indeed correctly set to pull down. "Reading 0 when released and 1 when pressed".
I then configured GPIOnext to use the pull down flags using:
gpionext set pulldown true
gpionext reload
So far so good, using gpio read 28
the pin was still reading correctly. The next stage was to configure the button in GPIOnext using:
gpionext config
To keep things simple as possible I configured joystick 1 with 0 Dpads and only one button selected, in this case button "A". After proceeding I enter the configure Joypad 1 page where I am instructed to Hold the button. The button, however, is not detected in this stage.
When I exit the gpionext configuration page I then try the wiringpi command
gpio read 28
Now the pin state has inverted and is now reading as 1 instead of 0. It seems when entering gpionext config reverts the changes made above to the pin back to the original pull up state.
I've tried to explain as detailed as possible and am quite new to this so if I have missed something let me know and I'll try to add it. It's probably something simple that I have missed but any assistance would be appreciated.
Thanks!
Kind Regards,
George
I'm running retropie on a raspberry pi 3 b+, and am getting the following error: RuntimeError: failed to add edge detection. i'm having a problem sshing into my pi (pretty sure it's unrelated) so i can't copy and paste the traceback. I'm currently working on getting ssh to work, if you happen to have a answer/solution without the tracebask, feel free to share. If need be, i can retype the traceback, although i'm lazy and would rather not. I'm hoping the pic will help, sorry for the quality.
I instlal the git repo to my retropie build and I have a breadboard with a few buttons on just to test these buttons are 100% wired correctly i run the install.sh and all is good i then config all is good I run gpionext start all is good I go to emulation station my buttons dont work so i reboot my system they still dont work so i reconfig I do that 5 times .
I removed mk-arcade-joystick from the dkms tree and installed gpionext and configured. It works fine but retropi thinks i'm using joysticks 3 and 4. Am I doing something wrong ?
I get these message on config:
Please release all buttons to continue
and in retropie one tab on left and it stays on.
I wired up some buttons and a joystick. When I try to configure the joystick it doesn’t not recognise it when I hold it down or right even though it finds the pins when I hold up and left. Otherwise there haven’t been any issues.
Hi, I am trying to make a small 4 player NES emulator with GPIO gamepads using RetroPie on a Raspberry Pi Zero W. I only have 4 buttons at the moment, so I made a D-pad and set up GPIOnext. It works when I type "gpionext test 1", but I can't get it to work in the emulationstation. I already tried the reload, start and stop commands, making a clean install of RetroPie, configuring 4 gamepads with only an A button on each.
My question is how can I get it to work in emulationstation and how does the daemon work? Do I need to run "gpionext start" or "gpionext reload" on boot before "emulationstation"?
A weird thing that might be important is that after I reboot using RetroPie's menu my keyboard stops working too.
The pins I am using are 3,5,7,9(Ground),11
Upon typing in "bash GPIOnext/install.sh", it does nothing. No messages no nothing. Just goes back to prompt immediately.
request to add I2c functionality - add an adc / mux for extra pins for 2 player setups(just for start, select, coin, exit buttons) -
And here's why..
i built an arcade console, using a pi3 and Gpioneer..
I'm using PiSupply using pins 23 & 24 for startup and soft shutdown of the pi.
problem is im now atleast 2 pins short for the standard 2 player setup if i was to use an ADC on pins 3 & 5 i believe this would solve this issue, for start, select, coin, exit, not for player keys(due to any delay that may be introduced)
i love Gpioneer and its easy to use, the only thing holding this up is the limited number of pins on the pi3 - 8 ground pins ? really? lol...
(i simply am not smart enough to get pins 27 & 28 to work at all)
I followed the instructions here #2
cd ~/GPIOnext
wget https://raw.githubusercontent.com/mholgatem/GPIOnext/master/update.sh
git add update.sh
sudo bash update.sh
I'm still getting the error message "Please release all buttons to continue"
It usually occurs after inputting pin 40.
Hi !
in first thanks for GPIOnext, it's a great software,
i need to use it with an analog joystick, i have been search on internet but nothing,
GPIOnext take only one way on the joystick, not the two way : left and right for example.
How can i work with an analog joystick ? i need a analog to digital converter like the ADS1015 ?
I installed gpionext on retropie 4.3 on a raspberrypi 3.
I can navigate up and down in the config menu, but the item selection does not work.
Nothing happens on pressing ENTER or SPACE or the like.
I cannot exit either - had to cancel with CTRL+C.
I was logged in via ssh.
Unfortunately, I don't see a manual way for configuring gpionext.
Thanks a lot for the plugin. I've been very satisfied with it, but I no longer use GPIO for input, so the package has become unnecessary for me.
How do I uninstall it?
Hello, i'm building a raspberry handheld and want to use buttons conneced to gpio pins as input in retropie.
I succesfully added them in the gpionext config and they work when i type gpionext test 1.
But i cannot get them to setup in retropie.
The emulationstation setupscreen only shows "No gamepads connected." and holding or pressing buttons does no difference. If i connect a usb keyboard, the usb keyboard works, but the gpio buttons are still not recognised.
How can i get the virtual joystick to work in retropie?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.