Recalbox 7.0

Momentary Power-button with LED?



  • 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é


  • Developer
    Team
    Creator
    Global moderator

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


  • 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)?


  • Developer
    Team
    Creator
    Global moderator

    @hanker

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



  • Thanks, solved! 🙂



  • 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é


  • Developer
    Team
    Creator
    Global moderator

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



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

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



Want to support us ?

199
Online

79.1k
Users

20.4k
Topics

149.2k
Posts