Homepage Forums RetroPie Project Controller Configuration in RetroPie Teensy controller – manually write controller config file

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #101083
    rasmushauschild
    Participant

    Hi, I have made a custom gamepad/controller using an Arduino type called Teensy. For some reason The auto-controller-configuration in retropie does not save my configuration-file in the /opt/retropie/configs/all/retroarch-joypads directory. Therefore I would like, to write the file manually. How do I do this? Do I just edit one of the pre-configured controller files to the right name, button-numbers and hotkeys?
    Thanks

    #101110
    Floob
    Member

    Does the jstest output tell you the button mappings?

    Is it like this?
    http://www.instructables.com/id/SNES-Teensy-USBPS3-Gamepad/

    #101119
    rasmushauschild
    Participant

    Hi.
    The jstest displays all the buttons and analog axes and their number/mapping.
    Yes, the teensy board that i’m using is just the same as in that toturial. However I didn’t write my script in HEX, but in the Arduino IDE. Also my controller has been made from parts, if that makes any difference :)
    Tank you in advance

    #101122
    Floob
    Member

    Here is an example file that should be placed here:
    /opt/retropie/configs/all/retroarch-joypads

    http://pastebin.com/raw.php?i=vYP9xSeF

    You can get the input_device value by looking at the “iproduct” value.
    use “lsusb -v”
    Or for a specific device, like this
    “sudo lsusb -D /dev/bus/usb/001/004”

    because mine is the 4th device on the usb bus

    Anyway… not sure if it will work but you can try.

    #101147
    rasmushauschild
    Participant

    Hi again. To get the iproduct value, should I just try to type lsusb -v in the home directory? The file that you’re linking to is the USBGamepad.cfg in /opt/retropie/configs/all/retroarch-joypads right?
    If so, I only see “code” for one directional control, and my gamepad has both an analog thumbstick and a controll cross. I believe, that the axes up, down, left and right in the USBGamepad.cfg file are for a control cross? Can I add an analog thumbstick to the USBGamepad.cfg file? If so, then how?
    Thanks

    #101175
    Floob
    Member

    To test the principle lets just try the buttons first.

    whats your output when you type lsusb ?

    #101179
    rasmushauschild
    Participant

    Sure :)
    When i type lsusb with the Teensy gamepad plugged in it says:
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
    Bus 001 Device 004: ID 413c:2107 Dell Computer Corp.
    Bus 001 Device 005: ID 16c0:0487 VOTI Teensyduino Serial+Keyboard+Mouse+Joystick

    The Bus 001 Device 005 is my gamepad
    Also I think I might know why retroarch won’t save the controller config-file. Could it be because the name of the gamepad (TeensyduinoSerial/Keyboard/Mouse/Joystick) includes “/”? I think that Retroarch gets confused, and thinks that the name of my gamepad is a directory. However in the output, when I type lsusb, all “/” are replaced by “+”.
    What do you think, could this be the reason why Retrach doesn’t save my gamepad config-file?
    Thank you in adavnce

    #101182
    Floob
    Member

    Ok, now try

    “sudo lsusb -D /dev/bus/usb/001/005″

    and look for the iProduct value.

    And can you screenshot the jstest output as well?

    #101190
    rasmushauschild
    Participant

    The iProduct “value” is: 2 Serial/Keyboard/Mouse/Joystick
    the Jstes is almost unreadeble on my Mac, so I also took picture of the screen with the raspberry pi. I’ll upload both. Also when I move the thumbstick all the text and values scroll down the screen – not like the jstest I can do with my SNES USB gamepad.

    Also in my last post I wrote: Could it be because the name of the gamepad (TeensyduinoSerial/Keyboard/Mouse/Joystick) includes “/”? I think that Retroarch gets confused, and thinks that the name of my gamepad is a directory. However in the output, when I type lsusb, all “/” are replaced by “+”.
    What do you think, could this be the reason why Retrach doesn’t save my gamepad config-file?

    Do you have any idea if this could be the case?
    Thanks

    #101195
    rasmushauschild
    Participant

    Hi, it seems like I can’t upload any images to this forum…
    I have uploaded both images of the jstest on my own website: http://minifactory.dk/test.html
    sorry for the delay :)

    #101198
    Floob
    Member

    You could put this file in:
    /opt/retropie/configs/all/retroarch-joypads

    I think you can call it anything – try “joypadtest.cfg”
    It may well need a different driver name

    input_device = "2 Serial/Keyboard/Mouse/Joystick"
    input_driver = "udev"
    input_up_axis = "-1"
    input_right_axis = "+0"
    input_down_axis = "+1"
    input_left_axis = "-0"
    input_a_btn = "13"
    input_b_btn = "14"
    input_x_btn = "15"
    input_y_btn = "999"
    input_l_btn = "3"
    input_r_btn = "4"
    input_start_btn = "7"
    input_exit_emulator_btn = "7"
    input_select_btn = "6"
    input_enable_hotkey_btn = "6"

    Although this implies you may be better outputting keyboard keys from the Teensy:
    https://forums.adafruit.com/viewtopic.php?f=8&t=58901

    What you want is yellow text at the bottom of the screen when you start a retroarch based game, indicating it has found the joypad.

    Yes, you could be right about the / marks in the name – do you have a file here?
    /home/pi/.emulationstation/es_temporaryinput.cfg ?

    #101199
    rasmushauschild
    Participant

    Hi, I’ll try that config-file tomorrow.
    Thank you so much, for putting this much effort into helping me out! :)

    A very important thing for me is to have a full analog thumbstick, since I love n64 games. And I don’t think you can have that, if the Teensy is programmed as a keyboard, but I might be wrong?
    In the directory “/home/pi/.emulationstation/es_temporaryinput.cfg” there is a configuration-file for my keyboard. i’ve posted a picture of the file here: http://minifactory.dk/test.html
    Thanks again :)

    #101200
    Floob
    Member

    Maybe tomorrow unplug your keyboard and boot into ES again – then re-post that temp file as it should catch the teensy settings then.

    #101201
    rasmushauschild
    Participant

    Sure, thanks

    #101216
    rasmushauschild
    Participant

    Hi, I tried to create the new “joypadtest” in /opt/retropie/configs/all/retroarch-joypads. At first it didn’t work, but I then changed the iproduct/name to the one shown in jstest, and it worked! I got the yellow text, and my gamepad was fully functional in any retroarch game! Now the only thing left to do is to get the analog thumbstick to work. Could I just copy-paste the part, coding for the analog joypad from another config-file in /opt/retropie/configs/all/retroarch-joypads?

    Now it’s the teensy, that is in the “/home/pi/.emulationstation/es_temporaryinput.cfg”.
    Here’s the new picture: http://minifactory.dk/test.html
    You’ll see, that it has only 2 analog axes from the thumbstick, this is because it wont let me register both up and down or left and right in emulationstation, however in the retroarch controller setup/configuration it will sometimes accept all directions.
    Thanks

    #101265
    rasmushauschild
    Participant

    Hi, So I actually got the thumbstick working, by copying and pasting the analog thumbstick code from a PS3 controller-config file. But when I try to walk around in super mario 64 he’s walking so slow. I think this is because my thumbstick is the same as you would find I a PSP (it’s very small compared to a regular thumbstick).
    So how can I change the code, so retroarch knows the max value of the thumbstick (so that when I press it all the way the forward Mario will run (as if played with an original n64 gamepad) instead of walking very slow.
    Thanks

Viewing 16 posts - 1 through 16 (of 16 total)
  • The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.