• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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.
  • C
    cyperghost @PWN3D_
    last edited by cyperghost 28 May 2018, 18:44

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

    Hi,
    I think I got it all right, the reset button work just as it should and reset to the ES loading screen, but the power button doesn't work at all and the red led is still on when I press it.
    Well i'm a begginer so there is probably something I'm doing wrong.

    I also notice that with the safeshutdown from Retroflag ( wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/install.sh" | sudo bash ), if I want to turn off the pi, i have to switch the power button to off and then press reset. Switching th power button to off doesn't do anything on his own.

    So yep, i'm lost ... :/

    Please install the "shutdown_fan" script... type:
    cd /lib/systemd/system-shutdown/ && sudo wget https://raw.githubusercontent.com/crcerror/ES-generic-shutdown/master/shutdown_fan && sudo chmod +x shutdown_fan

    This will cut power if you press power button.

    The method the retroflag script provides works in most cases but it's a simple "killall" and it will fail if there is a emulator running in background.
    But I'm a bit confused.... Reset works... Power on/off not? Did you set the NESPi-case switch to "ON"?

    Please remove the retroflag script by editing sudo nano /etc/rc.local and remove the python entry.

    E P 2 Replies Last reply 29 May 2018, 01:50 Reply Quote 0
    • E
      edmaul69 @cyperghost
      last edited by 29 May 2018, 01:50

      @cyperghost im really confused. Retroflag says that their script does safe shutdown and safe reset. And to me it appears to be doing just that. How is this better?

      C 1 Reply Last reply 29 May 2018, 02:55 Reply Quote 0
      • C
        cyperghost @edmaul69
        last edited by cyperghost 29 May 2018, 02:55

        @edmaul69 They do a safe shutdown by killing every instance of emulationstation binary but this method may fail if there is a emulator running in background. These may be a edge example but it's an improper way to terminate emulation station and is not clean way to save metadata.

        Furthermore.... the reset button. It's just a waste of option with the original script as it just acts as a system reboot. The multi_switch script just resets the emulator (if there is one is running) and you turn back to ES main menu, or you restart just ES without performing a reboot (usefull if you changed metadata and want to save it, too).

        All in all it doesn't matter which way you choose. Imho I would NOT use the original script but would stick to python and modify the original script like I've done here: Get text output from bash into you python script

        In the end you decide ... I created the script to cover a lot of usecases and to make work to install switch to a Pie a bit more easier. Furthermore I learned a lot about handling command line parameters (used a uncommon method without shifting every single parameter).

        In short why I don't rely on the retroflag script:

        • Fixed shutdown timer (5 seconds in every case)
        • The metadata may break in edge cases
        • Reset button is useless (imho)
        • (not related to the script itself) They change /boot/command to set UART for LED output
        • The python libary (GPIOzero) is a real heavyweight (but very comfortable I must agree)
        • I wanted to do something in bash ... as long as @meleu don't fixed the ES shutdown service (therefore I installed the --es-systemd parameter)

        So I hope you are not confused anymore ;)

        1 Reply Last reply Reply Quote 1
        • P
          PWN3D_ @cyperghost
          last edited by PWN3D_ 29 May 2018, 10:40

          @cyperghost

          Ok, I've instaled the shutdown_fan script, but it appears as shutdown_fan.sh1 , so I guess it was already there.

          Sorry for the confusion about the Power switch , I'll try to be clear :
          (The Nespi case switch is turned to ON)

          -With the retroflag script, the Power on/off only works to turn on the pi. When I press the Power button to "off", it doesn't do anything. If I want to trun off the pi, i also have to press the reset button, see the retroflag script rolling to the end until it finally turn off the pi.

          -With your script, it is the story, the Power off doesn't do anything but as the reset button only restart ES, I can't turn off the pi.

          So yes, the Reset button work perfectly, the Power button works only in one way, when I have to turn On the pi.

          PS: Today I have tested with a fresh sd card without the retroflag script, but this ended with the same result unfortunatly

          PSS: Also I should mention my what I am working with :
          -Nespi Case+
          -Raspberry Pi 3 B+
          -Kitty for SHH
          -San Disk Ultra 16GB

          C 1 Reply Last reply 29 May 2018, 15:05 Reply Quote 0
          • C
            cyperghost @PWN3D_
            last edited by cyperghost 29 May 2018, 15:05

            @pwn3d_
            Then I guess there is something wrong with the case.

            -With the retroflag script, the Power on/off only works to turn on the pi. When I press the Power button to "off", it doesn't do anything. If I want to trun off the pi, i also have to press the reset button, see the retroflag script rolling to the end until it finally turn off the pi.

            That's very curious. Usually the power button initiates a full power cut off if the GPIO is detected.

            -With your script, it is the story, the Power off doesn't do anything but as the reset button only restart ES, I can't turn off the pi.

            The reset and and power button are initiated all the same way. As reset works as it should and power does not work. I think I now I understand what may happening. It seems GPIO3 is not proper connected to your PIN header. You may check if it is attached right to the GPIO header. You can also reattach it to a new GPIO if you use ./multi_switch.sh --nespi+ powerbtn=xy & argument.
            XY is the GPIO header.....

            Because no script works in your setup, the error lies in your case.

            P 1 Reply Last reply 29 May 2018, 15:20 Reply Quote 0
            • P
              PWN3D_ @cyperghost
              last edited by PWN3D_ 29 May 2018, 15:20

              @cyperghost I will check all the wires and connectors right now

              Also, if the switch in the nespi case is set to "off" the power button work just fine when I turn off the pi, but as you know it just kill the power.

              P 1 Reply Last reply 29 May 2018, 16:24 Reply Quote 0
              • P
                PWN3D_ @PWN3D_
                last edited by PWN3D_ 29 May 2018, 16:24

                @pwn3d_ Oh, I'm getting somewhere : I tried to reattach the wire connected to the GPIO3 , to the GPIO11.

                Then I typed : ./multi_switch.sh --nespi+ pwerbtn=11 &
                the answer was : -bash: ./multi_switch.sh: No such file or directory

                Ps: I have also checked in the /home/pi/RetroPie/scripts directory. I can see the multi_switch script as : *multi_switch.sh
                I don't know if the * means anything

                M 1 Reply Last reply 29 May 2018, 16:31 Reply Quote 0
                • M
                  mitu Global Moderator @PWN3D_
                  last edited by 29 May 2018, 16:31

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

                  I don't know if the * means anything

                  It means is an executable file/script. Try typing the full pathname

                  /home/pi/RetroPie/script/multi_switch.sh --nespi+ pwerbtn=11 &
                  
                  P 1 Reply Last reply 29 May 2018, 16:35 Reply Quote 1
                  • P
                    PWN3D_ @mitu
                    last edited by PWN3D_ 29 May 2018, 16:35

                    @mitu Nope, I'm getting the same message :

                    -bash /home/pi/RetroPie/script/multi_switch.sh: No such file or dirctory

                    PS: Scripts ... with an s at the end ... yep that was it

                    C 1 Reply Last reply 29 May 2018, 16:55 Reply Quote 0
                    • C
                      cyperghost @PWN3D_
                      last edited by cyperghost 29 May 2018, 16:55

                      @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 29 May 2018, 17:06 Reply Quote 0
                      • P
                        PWN3D_ @cyperghost
                        last edited by PWN3D_ 29 May 2018, 17:06

                        @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 ?

                        C 1 Reply Last reply 29 May 2018, 17:09 Reply Quote 0
                        • C
                          cyperghost @PWN3D_
                          last edited by cyperghost 29 May 2018, 17:09

                          @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 29 May 2018, 17:15 Reply Quote 0
                          • P
                            PWN3D_ @cyperghost
                            last edited by 29 May 2018, 17:15

                            @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 ! ;)

                            C 1 Reply Last reply 29 May 2018, 17:37 Reply Quote 0
                            • C
                              cyperghost @PWN3D_
                              last edited by 29 May 2018, 17:37

                              @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 29 May 2018, 17:47 Reply Quote 0
                              • P
                                PWN3D_ @cyperghost
                                last edited by PWN3D_ 29 May 2018, 17:47

                                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

                                C 1 Reply Last reply 29 May 2018, 18:19 Reply Quote 0
                                • C
                                  cyperghost @PWN3D_
                                  last edited by cyperghost 29 May 2018, 18:19

                                  @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 1 Jun 2018, 18:58

                                    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!

                                    C 1 Reply Last reply 5 Jun 2018, 19:03 Reply Quote 0
                                    • C
                                      cyperghost @devnull22
                                      last edited by 5 Jun 2018, 19:03

                                      @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 5 Jun 2018, 20:03

                                        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

                                        C 1 Reply Last reply 5 Jun 2018, 20:30 Reply Quote 0
                                        • C
                                          cyperghost @cloudlink
                                          last edited by 5 Jun 2018, 20:30

                                          @cloudlink Yes

                                          1 Reply Last reply Reply Quote 0
                                          45 out of 52
                                          • First post
                                            45/52
                                            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.

                                            This community forum collects and processes your personal information.
                                            consent.not_received