GPIO joystick and buttons issue
-
Hello,
I have the same issue and all the test (evtest, jstest) are ok..
have you a solution ?JMS
-
@jean-marc-strauven does evtest output strictly different event names when you try each button/stick direction ?
-
@Substring I was trying to test my GPIO using the jstest. Basically it gives me the error 'jstest: command not found'. I follow the instructions of https://github.com/recalbox/recalbox-os/wiki/Test-your-joystick-with-jstest-(EN).
This issue that i'm having is: When i try to set up my controller the joystick works and the A button. Apart from that none of the other buttons work. Anyone experienced similiar issue?
-
@ivolourenco most obably a wiring issue. Use
evtest
instead ofjstest
-
@Substring so i did a evtest GPIO detected as within recalbox. All buttons worked (how can i save the log of events to share with you?)
I even did a wiring direct to the GPIO for individual buttons to remove the wiring possibility (e.g daisy chain ground).
Any other ideia?
-
@ivolourenco has every single button returned a different event ?
To share what you did, juste select the text in putty (it's automatically copied, that's a linux habbit) and paste it here between triple back quotes -
@Substring output from the evtest below.
Sequence was: js up; js down; js left; js right; B; A; TR; TL; X; Y; Start; Select.So i would imagine that all the setup is ok. However, within the Recalbox is not detected.
I have a daisy chain ground that runs on all the buttons and is connected to the GPIO 6 any potential issue with that?"""No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: NOVATEK USB Keyboard
/dev/input/event1: NOVATEK USB Keyboard
/dev/input/event2: GPIO Controller 1
/dev/input/event3: GPIO Controller 2
Select the device event number [0-3]: 2
Input driver version is 1.0.1
Input device ID: bus 0x15 vendor 0x1 product 0x1 version 0x100
Input device name: "GPIO Controller 1"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 304 (BTN_SOUTH)
Event code 305 (BTN_EAST)
Event code 307 (BTN_NORTH)
Event code 308 (BTN_WEST)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 314 (BTN_SELECT)
Event code 315 (BTN_START)
Event code 316 (BTN_MODE)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min -1
Max 1
Event code 1 (ABS_Y)
Value 0
Min -1
Max 1
Properties:
Testing ... (interrupt to exit)
Event: time 315536585.570709, type 3 (EV_ABS), code 1 (ABS_Y), value 1
Event: time 315536585.570709, -------------- SYN_REPORT ------------
Event: time 315536585.780727, type 3 (EV_ABS), code 1 (ABS_Y), value 0
Event: time 315536585.780727, -------------- SYN_REPORT ------------
Event: time 315536587.760702, type 3 (EV_ABS), code 1 (ABS_Y), value -1
Event: time 315536587.760702, -------------- SYN_REPORT ------------
Event: time 315536587.970709, type 3 (EV_ABS), code 1 (ABS_Y), value 0
Event: time 315536587.970709, -------------- SYN_REPORT ------------
Event: time 315536589.990696, type 3 (EV_ABS), code 0 (ABS_X), value 1
Event: time 315536589.990696, -------------- SYN_REPORT ------------
Event: time 315536590.160719, type 3 (EV_ABS), code 0 (ABS_X), value 0
Event: time 315536590.160719, -------------- SYN_REPORT ------------
Event: time 315536591.750714, type 3 (EV_ABS), code 0 (ABS_X), value -1
Event: time 315536591.750714, -------------- SYN_REPORT ------------
Event: time 315536591.910707, type 3 (EV_ABS), code 0 (ABS_X), value 0
Event: time 315536591.910707, -------------- SYN_REPORT ------------
Event: time 315536598.760726, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 0
Event: time 315536598.760726, -------------- SYN_REPORT ------------
Event: time 315536598.930715, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 1
Event: time 315536598.930715, -------------- SYN_REPORT ------------
Event: time 315536603.350710, type 1 (EV_KEY), code 305 (BTN_EAST), value 0
Event: time 315536603.350710, -------------- SYN_REPORT ------------
Event: time 315536603.520718, type 1 (EV_KEY), code 305 (BTN_EAST), value 1
Event: time 315536603.520718, -------------- SYN_REPORT ------------
Event: time 315536686.300702, type 1 (EV_KEY), code 311 (BTN_TR), value 0
Event: time 315536686.300702, -------------- SYN_REPORT ------------
Event: time 315536686.500701, type 1 (EV_KEY), code 311 (BTN_TR), value 1
Event: time 315536686.500701, -------------- SYN_REPORT ------------
Event: time 315536692.130701, type 1 (EV_KEY), code 310 (BTN_TL), value 0
Event: time 315536692.130701, -------------- SYN_REPORT ------------
Event: time 315536692.330698, type 1 (EV_KEY), code 310 (BTN_TL), value 1
Event: time 315536692.330698, -------------- SYN_REPORT ------------
Event: time 315536702.220730, type 1 (EV_KEY), code 307 (BTN_NORTH), value 0
Event: time 315536702.220730, -------------- SYN_REPORT ------------
Event: time 315536702.430694, type 1 (EV_KEY), code 307 (BTN_NORTH), value 1
Event: time 315536702.430694, -------------- SYN_REPORT ------------
Event: time 315536709.500750, type 1 (EV_KEY), code 308 (BTN_WEST), value 0
Event: time 315536709.500750, -------------- SYN_REPORT ------------
Event: time 315536709.690705, type 1 (EV_KEY), code 308 (BTN_WEST), value 1
Event: time 315536709.690705, -------------- SYN_REPORT ------------
Event: time 315536714.390708, type 1 (EV_KEY), code 315 (BTN_START), value 0
Event: time 315536714.390708, -------------- SYN_REPORT ------------
Event: time 315536714.570710, type 1 (EV_KEY), code 315 (BTN_START), value 1
Event: time 315536714.570710, -------------- SYN_REPORT ------------
Event: time 315536716.760701, type 1 (EV_KEY), code 314 (BTN_SELECT), value 0
Event: time 315536716.760701, -------------- SYN_REPORT ------------
Event: time 315536716.940702, type 1 (EV_KEY), code 314 (BTN_SELECT), value 1
Event: time 315536716.940702, -------------- SYN_REPORT ------------""" -
@ivolourenco So, each of the buttons are working properly and independantly. The daisy chain is just for the ground, and should link a pin of each switch to the Pi ground.
You're not supposed to remap the controller in ES, it's configured by default. Try those commands in SSH :
/etc/init.d/S31emulationstation stop cp /recalbox/share_init/system/.emulationstation/es_input.cfg ~/.emulationstation /etc/init.d/S31emulationstation start
And try your stick without reconfiguring it for now
-
@Substring see the outup of those commands:
""" # /etc/init.d/S31emulationstation stop
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/amstradcpc/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/snes/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/gba/gamelist.xml"!
ERROR - tried to write to log file before it was open! The following won't be logged:
lvlERROR - tried to write to log file before it was open! The following won't be logged:cp /recalbox/share_init/system/.emulatoions
BusyBox v1.25.1 (2017-10-12 19:45:17 UTC) multi-call binary.
Usage: cp [OPTIONS] SOURCE... DEST
Copy SOURCE(s) to DEST
-a Same as -dpR -R,-r Recurse -d,-P Preserve symlinks (default if -R) -L Follow all symlinks -H Follow symlinks on command line -p Preserve file attributes if possible -f Overwrite -i Prompt before overwrite -l,-s Create (sym)links -u Copy only newer files
/etc/init.d/S31emulationstation start
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/amstradcpc/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/gba/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/snes/gamelist.xml"!
lvl0: System "favorites" is missing name, path, extension, or command!
lo IP Address 127.0.0.1
eth0 IP Address 169.254.119.52
curl: (6) Couldn't resolve host 'recaleur-archive-prod.recalbox.com'' """Note: The joystick works withing the recalbox. But none the button work still.
-
@ivolourenco said in GPIO joystick and buttons issue:
cp /recalbox/share_init/system/.emulatoions
This is not the command I wrote, please read again
-
@Substring sorry for that, output below.
"""# /etc/init.d/S31emulationstation stop
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/amstradcpc/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/gba/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/snes/gamelist.xml"!
ERROR - tried to write to log file before it was open! The following won't be logged:
lvlERROR - tried to write to log file before it was open! The following won't be logged:cp /recalbox/share_init/system/.emulations
BusyBox v1.25.1 (2017-10-12 19:45:17 UTC) multi-call binary.
Usage: cp [OPTIONS] SOURCE... DEST
Copy SOURCE(s) to DEST
-a Same as -dpR -R,-r Recurse -d,-P Preserve symlinks (default if -R) -L Follow all symlinks -H Follow symlinks on command line -p Preserve file attributes if possible -f Overwrite -i Prompt before overwrite -l,-s Create (sym)links -u Copy only newer files
/etc/init.d/S31emulationstation start
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/amstradcpc/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/gba/gamelist.xml"!
lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/snes/gamelist.xml"!
lvl0: System "favorites" is missing name, path, extension, or command!
lo IP Address 127.0.0.1
eth0 IP Address 169.254.119.52
curl: (6) Couldn't resolve host 'recaleur-archive-prod.recalbox.com'""" -
@ivolourenco the
cp
command is not correctly typed. I tried it on my recalbox and it works.
When reporting, please use such `bback quotes, not double quotes -
@Substring All buttons responding. Seems incorrectly setup though. Shall I remap them?
And what have i done... with the commands you suggested?
# lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/amstradcpc/gamelist.xml"! lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/gba/gamelist.xml"! lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/snes/gamelist.xml"! ERROR - tried to write to log file before it was open! The following won't be logged: # cp /recalbox/share_init/system/.emulations/es_input.cfg ~/ cp: can't stat '/recalbox/share_init/system/.emulations/es_input.cfg': No such file or directory # cp /recalbox/share_init/system/.emulationstation/es_input.cfg ~/.emulationstation # /etc/init.d/S31emulationstation start # lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/amstradcpc/gamelist.xml"! lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/gba/gamelist.xml"! lvl0: Could not find <gameList> node in gamelist "/recalbox/share/roms/snes/gamelist.xml"! lvl0: System "favorites" is missing name, path, extension, or command! lo IP Address 127.0.0.1 eth0 IP Address 169.254.119.52 curl: (6) Couldn't resolve host 'recaleur-archive-prod.recalbox.com' ============================================== ==============================================
-
@ivolourenco Incorrectly setup ? If you followed the wiring diagram + buttons layout like :
Y X L
B A XYou shouldn't have to remap. But ok, try remapping now you know how to reset the mapping
-
@substring going to start drilling the button now!
I just noticed that when i push up it goes down... so may be there is a issue on the setup of wiring.
However, I did a run on remapping but it still does not recognise after A button
Thanks
-
@ivolourenco can you go to http://recalbox while trying to remap, and make a screenshot of Recalbox when you're stuck at remapping ? You can post it here using the small cloud icon with an arrow, no need to drop it on some website
-
@substring so this what i do:
-
Main Menu/ Controller Settings
-
2 Gamepads detected (picture below)
-
Press A and start the configuration (joystick configured - Picture below)
- A button configured as Button 1 and after this none of the others are recognised.
-
-
@ivolourenco so no button would work once A is assigned ? They all work on evtest, i don't get it ... unless you mixed P1 and P2 ...
-
@substring yes basically none work after A is assigned.
How could P1 or P2 affect that? I’m using the GPIO layout proposed within the wiki.
Is there a way within evtest to understand that the button is assigned to the correct GPIO pin?
-
@ivolourenco nope evtest just reports which event has been triggered. I still believe that if you're saying the layout is not right, then the wiring is wrong