Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Mapping GPIO poru Game-Hat

    Manettes/GPIO/Encodeurs
    mapping gpio poru game-hat
    9
    17
    10354
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Elwood69
      Elwood69 last edited by

      Bonjour,
      J'ai epluché le forum pour pouvoir remappé les GPIO pour essayer de faire tourner recalbox sur une game-hat de waveshare. J'ai vu qu'il fallait un version du driver qui accepte le remapping, mais celui posté par @Substring n'est plus dispo. Si quelqu'un veut bien me le remettre en ligne que j'essaye, ce serait sympa.
      J'ai essayé la version instable en cours car apparemment c'était possible de remapper, mais rien à faire il démarre toujours avec le map par défaut.
      Merci par avance
      El

      1 Reply Last reply Reply Quote 0
      • Elwood69
        Elwood69 last edited by

        Bonjour,
        Désolé de revenir à la charge, mais j'ai essayé beaucoup de choses, y compris de recompiler moi-même mais sans-succès, est ce que quelqu'un à ce fameux mk_arcade_joystick_rpi.ko posté par @Substring et @Dragu
        qui permettrait la reconfig des GPIO ?
        J'ai aussi suivi le post sur la version en test qui permet soit disant la reconfig des GPIO mais idem sans succès.
        Merci pour le support
        El

        cheungbx 1 Reply Last reply Reply Quote 0
        • Dragu
          Dragu Banned last edited by Dragu

          @Elwood69
          Hi,
          it seems to be not there anymore, so I load it up on my server,
          you must replace the existing file in /lib/modules/4.4.13-v7/extra/
          http://zclub.eu/mk_arcade_joystick_rpi.ko
          and reconfigurate the line in recalbox.conf as described after your gpio
          connections and only this.

          1 Reply Last reply Reply Quote 0
          • Elwood69
            Elwood69 last edited by

            Hi Dragu,
            Thanks a lot! I try right now and let you know when it is Ok.
            El

            1 Reply Last reply Reply Quote 0
            • Elwood69
              Elwood69 last edited by

              It works well!
              Thanks a lot.
              Recalbox is fully working on a GameHat.

              El

              1 Reply Last reply Reply Quote 0
              • Dragu
                Dragu Banned last edited by Dragu

                Très bien, c'est un truc intéressant et beaucoup moins cher que mon Freeplay GBA.
                Pour le mk_arcade_joystick_rpi.ko je l'utilise aussi pour le moment, mais il y a des touches qui me manquent. J'ai ici encore la source d'une version pour 17 touches et réagissant aussi sur un flanc de tension montant. Pas encore eu le temps de compiler.
                Pour le display waveshare existe un driver alternatif beaucoup plus rapide.
                fbcp-ili9341. Il permet aussi d'adapter le viewport, important si comme dans le cas du GBA. la carcasse grignote sur les bords. Quake marche très bien sur ces trucs 😉

                1 Reply Last reply Reply Quote 0
                • cissou
                  cissou last edited by

                  Je remets un lien vers le fichier .ko mk_arcade_joystick_rpi.ko

                  Dell 3020M + X360 sans fil
                  Bartop Modulaire : Rpi3
                  Gpi case rpi0 -sans W- [oui je suis un fou]

                  1 Reply Last reply Reply Quote 1
                  • DarthVad3r
                    DarthVad3r last edited by

                    Salut a tous
                    Je tente désespérément de faire marcher recalbox avec mon gamehat car retropie j'adhère pas.
                    Après avoir remplacer le fichier par celui fourni dans le post, que doit on faire dans la config pour que ça fonctionne ?
                    Car j'ai tenté de reconfigurer les touches via l'interface de recalbox mais il y a des touches qui ne sont pas reconnues.
                    Comment remapper le gpio afin de le faire fonctionner ?
                    Merci !

                    1 Reply Last reply Reply Quote 0
                    • bastoo735
                      bastoo735 last edited by

                      si une personne pourrais prendre le temps d'expliquer la marche a suivre pour faire fonctionner le game hat sous recalbox avec le game hat je dis pas non .
                      merci d'avance si on nous répond avec l'explication

                      Elwood69 1 Reply Last reply Reply Quote 0
                      • Elwood69
                        Elwood69 @bastoo735 last edited by

                        Salut,
                        Il faut déposer le mk_arcade_joystick_rpi.ko dans le dossier comme expliqué plus haut.
                        Puis dans recalbox.conf il faut configurer le GPIO comme ceci :
                        controllers.gpio.args="map=5 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1"
                        Enjoy !

                        El

                        1 Reply Last reply Reply Quote 0
                        • bastoo735
                          bastoo735 last edited by

                          merci pour ta réponse le problème que je ne sais pas comment remplacer le fichier je ne trouve pas l'emplacement du fichier /lib/modules/4.4.13-v7/extra/ pourrais tu m'indiquer comment y accéder ? après sa je pense que sa ira .

                          désoler de t'ennuyer pour si peu

                          1 Reply Last reply Reply Quote 0
                          • Dennis Müller
                            Dennis Müller last edited by

                            It works!!

                            I have made the following steps:

                            • Write the latest recalbox image on SD Card.
                            • Start the recalbox with gamehat and connect to your network.
                            • Use a FTP Programm (i used WinSCP) and copy the mk_arcade_joystick_rpi.ko on your recalbox to "/recalbox/share/system".
                            • Log into your Recalbox with SSH (i used Putty)
                            • Do following commands in your console without quotation mark:

                            "mount -o remount rw, /" Make the root path writable

                            "mv /recalbox/share/system/mk_arcade_joystick_rpi.ko /lib/modules/4.4.13-v7/extra/" Move and override the mk_arcade_joystick_rpi.ko file

                            "nano /recalbox/share/system/recalbox.conf" Edit the recalbox.conf

                            • Scroll to "D2 - GPIO Controllers" and override the line "controllers.gpio.enabled=0" to "controllers.gpio.enabled=1"

                            • Override the line "controllers.gpio.args=map=1,2" to controllers.gpio.args="map=5 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1"

                            • Save with crtl + O and enter

                            Following command: "shutdown -r now" Restart your recalbox

                            Now it should work.

                            Thank you for your help!

                            massyla 1 Reply Last reply Reply Quote 1
                            • DarthVad3r
                              DarthVad3r last edited by

                              Merci 1000 fois @Elwood69 ca fonctionne nikel !!!
                              Thanks a lot @Dennis-Müller, it works like a charm 😉
                              Merci encore

                              1 Reply Last reply Reply Quote 0
                              • massyla
                                massyla @Dennis Müller last edited by

                                @dennis-müller
                                Does not work......mine I had to change the folder to
                                mv /recalbox/share/system/mk_arcade_joystick_rpi.ko /lib/modules/4.14.62-v7/extra/
                                to reflect current version.
                                Assuming this folder change has nothing to do with non-function.
                                tried both with and without quotation mark.
                                controllers.gpio.args="map=5 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1"
                                controllers.gpio.args=map=5 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1
                                any idea why not working???

                                1 Reply Last reply Reply Quote 0
                                • Dennis Müller
                                  Dennis Müller last edited by acris

                                  This is my configuration on /recalbox/share/system/recalbox.conf

                                  # ------------ D2 - GPIO Controllers ------------ #
                                  ##GPIO Controllers
                                  ## enable controllers on GPIO with mk_arcarde_joystick_rpi (0,1)
                                  controllers.gpio.enabled=1
                                  ## mk_gpio arguments, map=1 for one controller, map=1,2 for 2 (map=1,map=1,2)
                                  ## controllers.gpio.args=map=1,2
                                  controllers.gpio.args="map=5 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1"
                                  

                                  Please ignore Exclamation mark! I had to put it in front of it because the number sign puts the line as headline

                                  Edit Modo
                                  https://www.markdownguide.org/basic-syntax/

                                  1 Reply Last reply Reply Quote 0
                                  • cheungbx
                                    cheungbx @Elwood69 last edited by cheungbx

                                    @elwood69
                                    I happened to encounter the same issues with the latest version of the recalbox.
                                    Like you, I was also trying to read through this forum and follows suggestions from other posts that may work for the version the poster is having, but only to found that I could not make it work in the version of recalbox I am using.
                                    Then I started looking at the logs and checking which script or config file could have caused the issue. I was only able to find what caused the issue after a week of checking.

                                    This issue happens in both the 2018 Xmas beta and the version before that as well.
                                    There is a bug in the boot up script /recalbox/scripts/recalbox-config.sh that did not pass the second parameter in the recalbox.conf file to the mk_arcade_joystick_rpi.ko.
                                    You can ssh into the recalbox and type this command to check what parameters have been passed to the mk_arcade_joystick_rpi.ko module when the /recalbox/scripts/recalbox-config.sh is run.

                                    cat /recalbox/share/system/logs/recalbox.log | grep gpio

                                    If the parameters are correctly passed, you will see something like this (taken from my recalbox with the waveshare game hat).
                                    loading module mk_arcade_joystick_rpi args = map=4 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1
                                    But if the parameters are not successfully passed, the module will log an error in this log file.

                                    What version of recalbox are you using ?
                                    you can type this command to find out
                                    uname -r
                                    mine is 4.14.62

                                    I also tried my methods below successful with the other package I downloaded (those bundled with game roms)
                                    4.14.62-v7

                                    I made two posts that you can reference, one for my 2.2" TFT + custom GPIO button set up.
                                    https://forum.recalbox.com/topic/16295/recalbox-2018-xmas-beta-using-2-2-tft-lcd-and-gpio-buttons

                                    Another one for the setup for the custom GPIO pins that comes with the waveshare game hat
                                    https://forum.recalbox.com/topic/16307/recalbox-on-waveshare-game-hat

                                    I don't have to load another version of the mk_arcade_joystick_rpi.ko. I just use the one that comes bundled with the version of recalbox released.
                                    Then edit the recalbox.conf to put in the mapping commands.
                                    e.g. for my waveshare game hat I use the following:

                                    controllers.gpio.enabled=1
                                    controllers.gpio.arg=map=4 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1

                                    Then edit the script file (/recalbox/scripts/recalbox-config.sh) to also pass the second parameter to mk_arcade_joystick_rpi.ko.

                                    mount -o remount, rw /

                                    vi /recalbox/scripts/recalbox-config.sh

                                    While in Vi Search for the line with extra2=“$4” using the command /extra2=“ , then press ENTER and a to add a line after it.

                                    extra3=“$5”

                                    Then Search for the line with map="$extra2” using the command /map=“
                                    Then change it to
                                    map="$extra2 $extra3”

                                    After that, reboot the recall box to take effect of the changes by typing

                                    shutdown –r now

                                    If you just want to test if it works before changing all the files, you can SSH into your recalbox, then manually load the mk_arcade_joystick_rpi.ko module with the parameters for the custom GPIO pins using the following commands:

                                    #unload the GPIO controller module
                                    rmmod mk_arcade_joystick_rpi
                                    #load it with the custom gpio mapping of waveshare game hat,note replace 4.14.62 with the version name you found in command 'uname -r'
                                    insmod /lib/modules/4.14.62/extra/mk_arcade_joystick_rpi.ko map=4 gpio=5,6,13,19,21,4,26,12,23,20,16,18,-1

                                    I already made a post at the tester corner, hope the team can read it and fix this before the next release.

                                    Hope this help.

                                    1 Reply Last reply Reply Quote 1
                                    • AlfaJackal
                                      AlfaJackal last edited by

                                      Tried this exactly as you wrote but with the current stable build on a Pi3b. What happens is this: https://i.imgur.com/KJeZjIa.jpg

                                      Here is my config:

                                      ## GPIO Controllers
                                      ## enable controllers on GPIO with mk_arcarde_joystick_rpi (0,1)
                                      controllers.gpio.enabled=1
                                      ## mk_gpio arguments, map=1 for one controller, map=1,2 for 2 (map=1,map=1,2)
                                      #controllers.gpio.args=map=1,2
                                      controllers.gpio.args=map=5 gpio=5,4,14,22,13,18,21,16,6,20,26,12,-1
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post

                                      Want to support us ?

                                      51
                                      Online

                                      99.2k
                                      Users

                                      28.1k
                                      Topics

                                      187.1k
                                      Posts

                                      Copyright © 2021 recalbox.com