SNES gamepad does not work using ControlBlock

Welcome Page Forums RetroPie Project GPIO Adapter, ControlBlock etc. SNES gamepad does not work using ControlBlock

This topic contains 55 replies, has 10 voices, and was last updated by Profile photo of petrockblog petrockblog 1 year, 10 months ago.

Viewing 35 posts - 1 through 35 (of 56 total)
  • Author
    Posts
  • #91416
    Profile photo of dotarj
    dotarj
    Participant

    Hi,

    I’m having trouble using the SNES controllers with the ControlBlock for my Raspberry Pi 2. It looks like I have done all necessary steps to enable the SNES controllers, but somehow it doesn’t work (the power switch and led do work).

    I have wired the ControlBlock according to description here: http://blog.petrockblock.com/2014/12/29/controlblock-power-switch-and-io-for-the-raspberry-pi/#Using_SNES_Controllers_with_the_ControlBlock. I used the RetroPie image (Raspberry Pi 2), and afterwards I installed the ControlBlockService (clone from github, and install using make install and make installservice). Then I edited controlblockconfig.cfg and set the gamepadtype to snes, and rebooted. EmulationStation detects 2 gamepads, but when I hold the A button nothing happens.

    When it didn’t work, I re-wired everything to make sure that the wiring was ok, but still no luck. The soldering looks ok.

    Is there something that I missed?

    Arjen

    #91525
    Profile photo of petrockblog
    petrockblog
    Keymaster

    Can you post some pictures of your setup here? This usually helps quite a lot to better analyst the problem.

    #91625
    Profile photo of dotarj
    dotarj
    Participant

    Hi Florian,

    Thanks for the quick reply! I have attached some photo’s. Unfortunately all wires are black, but take from me that it is properly wired (I’ve checked 4 times…). 🙂

    Attachments:
    #91628
    Profile photo of dotarj
    dotarj
    Participant

    and two more photo’s…

    Attachments:
    #91683
    Profile photo of petrockblog
    petrockblog
    Keymaster

    Ok. a next step could be to check if we can manually communicate with the GPIO expander components (The two black block in the middle of the ControlBlock).

    They are using a communication interface that is called I2C. What is the output of the commands

    sudo i2cdetect -y 0
    sudo i2cdetect -y 1

    ?

    These commands look for any attached I2C device.

    #91788
    Profile photo of dotarj
    dotarj
    Participant

    Hi Florian,

    This is the output of the commands:

    pi@retropie ~ $ sudo i2cdetect -y 0
    Error: Could not open file /dev/i2c-0' or/dev/i2c/0′: No such file or directo ry
    pi@retropie ~ $ sudo i2cdetect -y 1
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: 03 — — — — — — — — — — — —
    10: — — — — — — — — — — — — — — — —
    20: — — — — — — — — — — — — — — — —
    30: — — — — — — — — — — — — — — — —
    40: — — — — — — — — — — — — — — — —
    50: — — — — — — — — — — — — — — — —
    60: — — — — — — — — — — — — — — — —
    70: — — — — — — — —

    #91806
    Profile photo of petrockblog
    petrockblog
    Keymaster

    Sorry, I did not think about this before. You need to disable the controlblockservice before this test. You can simply do this with these commands run from within the ControlBlockService folder:
    sudo make uninstallservice
    Does the output of sudo i2cdetect -y 1 look different then? If the GPIO expanders are recognized correctly, we will see a line
    20: 20 -- -- -- -- -- -- 27

    #91932
    Profile photo of dotarj
    dotarj
    Participant

    Hi Florian,

    No problem. This is the output now:

    pi@retropie ~ $ sudo i2cdetect -y 1
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: — — — — — — — — — — — — —
    10: — — — — — — — — — — — — — — — —
    20: 20 — — — — — — 27 — — — — — — — —
    30: — — — — — — — — — — — — — — — —
    40: — — — — — — — — — — — — — — — —
    50: — — — — — — — — — — — — — — — —
    60: — — — — — — — — — — — — — — — —
    70: — — — — — — — —

    So the GPIO expanders are reconized correctly?

    #91936
    Profile photo of dotarj
    dotarj
    Participant

    Some more information:

    When EmulationStation is started, it shows a message “2 gamepads detected. Hold A button on your device to configure it.”. It always shows this message, even when no gamepads are connected. When there is a gamepad connected, pressing buttons does not start configuring the gamepad.

    I just found out that when no gamepads are connected and I connect a gamepad when this message is displayed, it starts the configuration of the gamepad, but again no buttons respond.

    #91982
    Profile photo of petrockblog
    petrockblog
    Keymaster

    So the GPIO expanders are reconized correctly?

    Yes, the GPIO expanders are recognized correctly. Maybe there are other services running that make use of the I2C interface. What does service --status-all show after a boot?

    Also, how many controllers are registered? You can see this with the commands ls /dev/input/.

    ControlBlockService, the driver for ControlBlock, polls the GPIO expanders and maps the inputs to two virtual gamepads. This is done independently of the fact that controllers are connected or not to the CB.

    #91996
    Profile photo of dotarj
    dotarj
    Participant

    This is the output of the 2 commands:

    pi@retropie ~ $ service –status-all
    [ – ] SNESDev
    [ ? ] alsa-utils
    [ – ] asplashscreen
    [ ? ] binfmt-support
    [ + ] bluetooth
    [ – ] bootlogs
    [ ? ] bootmisc.sh
    [ ? ] checkfs.sh
    [ ? ] checkroot-bootclean.sh
    [ – ] checkroot.sh
    [ – ] console-setup
    [ + ] controlblockservice
    [ + ] cron
    [ + ] dbus
    [ ? ] dphys-swapfile
    [ ? ] fake-hwclock
    [ – ] hostname.sh
    [ ? ] hwclock.sh
    [ + ] ifplugd
    [ – ] kbd
    [ – ] keyboard-setup
    [ ? ] killprocs
    [ ? ] kmod
    [ – ] motd
    [ ? ] mountall-bootclean.sh
    [ ? ] mountall.sh
    [ ? ] mountdevsubfs.sh
    [ ? ] mountkernfs.sh
    [ ? ] mountnfs-bootclean.sh
    [ ? ] mountnfs.sh
    [ ? ] mtab.sh
    [ ? ] networking
    [ + ] ntp
    [ ? ] plymouth
    [ ? ] plymouth-log
    [ – ] procps
    [ ? ] raspi-config
    [ ? ] rc.local
    [ – ] rmnologin
    [ – ] rsync
    [ + ] rsyslog
    [ + ] samba
    [ ? ] screen-cleanup
    [ ? ] sendsigs
    [ + ] ssh
    [ – ] sudo
    [ ? ] switch_cpu_governor
    [ + ] triggerhappy
    [ + ] udev
    [ ? ] udev-mtab
    [ ? ] umountfs
    [ ? ] umountnfs.sh
    [ ? ] umountroot
    [ – ] urandom
    [ – ] x11-common
    pi@retropie ~ $ ls /dev/input
    event0 event1 js0 js1 mice

    #92118
    Profile photo of dotarj
    dotarj
    Participant

    Just to make sure the wiring is not the problem, I have rewired the controller ports using different (thicker) wires, but still no response from the gamepads. Is there another way to debug the GPIO input?

    #92119
    Profile photo of petrockblog
    petrockblog
    Keymaster

    Ok, SNESDev is also running. This might be a cause for the problems. You can disable SNESDev with the RetroPie-Setup Script or directly from within the downloaded SNESDev-Rpi repository that you can get from https://github.com/petrockblog/SNESDev-RPi. Within the SNESDev-Rpi folder you can call sudo make uninstallservice to uninstall the SNESDev service.

    #92154
    Profile photo of stanton
    stanton
    Participant

    Just wanted to echo that I am experiencing precisely the same issue after attempting to setup a Pi 2 last night. I confirmed that my GPIO expanders are being recognized correctly. Like dotarj, when EmulationStation is started, two controllers are said to be recognized, but no button hold will start the gamepad configuration. The power switch functionality works as intended.

    #92204
    Profile photo of dotarj
    dotarj
    Participant

    I have uninstalled the SNESDev service, but still no response from the gamepads.

    #92250
    Profile photo of petrockblog
    petrockblog
    Keymaster

    One way to debug the GPIO ports is the following:

    1. Set the gamepad type in the configuration file of the ControlBlock service to “arcade”. after changing the configuration you need to restart the ControlBlock service, e.g., with the command “sudo service controlblockservice restart”.
    2. Connect a (jump) wire to one of the Ground terminals of the ControlBlock.
    3. Use the tool”jstest” to test each of the GPIO pins. To test the pins on the player 1 side use the command “sudo jstest /dev/input/js0”. Use the wire to pull the pins to Ground one after another. Jstest should register this and show a state change for the corresponding button or axis. Pulling the pins to Ground with this configuration means for the ControlBlock driver in this configuration that a button was pressed. To exit the jstest tool press Ctrl-C. To test the pins on the player 2 side use the command “sudo jstest /dev/input/js1” and repeat the above procedure.

    Can you observe these virtual button presses?

    #92335
    Profile photo of stanton
    stanton
    Participant

    For Player 1, all of the buttons instantly change to an on state and remain there. I see the same behavior from Player 2, except for buttons 2 and 3. They do not instantly turn on and do show a state change when I pull them to ground.

    pi@retropie ~ $ sudo jstest /dev/input/js0
    Driver version is 2.1.0.
    Joystick (ControlBlock Arcade Gamepad) has 2 axes (X, Y)
    and 12 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR).
    Testing … (interrupt to exit)
    Axes: 0: 0 1: 0 Buttons: 0:on 1:off 2:off 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0:-32767 1: 0 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on
    Axes: 0:-32767 1:-32767 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on 7:on 8:on 9:on 10:on 11:on

    pi@retropie ~ $ sudo jstest /dev/input/js1
    Driver version is 2.1.0.
    Joystick (ControlBlock Arcade Gamepad) has 2 axes (X, Y)
    and 12 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR).
    Testing … (interrupt to exit)
    Axes: 0: 0 1: 0 Buttons: 0:on 1:off 2:off 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:off 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:off 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:of
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0: 0 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0:-32767 1: 0 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on
    Axes: 0:-32767 1:-32767 Buttons: 0:on 1:on 2:off 3:off 4:on 5:on 6:on 7:on 8:on 9:on 10:on 11:on

    #92446
    Profile photo of petrockblog
    petrockblog
    Keymaster

    Does it work, when you use sudo raspi-config, choose “Advanced Options”, and enable I2C from there? Enable the ARM I2C interface from there and also enable the automatic loading of the I2C kernel module by default.

    #92546
    Profile photo of dotarj
    dotarj
    Participant

    All pins seem to respond correctly (I have only tested it with I2C enabled). They all instantly turn on when I pull them to ground and off when released. I will rewire the SNES controller ports and test again using the controllers.

    #92854
    Profile photo of dotarj
    dotarj
    Participant

    I have rewired the controller ports and still get no response from the controllers.

    #93191
    Profile photo of NoFlo
    NoFlo
    Participant

    Same problem here. Any new information / ideas regarding this?

    #93383
    Profile photo of NoFlo
    NoFlo
    Participant

    some (maybe useful) information I collected @petrockblog, using a Raspberry Pi 2 B

    – The wiring in your guide shows another pin setup of the SNES controller as anywhere else (switched 5V/VCC and Ground) – inadvertently or intentionally?

    – All the connections are working (tested as “arcade controller” with jstest as described above)

    – With the controlblockconfig setting SNES, jstest shows all buttons as “off” if no controller is connected. After connceting a controller, all of the buttons switch to the “on” state and stay “on”.

    – When overclocking (“Pi2” setting), the abovementioned behaviour changes and all buttons are shown as “on”, no matter if a controller is connected or not.

    any ideas?

    #94054
    Profile photo of dotarj
    dotarj
    Participant

    Hi Florian,

    Any news on the SNES controller problem?

    #94116
    Profile photo of petrockblog
    petrockblog
    Keymaster

    NoFlo was right – thanks for that hint. The pinout diagram of the SNES connector is wrong. VCC and GND have to be swapped! I have gone through the assembly description and I could reproduce the erroneous behavior. Swapping GND and VCC solves the problem. Sorry for this wring pinout diagram, I have replaced it now.

    #94150
    Profile photo of stanton
    stanton
    Participant

    I can confirm that a VCC and GND swap resolves the issue for me.
    Thanks for following up!

    #94379
    Profile photo of NoFlo
    NoFlo
    Participant

    Thank you for your information regarding the VCC and GNC connection.

    Unfortunately, even after switching those two I cannot get the SNES controller to work. The strange behaviour when overclocking is solved, but the following persists:

    – With the controlblockconfig setting SNES, jstest shows all buttons as “off” if no controller is connected. After connceting a controller, all of the buttons switch to the “on” state and stay “on”.

    I have no idea, what I could do to solve this problem. Maybe you can tell me something, I can try…

    jstest output with no controller connected:

    Driver version is 2.1.0.
    Joystick (ControlBlock SNES Gamepad) has 2 axes (X, Y)
    and 8 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR).
    Testing … (interrupt to exit)
    Axes: 0: 0 1: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off

    jstest output with controller connected:

    Driver version is 2.1.0.
    Joystick (ControlBlock SNES Gamepad) has 2 axes (X, Y)
    and 8 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR).
    Testing … (interrupt to exit)
    Axes: 0:-32767 1:-32767 Buttons: 0:on 1:on 2:on 3:on 4:on 5:on 6:on 7:on

    #94600
    Profile photo of petrockblog
    petrockblog
    Keymaster

    Maybe you could post a picture with your hardware setup here?

    #94621
    Profile photo of interstate90
    interstate90
    Participant

    I had this same issue and was able to reproduce it when using an overclock that pushes the core to 500Mhz (Turbo & Pi2). I would check your overclock settings and change it to “None” for the time being.

    It seems that pushing the core to 500Mhz causes some issues with the Original NES Controllers?

    #94717
    Profile photo of NoFlo
    NoFlo
    Participant

    Unfortunately the overclocking settings do not affect the behaviour. At all settings, the buttons are “off” with no controller connected, and “on” with a connected controller.
    I also tried to use another power supply, but that did not help either.

    Attached are a few pictures of my setup. The wires are all black, but I checked the wiring many times and the controller pins are connected as documented.
    Even though the Controller Pins are soldered on the circuit board, I ensured that there are no connections between the pins and they are all isolated from the remaining parts.

    As mentioned before, when switching the controller type to arcade, all buttons are working (“on” when connected to GND, “off” when not)

    Edit: @dotarj did you find a solution?

    Attachments:
    #94825
    Profile photo of dotarj
    dotarj
    Participant

    @noflo: I still didn’t get it working. I’ll try reinstalling and reconfiguring RetroPie and see if it works then.

    #94852
    Profile photo of NoFlo
    NoFlo
    Participant

    @noflo: I still didn’t get it working. I’ll try reinstalling and reconfiguring RetroPie and see if it works then.

    For me, this did not work. Installed Retropie on another SD Card to make sure the problems are not related to the current installation but it did not change anything.
    Also, I tried version 2.6 and version 3 BETA with no success.

    I am curious about your experiences with a fresh installation 🙂

    #96608
    Profile photo of sudobarn
    sudobarn
    Participant

    Hi there guys,

    having the same problem. – Have run jstest as above, all fine.

    Have disabled SNESDEV and enabled I2C.

    Running 3.0 Beta on a Raspberry Pi 1 (B+)

    Emulation Station starts, says 2 gamepads detected (even if they aren’t), but no input on either pad has any effect.

    Any thoughts on how to get snes gamepads working?

    #97665
    Profile photo of rich
    rich
    Participant

    I got my controlblock today and I am having the same issues – which is absolutely infuriating as I only bought it for this functionality.

    I have followed all installation steps correctly, set up the service, snesdev is not installed and the soldering and wiring is decent and correctly done. I have followed all troubleshooting steps. It still does not work.

    I have tried it with both an official SNES pad and an unofficial one. Emulation station detects the controlblock as active but then does not register any button presses during the initial controller configuration. When I unplug the controller the software goes mad and assigns two buttons by itself and continues to attempt to do so in a cycle.

    Not happy.

    #97684
    Profile photo of rich
    rich
    Participant

    Also in addition, the power switch does not function correctly. It turns the system off and shuts down correctly, but then the LED does not turn off. I also cannot get the switch to turn the Pi on.

    #97786
    Profile photo of rich
    rich
    Participant

    disregard my last two posts. reinstalled retropie and now it works fine! ha, what the hell.

    very happy now. got wifi installed too along with bluetooth. works like a dream.

Viewing 35 posts - 1 through 35 (of 56 total)

Forums are currently read only - please visit the new RetroPie forums at https://retropie.org.uk/forums/

Skip to toolbar