Recalbox Forum

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

    Solved GPIO with RPi 1 (26 PIN GPIO)

    GamePad/GPIO/USB encoder
    gpio pin
    3
    10
    1630
    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.
    • Raketenmann
      Raketenmann last edited by

      Hi there,

      I cannot configure my (BarTop) Joystick.
      see: https://github.com/recalbox/mk_arcade_joystick_rpi/blob/hotkeybtn/README.md#pinout

      And here is, what I tried in my .conf file.
      (of course I also tried standard config)

      ------------ 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=5

      Custom mk_gpio arguments,

      map=5 gpio1=Y-,Y+,X-,X+,start,select,a,b,tr,y,x,tl,hk for one controller,
      map=5 gpio1=pin11,pin7,pin13,pin15,pin19,pin21,pin22,pin18,pin16,pin12,pin-1,pin-1,pin3

      map=5,6 gpio1=Y-,Y+,X-,X+,start,select,a,b,tr,y,x,tl,hk gpio2=Y-,Y+,X-,X+,start,select,a,b,tr,y,x,tl,hk for 2 (map=5,map=5,6)

      map=5,6 gpio1=gpiox,gpioy,gpioz,.....,gpiou,gpiov gpio2=gpiox,gpioy,gpioz,.....,gpiou,gpiov

      where gpiox,gpioy,gpioz ... are NOT pin numbers on the connector, BUT location gpio numbered as in

      https://www.raspberrypi-spy.co.uk/wp-content/uploads/2012/06/Raspberry-Pi-GPIO-Layout-Model-B-Plus-rotated-2700x900.png

      Set pin to -1 to disable it

      controllers.gpio.args=map=5 gpio=11,7,13,15,19,21,22,18,16,12,-1,-1,3

      MCP configuration : GPIO and MCP can be used together. You can mix them.

      map=0x20,0x21 for 2 mcp23017 on i2c bus

      #controllers.gpio.args=map=0x20,0x21,5,6 gpio=4,17,27,22,10,9,25,24,23,18,15,14,-1 gpio2=11,5,6,13,19,26,21,20,16,12,7,8,-1

      It just doesn't work at all.
      Any ideas?
      Thank you!
      Christian

      1 Reply Last reply Reply Quote 0
      • ian57
        ian57 Staff last edited by

        @Raketenmann You need to check with a ssh connection and linux commands that le mk_arcade module il well loaded. After, use evtest to test each button and joystick direction. Which rela**e of rpi1 do you have ? 512B b+ ?

        "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

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

          Hi IAN57,
          thanks for the quick answer.
          The module is loaded - it seams to me:
          Module Size Used by Tainted: G
          mk_arcade_joystick_rpi 4442 0

          And here is the output from the evtest:
          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

          But no reaction on any input.

          RPi Version: Pi Model B Rev 2
          (thats the output from cat /sys/firmware/devicetree/base/model)

          Thanks!
          CHristian

          1 Reply Last reply Reply Quote 0
          • ian57
            ian57 Staff last edited by ian57

            @Raketenmann which release of RB are you running because with 6.0 I made a mistake in the mk_arcade module preventing pi0 ans pi1 to work with gpio see here https://github.com/recalbox/mk_arcade_joystick_rpi/issues/71. Please try the last beta 3 or DL the new mk_arcade_joystick_rpi.ko at https://mega.nz/#!y9kCEI7I!7HdyKzhWS4HhfVgpvj7SM9RbnLwMUlGXoUqcxzuFCQM
            replace the /lib/modules/4.14.62/extra/mk_arcade_joystick_rpi.ko with the new one and enjoy 🙂

            "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

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

              Hi Ian,
              it might be a stupid question. But how to copy the file?

              cp: can't create '/lib/modules/4.14.62/extra/mk_arcade_joystick_rpi.ko': File exists

              Sure. But if I try to delete it - even with root / su

              rm: can't remove 'mk_arcade_joystick_rpi.ko': Read-only file system

              BTW - Recalbox UI shows there is an update available if I switch to "BETA". But the download fails.

              Thank you!
              Christian

              OyyoDams 1 Reply Last reply Reply Quote 0
              • OyyoDams
                OyyoDams Staff @Raketenmann last edited by

                @raketenmann mount -o remount,rw /

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

                  Thank you Gentlemen!

                  Works now.
                  Not perfect. But I received a first feedback while configure controls. Rest will be easy and fixed in the config file later today.

                  You may close this!
                  Great support.
                  Thanks!
                  Christian

                  ian57 1 Reply Last reply Reply Quote 0
                  • ian57
                    ian57 Staff @Raketenmann last edited by

                    @raketenmann Do not try to update :), It would downgrade to 6.0 I think 😉

                    "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

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

                      Thx!
                      First I tried to update. Did not worked.
                      Thats why I changed the File by using the shared folder and SSH.

                      Now- as it works - I will keep it until the next official release where you hopefully take care on RPi 1 users.
                      😉

                      Again: great support.
                      Thx
                      CHristian

                      ian57 1 Reply Last reply Reply Quote 0
                      • ian57
                        ian57 Staff @Raketenmann last edited by

                        @raketenmann I hope to :), but Pi0 is very close to Pi1 of first gen... so it shoulb be 😉

                        "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." Dennis Ritchie

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Want to support us ?

                        75
                        Online

                        99.6k
                        Users

                        28.1k
                        Topics

                        187.1k
                        Posts

                        Copyright © 2021 recalbox.com