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

Mausberry Shutdown Script Doesn't Save Metadata

Scheduled Pinned Locked Moved ControlBlock, PowerBlock & Co.
mausberry
251 Posts 10 Posters 95.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.
  • L
    lostless @meleu
    last edited by 28 Jul 2017, 04:31

    @meleu i saw that. whew.

    L 1 Reply Last reply 28 Jul 2017, 04:40 Reply Quote 1
    • L
      lostless @lostless
      last edited by lostless 28 Jul 2017, 04:40

      @meleu killed all switch functionality. As in it no longer functions as a shutdown switch.

      M 2 Replies Last reply 28 Jul 2017, 04:42 Reply Quote 0
      • M
        meleu @lostless
        last edited by 28 Jul 2017, 04:42

        @lostless OK. I'll try a little further...

        • Useful topics
        • joystick-selection tool
        • rpie-art tool
        • achievements I made
        L 1 Reply Last reply 28 Jul 2017, 04:43 Reply Quote 0
        • L
          lostless @meleu
          last edited by lostless 28 Jul 2017, 04:43

          @meleu i see you removed some stuff from the original script

          while [ 1 = 1 ]; do
          power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
          if [ $power = 0 ]; then
          sleep 1
          else

          that was removed. any reason to that?

          M 1 Reply Last reply 28 Jul 2017, 04:45 Reply Quote 0
          • M
            meleu @lostless
            last edited by meleu 28 Jul 2017, 04:45

            @lostless said in Mausberry Shutdown Script Doesn't Save Metadata:

            that was removed. any reason to that?

            yep. This infinite loop is consuming CPU cycles unnecessarily.

            • Useful topics
            • joystick-selection tool
            • rpie-art tool
            • achievements I made
            L 1 Reply Last reply 28 Jul 2017, 04:51 Reply Quote 0
            • L
              lostless @meleu
              last edited by 28 Jul 2017, 04:51

              @meleu that was in the original script from mauseberry. never had any issues. interesting that their code just constantly checks the gpio.

              M 1 Reply Last reply 28 Jul 2017, 04:53 Reply Quote 0
              • M
                meleu @lostless
                last edited by 28 Jul 2017, 04:53

                @lostless do they have a github repo or something?

                • Useful topics
                • joystick-selection tool
                • rpie-art tool
                • achievements I made
                L 1 Reply Last reply 28 Jul 2017, 04:58 Reply Quote 0
                • L
                  lostless @meleu
                  last edited by 28 Jul 2017, 04:58

                  @meleu they don't. just the download and install instructions on their website. But heres the script you download and install.

                  echo '#!/bin/bash
                  
                  #this is the GPIO pin connected to the lead on switch labeled OUT
                  GPIOpin1=23
                  
                  #this is the GPIO pin connected to the lead on switch labeled IN
                  GPIOpin2=24
                  
                  echo "$GPIOpin1" > /sys/class/gpio/export
                  echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
                  echo "$GPIOpin2" > /sys/class/gpio/export
                  echo "out" > /sys/class/gpio/gpio$GPIOpin2/direction
                  echo "1" > /sys/class/gpio/gpio$GPIOpin2/value
                  while [ 1 = 1 ]; do
                  power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
                  if [ $power = 0 ]; then
                  sleep 1
                  else
                  sudo poweroff
                  fi
                  done
                  
                  1 Reply Last reply Reply Quote 0
                  • M
                    meleu @lostless
                    last edited by 28 Jul 2017, 05:06

                    @lostless said in Mausberry Shutdown Script Doesn't Save Metadata:

                    @meleu killed all switch functionality. As in it no longer functions as a shutdown switch.

                    is it killing the emulator/ES?

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    L 1 Reply Last reply 28 Jul 2017, 05:07 Reply Quote 0
                    • L
                      lostless @meleu
                      last edited by 28 Jul 2017, 05:07

                      @meleu its not doing anything.

                      M 1 Reply Last reply 28 Jul 2017, 05:10 Reply Quote 0
                      • M
                        meleu @lostless
                        last edited by 28 Jul 2017, 05:10

                        @lostless did you install inotify-tools?

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        L 1 Reply Last reply 28 Jul 2017, 05:11 Reply Quote 0
                        • L
                          lostless @meleu
                          last edited by 28 Jul 2017, 05:11

                          @meleu yes

                          M 2 Replies Last reply 28 Jul 2017, 05:12 Reply Quote 0
                          • M
                            meleu @lostless
                            last edited by 28 Jul 2017, 05:12

                            @lostless OK, let's try with that expensive infinite loop just to check if the inotifywait part is bugging the script. Hold on a little...

                            • Useful topics
                            • joystick-selection tool
                            • rpie-art tool
                            • achievements I made
                            L 1 Reply Last reply 28 Jul 2017, 05:14 Reply Quote 0
                            • L
                              lostless @meleu
                              last edited by 28 Jul 2017, 05:14

                              @meleu I'm trying my own Frankenste in script (taking the parts that i see may work)

                              1 Reply Last reply Reply Quote 1
                              • M
                                meleu @lostless
                                last edited by meleu 28 Jul 2017, 05:14

                                @lostless please, try this one:

                                #!/bin/bash
                                #this is the GPIO pin connected to the lead on switch labeled OUT
                                GPIOpin1=23
                                #this is the GPIO pin connected to the lead on switch labeled IN
                                GPIOpin2=24
                                echo "$GPIOpin1" > /sys/class/gpio/export
                                echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
                                echo "$GPIOpin2" > /sys/class/gpio/export
                                echo "out" > /sys/class/gpio/gpio$GPIOpin2/direction
                                echo "1" > /sys/class/gpio/gpio$GPIOpin2/value
                                file="/sys/class/gpio/gpio$GPIOpin1/value"
                                while true; do
                                power="$(cat "$file")"
                                if [[ "$power" == 0 ]];
                                sleep 1
                                else
                                emu_command="$(sed -n 4p /dev/shm/runcommand.info)"
                                [[ -n "$emu_command" ]] && pkill -f "${emu_command%% *}" && sleep 5
                                espid=$(pgrep -f "/opt/retropie/supplementary/.*/emulationstation([^.]|$)")
                                if [[ "$espid" ]]; then
                                touch /tmp/es-shutdown && chown pi:pi /tmp/es-shutdown
                                kill "$espid"
                                fi
                                sudo poweroff
                                fi
                                done
                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                L 1 Reply Last reply 28 Jul 2017, 05:22 Reply Quote 0
                                • L
                                  lostless @meleu
                                  last edited by 28 Jul 2017, 05:22

                                  @meleu your new script is still doing nothing and mine worked just like the 1.2.

                                  M 1 Reply Last reply 28 Jul 2017, 05:25 Reply Quote 0
                                  • M
                                    meleu @lostless
                                    last edited by 28 Jul 2017, 05:25

                                    @lostless helping with this blind coding is very hard. I'm giving up...

                                    • Useful topics
                                    • joystick-selection tool
                                    • rpie-art tool
                                    • achievements I made
                                    L 1 Reply Last reply 28 Jul 2017, 05:26 Reply Quote 0
                                    • L
                                      lostless @meleu
                                      last edited by 28 Jul 2017, 05:26

                                      @meleu sounds good man. it was fun. the 1.2 works fine, a lot better then always losing meta data all the time.

                                      M 1 Reply Last reply 28 Jul 2017, 05:36 Reply Quote 0
                                      • M
                                        meleu @lostless
                                        last edited by meleu 28 Jul 2017, 05:36

                                        @lostless where is this script placed? what directory?

                                        • Useful topics
                                        • joystick-selection tool
                                        • rpie-art tool
                                        • achievements I made
                                        L 2 Replies Last reply 28 Jul 2017, 05:42 Reply Quote 0
                                        • L
                                          lostless @meleu
                                          last edited by 28 Jul 2017, 05:42

                                          @meleu location is /etc/switch.sh

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