RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Rigging reset and shutdown buttons

    Scheduled Pinned Locked Moved Help and Support
    zerogpio
    7 Posts 2 Posters 1.9k Views
    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.
    • H
      Haemogoblin
      last edited by

      I'm building a pi zero gaming system and would like to setup buttons reset and power. I've seen plenty of tutorials walking through one or the other, but not how to do both.

      If anyone can help, I'd be really grateful

      :-)

      1 Reply Last reply Reply Quote 0
      • cyperghostC
        cyperghost
        last edited by cyperghost

        There are several question you should answer yourself?

        1. How is the system powered?
          1.1 via usual USB power cord
          1.2 via an external switch like PowerBlock, Mausberry, ATXpi....

        Then you can might answer
        2. Which Button to use
        2.1 Momentary
        2.2 Latching

        1. Reset Button (a momentary makes most sense)
          3.1 Action just as GPIO input so a software process takes action
          3.2 Action as hardware input so acts as real/hard reset for Raspberry
          3.3 Action as hardware to act as reset button for an external power device (Powerblock or Mausberry)

        So out of this list I recommand following points
        1.2 so buy an Mausberry or Powerblock
        2.1 I would recommand momentary buttons
        3.1 Use as GPIO input, to reset/restart ES or to terminate running emulators or to do a reboot if you press the button longer than 5 seconds or so (this is a software thing)

        I assembeld this during my last (small) project Yet annother Retroflag NESPi case
        I strongly recommend @meleu's wonderful shutdown service!
        and this tut made by @Yahmez here

        But you will have to do some steps in programming but don't panic - there are lots of helpfull people here. So feel free to ask if you have questions :)

        cyperghostC 1 Reply Last reply Reply Quote 2
        • H
          Haemogoblin
          last edited by

          Okidoki here is my answer

          1. Using a stock 2.5a Rpi PSU
          2. Momentary for the reset and power (I believe this is consistent with the original megadrive.
          3. I would prefer the reset to cause a sudo shutdown -r to occur. BUT I would settle for ES terminating back to main menu.

          I think I now have the power button in the bag, using a Pimoroni on/off shim.

          cyperghostC 2 Replies Last reply Reply Quote 0
          • cyperghostC
            cyperghost @Haemogoblin
            last edited by

            @haemogoblin said in Rigging reset and shutdown buttons:

            Pimoroni on/off shim

            Yes this looks suitable, too
            You connect the power button with the shim to fullfill power on power off actions

            The reset button has to be connected to the GPIO. With a bit programming you can do whatever you want. I think the best thing would be a small piece of software like this

            Pseudocode

            Hold reset button for 0,5sec
            and if you release it within 2-2,5 secs than
            if an Emulator is active then terminate this and go back to ES
            if ES is active then restart ES (usefull if you want refresh Favourites or custom collections ....)
            
            and if you release it __NOT__ within 2-2,5 secs than
            proper terminate all instances of EMULATORS and ES (important for not loosing metadata) and reboot the Pie
            
            H 1 Reply Last reply Reply Quote 0
            • H
              Haemogoblin @cyperghost
              last edited by

              @cyperghost

              Yes that would be perfect, where do i find that code?

              1 Reply Last reply Reply Quote 0
              • cyperghostC
                cyperghost @cyperghost
                last edited by cyperghost

                @Haemogoblin Take a look at this here is a good code example for your purposes
                @cyperghost said in Rigging reset and shutdown buttons:

                But you will have to do some steps in programming but don't panic - there are lots of helpfull people here. So feel free to ask if you have questions :)

                1 Reply Last reply Reply Quote 0
                • cyperghostC
                  cyperghost @Haemogoblin
                  last edited by

                  @haemogoblin said in Rigging reset and shutdown buttons:

                  I think I now have the power button in the bag, using a Pimoroni on/off shim.

                  I've written a small tutorial for the OnOff SHIM here

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

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.