openfab-lab / toolsDocs

Repo pour la documentation des machines
3 stars 5 forks source link

Shutdown button - script #18

Closed nicolasdb closed 5 years ago

nicolasdb commented 5 years ago
Jorgininho commented 5 years ago

1rst try out is with builtin poweroff button function, like said in recal bx manual: https://github.com/recalbox/recalbox-os/wiki/Add-a-start-stop-button-to-your-recalbox-(EN) But this only need one click to poweroff, needs to find a solution where button needs to be hold on (5S) to poweroff.

Jorgininho commented 5 years ago

May have a solution by modifying the scripts /recalbox/scripts/rpi-pin356-power.py see : https://github.com/recalbox/recalbox-buildroot/blob/master/board/recalbox/fsoverlay/recalbox/scripts/rpi-pin356-power.py

1rst try, modifying value speed

    if channel == POWERPLUS:
        speed=0.15
        shutdownstring="shutdown -h now"
    elif channel == RESETPLUS:
        speed=0.05
shutdownstring="shutdown -r now"

to

    if channel == POWERPLUS:
        speed=2.15
        shutdownstring="shutdown -h now"
    elif channel == RESETPLUS:
        speed=1.05
shutdownstring="shutdown -r now"

hoping to add a delay to 2seconde, but no results

Jorgininho commented 5 years ago

modification on this file weren't taken in account before because the wrong line was uncommented in recalbox/share/system/recalbox.conf the line to be uncommented :

;system.power.switch=PIN356PUSHRESET

The parameter to modify, in /recalbox/scripts/rpi-pin356-power.py :

in function :

def push_mode(channel):
...
while flag:
...
   if (timer>30):
       ....
   if (timer>10):
       ....

So to turn off the console, keep pressing 3sec, to go back to home screen of recalbox, press 1sec

Jorgininho commented 5 years ago

trying now to have a LED blinking while pressing the button following https://github.com/recalbox/recalbox-os/wiki/Add-a-start-stop-button-to-your-recalbox-%28EN%29

on 1rst try, the behavior of the LED is the following :

nicolasdb commented 5 years ago

ok, COOL Donc, le mode d'emploi sera de? combien de sec pour quoi faire?

Et on clot l'issue