Momentary Power-button with LED?
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
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)
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)?
Yes, the LED is only handled in the Power/Reset script.
FYI: Just tested Power LED and momentary switch with unmodified
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
script is that the Power LED flashes three(?) times after pressing the Power button.
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.
danlevrai last edited by
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.
Thank for your help.
PS: Excuse my poor english
Daniel from Quebec Canada
danlevrai last edited by
Found my problem.... Hardware wiring issue. Thanks