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

    METADATA not saving - Favorites will never remain tagged

    Scheduled Pinned Locked Moved Help and Support
    nespi casemetadata issuesfavoritesshutdown scriptgameslist.xml
    121 Posts 7 Posters 17.8k 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 @julenvitoria
      last edited by cyperghost

      @julenvitoria Thanks! You are right the signal levels are ignored by some emulators.
      I would suggest to use kill -9 <PID>

      I will update both scripts. So you see - once again something new explored .... ;)

      J 1 Reply Last reply Reply Quote 0
      • S
        Semper 5
        last edited by

        Ok, so no errors to report. But the power switch doesn't work now.
        I temporarily took out the entry in autostart.sh just to see what would happen in putty. and like I said, no errors. but when i press the power button (off) it does nothing

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

          @cyperghost wow! It’s perfect!! I’ll try the other script later

          Thanks!

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

            @semper-5 Please do so as you wrote. Take auto entry from autostart.sh!
            and do a manuel start via SSH to see error messages. I need the routine how the POLOLU acts with the switch.

            Please use sudo /path/to/switch.sh & command with the latest script version.

            @julenvitoria You are welcome! Thank you for testing. The other script is also working! I tested several times.

            S 1 Reply Last reply Reply Quote 0
            • S
              Semper 5 @cyperghost
              last edited by

              @cyperghost it doesn't output any errors.

              I enter: sudo bash /home/pi/RetroPie/scripts/switch.sh &
              output: [1] 10921

              I think it s working to some extent because if I try to run it again it will tell line 18 & 20 write protection due to device being busy

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

                @semper-5 That's okay ... this [10921] thing is the process number.
                So what happens if you press the power button? With the script in background running?

                You should see a message like:
                Switch press 0 - Switchtype 1
                ES-PID: 1232

                S 1 Reply Last reply Reply Quote 0
                • S
                  Semper 5 @cyperghost
                  last edited by

                  @cyperghost no message, no activity, no error. nothing :/

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

                    @semper-5 What is the output of
                    cat /sys/class/gpio/gpio24/value

                    if the power button is pressed, and then if the power button is released?
                    It should be 1 if pressed and 0 if released

                    The script must be active for this ;)

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      Semper 5 @cyperghost
                      last edited by

                      @cyperghost it's 0 on both being pressed and released

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

                        @semper-5 That's the error here ... but tell me why? That's not possible! The python scripts are working?

                        Maybe @Yahmez knows the answer?
                        If we watch for input of GPIO24 (=power button), why there is no change in input value?

                        S YahmezY mituM 3 Replies Last reply Reply Quote 0
                        • S
                          Semper 5 @cyperghost
                          last edited by

                          @cyperghost I know! Our frustration is real. I mean it works as it should with Yahmez's script. And just to be sure I am following your instructions immaculately, yours is the ONLY script I'm running on this fresh image.

                          Geez it was embarrassing you guys telling me to use Notepad++ and how to invoke the script LOL. but I do appreciate all your efforts to walk me through it. I'm just thinking you guys must be getting as frustrated with me as I'm getting frustrated with this not working - I'm yelling at this damn box like "you're making an idiot out of me in front of the community, damn you!" haha

                          1 Reply Last reply Reply Quote 1
                          • YahmezY
                            Yahmez @cyperghost
                            last edited by

                            @cyperghost
                            I am late to the game here but if my script works as intended (minus saving metadata which was never implemented) and cypherghost's script is not seeing the button presses then the logical thing would be to compare the two scripts and see how they are being handled differently.

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

                              @yahmez ;)
                              Thank you for stepping in my friend.
                              So let's compare ;)

                              #!/usr/bin/python
                               
                              import RPi.GPIO as GPIO
                              import os, time
                               
                              GPIO.setmode(GPIO.BCM)
                              GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)   #Reset switch
                              GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)   #Power switch
                              GPIO.setup(25, GPIO.OUT)                            #ON control
                              GPIO.output(25, GPIO.HIGH)
                               
                              while True:
                                if (GPIO.input(24)):
                                  time.sleep(0.25)
                                else:
                                  print ("Shutting down...")
                                  os.system("sudo shutdown -h now")
                                  break
                                if (GPIO.input(23)):
                                  time.sleep(0.25)
                                else:
                                  print ("Resetting...")
                                  os.system("sudo reboot now")
                                  break
                              

                              and

                              script version from here
                              I did not implent reset handling here ;)

                              1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator @cyperghost
                                last edited by

                                @cyperghost Maybe the wires are connected to other pins ?

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

                                  @mitu This can only be answered by @Semper-5 but I assume not!
                                  As I remeber he told me, that the python scripts are working ;)

                                  mituM 1 Reply Last reply Reply Quote 0
                                  • YahmezY
                                    Yahmez
                                    last edited by Yahmez

                                    If it just cuts power upon turning off the power switch it means that the on control pin is not going high on boot.

                                    cyperghostC 1 Reply Last reply Reply Quote 1
                                    • mituM
                                      mitu Global Moderator @cyperghost
                                      last edited by

                                      @cyperghost Python is a sneaky snake...

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

                                        @yahmez Can you test the script on your build, too?
                                        @mitu Python is very cool - indeed. But I also checked the way GPIOs are called. It's BCM mode. So Python GPIO = Bash GPIO

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

                                          @cyperghost I will give it a try this weekend if I can but I have relatives coming to stay so I'm not 100% sure I'll be able to till next week.

                                          cyperghostC 1 Reply Last reply Reply Quote 1
                                          • YahmezY
                                            Yahmez
                                            last edited by

                                            @Semper-5
                                            Can you try gpio readall to verify that the on control pin is high?

                                            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.