RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    About the RetroFlag cases! Surprise surprise.... They can cut off power!

    Scheduled Pinned Locked Moved General Discussion and Gaming
    nespi case +safe shutdown
    52 Posts 15 Posters 17.1k 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.
    • cyperghostC
      cyperghost @PWN3D_
      last edited by cyperghost

      @pwn3d_ said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

      yep that was it

      = it does work now?

      Annother question - just curious about the not working GPIO3.... Do you have activated I2C connection somewhere? Maybe that's the reason the GPIO wasn't initiated right.

      The case uses the whole standard connection boards (I2C and UART) so I decided to develop command line parameters.

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

        @cyperghost No ...

        But something else did the trick : I just went to edit multi_switch.sh

        • After "SWITCHTYPES" and "NESPIPLUS" , to #Set GPIOs, I just change GPIO_powerswitch=3 to GPIO_powerswitch=17 (my yellow wire is connected to this GPIO)

        After a reboot, I tried the powerbutton, the red light blinked 4 times, I saw a script rolled, then the pi shut down completely !

        So to identify the problem, does that mean the GPIO 3 on my raspberry is dead ?

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

          @pwn3d_ said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

          So to identify the problem, does that mean the GPIO 3 on my raspberry is dead ?

          I don't think it's dead... I think some I2C device is using this. So it can't be initiated. Interesting indeed!

          about the command line parameter... you know ... powerbtn=11 is not GPIO17. You should write powerbtn=17 that would do the trick without changing the script. But glad it worked and now enjoy ;)

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

            @cyperghost said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

            @pwn3d_ said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

            So to identify the problem, does that mean the GPIO 3 on my raspberry is dead ?

            I don't think it's dead... I think some I2C device is using this.

            about the command line parameter... you know ... powerbtn=11 is not GPIO17. You should write powerbtn=17 that would do the trick without changing the script. But glad it worked!

            Yes, I noticed that, I confused with the number of the pin :)

            I2C device? What is this ?

            And Thank you so much for your help ! I learned a lot ! ;)

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

              @pwn3d_

              Yes, I noticed that, I confused with the number of the pin :)

              https://pinout.xyz/# and now click on BCM17 (=GPIO17)
              you will see ...

              • Physical pin 11 = Board numbering
              • BCM pin 17 = GPIO
              • Wiring Pi pin 0 = arduino like numbering ;)

              In 95% of case we talk about BCM PIN

              I2C device? What is this ?

              It's a communication protocoll to attach sensors, simple displays, board expanders..... very helpfull for much much purposes. But maybe you activated it. Maybe with sudo nano /etc/modules you see some I2C entries.

              And Thank you so much for your help ! I learned a lot ! ;)

              You're welcome

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

                It's a communication protocoll to attach sensors, simple displays, board expanders..... very helpfull for much much purposes. But maybe you activated it. Maybe with sudo nano /etc/modules you see some I2C entries.

                I've checked, i see 2 lines :

                uinput
                I2c-dev

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

                  @pwn3d_ Yes... that's it. But don't ask me there is an active I2C module loaded ;) Usually it's just uinput

                  1 Reply Last reply Reply Quote 0
                  • D
                    devnull22
                    last edited by

                    Hi! Thanks for the script, it works fine on my new 3b+ with the nespi+ case.
                    I am at ease with Linux and scripting in general, not so with GPIO and electronics in general...

                    Is there a way to shut down the fan when everything is plugged in correctly, and set it back up? I'd like to try my hand at scripting something to start it when temp goes over 65 celsius for a minute or two, and shut it down aftwerwards. So far, started reading on gpio and tried understanding what is done with the shutdown_fan script but it evades me =)

                    Will update if I figure it out, but help would be appreciated to get a headstart on if a raspi_gpio command could close down the fan without affecting the rest!

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

                      @devnull22 said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

                      Hi! Thanks for the script, it works fine on my new 3b+ with the nespi+ case.

                      You're welcome

                      I am at ease with Linux and scripting in general, not so with GPIO and electronics in general...

                      GPIO is also not very difficult as these operations are the simplest way to use them.

                      Is there a way to shut down the fan when everything is plugged in correctly, and set it back up?

                      Yes ... therefore you need the shutdown_fan script. This completly cuts down power

                      I'd like to try my hand at scripting something to start it when temp goes over 65 celsius for a minute or two, and shut it down aftwerwards.

                      No this won't be provided by this script. It's possible of course.

                      So far, started reading on gpio and tried understanding what is done with the shutdown_fan script but it evades me =)

                      The shutdown_fan script just sets a GPIO to low, this will cut the power to the PIe, too. I just make a test command check like [[ $1 == "poweroff" ]] to just cut power of you want a real shutdown.

                      Will update if I figure it out, but help would be appreciated to get a headstart on if a raspi_gpio command could close down the fan without affecting the rest!

                      No... that's not possible. The wiring of the case sets the GPIO just to 5V common power. The script just cuts the power .... that's all. You need to do a complete rewiring of the fan to achieve this. Use a transistor or a (opto)mosfet to achive this. Then a GPIO which can switch to low/high will switch 5v rail to the fan.

                      1 Reply Last reply Reply Quote 0
                      • C
                        cloudlink
                        last edited by

                        With your script, if I execute the following line to restart ES, should it save metadata?

                        /home/pi/RetroPie/scripts/multi_switch.sh --es-restart

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

                          @cloudlink Yes

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

                            @cyperghost said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

                            Write some feedback and sorry for inconvience

                            I've just bought the NESPI+ case and now am at the stage of RTF -lack of- M part of my research and came up to your script/post(s) here on the Forum. The Arguments provided by you to use your script instead of the one by Retroflag sound valid and I am eager to try it out, but I am confused/puzzled by the shutdown_fan script part. Would you be so kind to elaborate this a bit further (what is it exactly for [whence does it cuts down the power? in general, just if the pi ain't overheating and if so, can a threshold be set? <ok, the last case (heat management) is just wishfull thinking i assume>] (i haven't installed a fan so far into the case), is it neccessary or just needed by some users, ... )

                            Thanks for the script and in advance for your answer!

                            P.S.: Yes, I've read through your other Thread (https://retropie.org.uk/forum/topic/17415/multi-switch-shutdown-script), but the talk there about the fan just added up to my confusion :/ [maybe I would understand it better if i actually had a fan installed (so far i assume that the case is providing no power to the fan if the power button is set to off, or why does it have its own connector for a fan? The Concept of the case providing power to the pi-board and then taking power from the GPIOs of that board to provide it to its own fan connector sounds a bit strange to me, as is the thought that there my be a current on the GPIOs after the power is cut off via the power-button...)]

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

                              @ashpool

                              but I am confused/puzzled by the shutdown_fan script part

                              I'll descripe

                              The Concept of the case providing power to the pi-board and then taking power from the GPIOs of that board to provide it to its own fan connector sounds a bit strange to me, as is the thought that there my be a current on the GPIOs after the power is cut off via the power-button...)]

                              The concept is fine, because you can ask the same question: How are the external USB ports connceted to current? They also powered by the GPIO ports.

                              I descripe how the poweroff usually works. The poweroff state is always initated by a software call. You can connect to SSH and type sudo poweroff or you can watch a GPIO state of a switch and a script will write sudo poweroff. So you see it doesn't matter how a shutdown is initiated.
                              The Pie lacks of a power on/off switch so by typing sudo poweroff you just leave the Pie in a kind of standby-mode. You see the red LED still glows after a shutdown and the GPIO is still powered >> so a connected fan is still running in background.

                              Switches designed for the Pie need always a power on/off control. That's just a connection to a GPIO that tells the powerswitch-device the Pie is providing current to me >> it's operating, I deliever power. The Pie is not providing current >> it's not operating, I can close power delivering (=shutdown).

                              The the shutdown_fan script just set a GPIO to 0 and tells the power switch device to cut power. That's happens in a moment the Pie is in deep sleep mode (so no writing operation to SD can happen, only to volatile RAM). So you have a total cut of current and external fans, USB devices and the red LED will be unpowered.

                              I know the name is a bit confusing but that was the intention as I developd this.... People asked me, okay the script is working perfect but my fan is still blowing... Therefore shutdown_fan

                              Hope this helped!

                              1 Reply Last reply Reply Quote 1
                              • AshpoolA
                                Ashpool
                                last edited by

                                @cyperghost said in About the NESPi+ case! Surprise surprise.... It can cut off power!:

                                Hope this helped!

                                Yup & :up: :D

                                1 Reply Last reply Reply Quote 0
                                • N
                                  Necro
                                  last edited by Necro

                                  I've installed the script - but not the fan script - and it seems to work fine (power button, reset button, etc.). I did this based on finding the script from another thread first.

                                  Wondering if the fan power down is still needed if connecting via the NesPi+ case fan headers or only through other GPIO pins?

                                  It takes a few seconds. Basically, 4 blinks, black screen, then 4-5 seconds, and then fan turns off and it powers off completely (no LED on the Pi is lit).

                                  Also - totally unrelated to the above - I'm not certain why, but I need to run the script using "bash " at the front of my commands. Found a forum post somewhere noting to try that if a script won't run due to some file system issue and it fixed things for me - in case it comes up for others.

                                  1 Reply Last reply Reply Quote 1
                                  • N
                                    NielsPi
                                    last edited by

                                    Wow! This is so awesome! I was disappointed with the original shutdown script from RetroFlag, but yours, good sir @cyperghost, is doing exactly what I want. Many thanks!

                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      pilsnerz
                                      last edited by pilsnerz

                                      @cyperghost I'm having a hard time getting the script to work. Nothing is happening for the power or reboot button. I never installed the original Nespi script. When I try to execute multi_switch.sh it gives me a Permission denied error.

                                      I'm on a 3B running 4.4 also using a usb stick for my roms if that matters.

                                      P 1 Reply Last reply Reply Quote 0
                                      • P
                                        pilsnerz @pilsnerz
                                        last edited by

                                        @pilsnerz said in About the RetroFlag cases! Surprise surprise.... They can cut off power!:

                                        @cyperghost

                                        Just bumping this @cyperghost or if I anyone has ran into this

                                        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.