Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Solved Momentary Power-button with LED?

    Recalbox General
    momentary power-button led
    3
    9
    5089
    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.
    • hanker
      hanker last edited by

      Hello!

      I would like to add a Start-Stop-Button to my Recalbox according to https://github.com/recalbox/recalbox-os/wiki/Add-a-start-stop-button-to-your-recalbox-(EN) . This shall be a momentary switch, which I have already tested, no problems.

      Now, I would also like to add a Power-LED according to https://github.com/recalbox/recalbox-os/wiki/Add-a-start-stop-button-to-your-recalbox-(EN) .

      Is it possible to have a Power-LED and a momentary Start/Stop-button?

      As far as I understand the HowTo, the Power-LED is only working if you use a latching switch...

      Thanks a lot. Again

      René

      supernature2k 1 Reply Last reply Reply Quote 0
      • supernature2k
        supernature2k @hanker last edited by

        @hanker

        Hello!

        Yes, the script is designed to work with a momentary RESET button en a ON/OFF POWER button but you can really easily modify it:

        SSH your recalbox and do the following:

        cd /recalbox/scripts
        mount -o remount, rw /
        nano rpi-pin356-power.py
        

        Then in the editor, go at the end of the script and change:

        GPIO.add_event_detect(RESETPLUS, GPIO.FALLING, callback=button_pressed)
        GPIO.add_event_detect(POWERPLUS, GPIO.RISING, callback=button_pressed)
        

        with:

        GPIO.add_event_detect(RESETPLUS, GPIO.FALLING, callback=button_pressed)
        GPIO.add_event_detect(POWERPLUS, GPIO.FALLING, callback=button_pressed)
        

        Pi powered NES | Gameboy HD | RecalStation | RecalDrive
        Upvote messages if it has been useful ;)

        1 Reply Last reply Reply Quote 1
        • hanker
          hanker last edited by

          Hello and thanks!

          But is this modification really nescessary?

          I mean: Does the Power LED only work with the Power/Reset-script and not the "only Power"-scripts (regardless if momentary or other switch)?

          supernature2k 1 Reply Last reply Reply Quote 0
          • supernature2k
            supernature2k @hanker last edited by

            @hanker

            Yes, the LED is only handled in the Power/Reset script.

            Pi powered NES | Gameboy HD | RecalStation | RecalDrive
            Upvote messages if it has been useful ;)

            1 Reply Last reply Reply Quote 0
            • hanker
              hanker last edited by

              Thanks, solved! 🙂

              1 Reply Last reply Reply Quote 0
              • hanker
                hanker last edited by

                FYI: Just tested Power LED and momentary switch with unmodified

                system.power.switch=PIN56PUSH

                The LED goes on at system start, switches off when the screen goes blank at boot-up, then goes on and stays that way. Switches off again at shutdown.

                Only difference when using the

                system.power.switch=PIN356ONOFFRESET

                script is that the Power LED flashes three(?) times after pressing the Power button.

                René

                supernature2k 1 Reply Last reply Reply Quote 0
                • supernature2k
                  supernature2k @hanker last edited by

                  @hanker

                  We were talking about LED in script so I confirm, only pin356 handles the LED. Making it blink 3 times slow when powering off and 5 times quick when resetting.

                  Now there are several other ways to make the LED work. You can put it on 5v or 3.3v GPIOs for example.

                  Pi powered NES | Gameboy HD | RecalStation | RecalDrive
                  Upvote messages if it has been useful ;)

                  1 Reply Last reply Reply Quote 0
                  • danlevrai
                    danlevrai last edited by

                    @supernature2k

                    Hi, I am new to this forum and I am really dumb with linux. I built a recalbox project recently. I installed a momentary push button switch to put the system in sleep mode as per instructions and love it. Now, I want to install a "RUN" led. I read here that it is possible by modifying the rpi-pin356-power.py file. I did it as explained and rebooted the system. The led turns ON only during the time the button is pressed and turn OFF when I release the button like if it would be configured as a ON/OFF switch. I modified recalbox.conf file to enable "system.power.switch=PIN356ONOFFRESET". It gave me the same result. The LED negative is connected to ground and the positive is on pin 8 (GPIO14) through a 150 ohms resistor. I really don't know what I am doing wrong.
                    0_1486765312423_script_mod.jpg Thank for your help.
                    PS: Excuse my poor english
                    Daniel from Quebec Canada0_1486765341624_recalbox_conf.jpg

                    danlevrai 1 Reply Last reply Reply Quote 0
                    • danlevrai
                      danlevrai @danlevrai last edited by

                      @danlevrai

                      Found my problem.... Hardware wiring issue. Thanks

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

                      Want to support us ?

                      66
                      Online

                      98.7k
                      Users

                      28.1k
                      Topics

                      187.0k
                      Posts

                      Copyright © 2021 recalbox.com