[Issue #216]


  • Moderator
    Team

    Hello sorry for my english, iam french Bonjour sur le forum français, des tests avec ce genre de script sont en cours pour les modèles suivants :

    Github issue : https://github.com/digitalLumberjack/recalbox-os/issues/216

    Would it be possible to include the RemotePi scripts for people who have it ? All details here : http://www.msldigital.com/pages/support-for-remotepi-board-plus-2015

    Make a backup SDcard beforce testing this : put this script into /recalbox/scripts/ called it : irswitch.sh

    #!/bin/bash
    # this is the GPIO pin receiving the shut-down signal
    GPIOpin1=14
    echo "$GPIOpin1" > /sys/class/gpio/export
    echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
    while true; do
      sleep 1
      power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
      if [ $power != 0 ]; then
        echo "out" > /sys/class/gpio/gpio$GPIOpin1/direction
        echo "1" > /sys/class/gpio/gpio$GPIOpin1/value
        sleep 3
        poweroff
      fi
    done
    

    Make a deamon service : Put this script into /etc/init.d/ called it : S92switch

    #!/bin/bash
    ### BEGIN INIT INFO
    # Provides: irswitch.sh
    # Required-Start: $network $local_fs $remote_fs
    # Required-Stop: $network $local_fs $remote_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: switch init script.
    # Description: Starts and stops SwitchDaemon service.
    ### END INIT INFO
    
    #VAR
    RUN="/recalbox/scripts/irswitch.sh"
    BTD_PID=$(ps -eo pid,command | grep "/bin/bash $RUN" | grep -v grep | awk '{print $1}')
    
    serviceStatus() {
       if [ ! -z "$BTD_PID" ]; then
          echo -e '33[0mservice irswitch.sh ['$BTD_PID'] [33[33;32m OK 33[0m]'
       else
          echo -e '33[0mservice irswitch.sh [33[33;31m KO 33[0m]'
       fi
    }
    
    # Carry out specific functions when asked to by the system
    case "$1" in
       start)
          echo "Starting script $RUN ..."
          if [ -z "$BTD_PID" ]; then
             nice -n 19 $RUN&
    
             if [ $? -eq 0 ]; then
                echo -e "33[0mscript $RUN [33[33;32m STARTED 33[0m]"
             fi
          else
             echo "script $RUN already started ['$BTD_PID']!"
          fi
          #serviceStatus
       ;;
       stop)
          echo "Stopping script $RUN ..."
          if [ ! -z "$BTD_PID" ]; then
             kill $BTD_PID
    
             if [ $? -eq 0 ]; then
                echo -e "33[0mscript $RUN [33[33;31m STOPPED 33[0m]"
             fi
          fi
          #serviceStatus
       ;;
       status)
          serviceStatus
       ;;
       *)
          echo "Usage: /etc/init.d/S92switch {start | stop | status}"
          exit 1
       ;;
    esac
    
    exit 0
    

    make :

    chmod +x /recalbox/scripts/irswitch.sh
    chmod +x /etc/init.d/S92switch 
    reboot
    

    Testing command line :

    /etc/init.d/S92swich start
    /etc/init.d/S92swich stop
    /etc/init.d/S92swich status


  • Hi, Been using this script on 3.3.0b17 flawlessly but it doesn't seem to work on 4.0.0 (remotePi flashes red like no shutdown script present).  Can someone confirm me if it is still valid ? Thanks ! patriccote


  • Moderator
    Team

    Hello sorry for my english but in 4.0.0 b2 , dev add Power management boards https://github.com/recalbox/recalbox-buildroot/pull/205

    Add external switch support, by external switch configuration I mean : ATXRaspi (http://lowpowerlab.com/atxraspi/) Mausberry Circuits (http://mausberry-circuits.myshopify.com) RemotePi Board 2013 (http://www.msldigital.com) RemotePi Board 2015 (http://www.msldigital.com)

    try it.



  • Bonjour Acris, continuons en français alors, ce sera plus simple ! (je suis un cousin du Québec=) Je vais essayer cette semaine d'installer 4.0.0 b2 (je suis sous 4.0.0 b1 en ce moment) et de tester la procédure "Power management boards" ici : https://github.com/recalbox/recalbox-buildroot/pull/205 A guise de référence, j'ai un "RemotePi Board for Pi 2 and B+" (http://www.msldigital.com/collections/all-products/products/remotepi-board-plus-2015) Merci ! patriccote


  • Moderator
    Team

    Super merci pour ton feedback :D



  • Bonjour/Hi Acris, (English version below) 100% fonctionnel pour mon "RemotePi Board for Pi 2 and B+", après avoir activé le tout dans /recalbox/share/system/recalbox.conf ! NOTE : comme je suis passé de 4.0.0b1 à 4.0.0b2 avec l'auto-update, le fichier recalbox.conf ne contenait pas les toutes dernières variables système. J'ai donc ajouté manuellement la section suivante et j'ai activé la dernière ligne en retirant le ";" : # ------------ A - System Options ----------- # # Uncomment the system.power.switch you use ;system.power.switch=ATX_RASPI_R2_6 # http://lowpowerlab.com/atxraspi/#installation ;system.power.switch=MAUSBERRY # http://mausberry-circuits.myshopify.com/pages/setup ;system.power.switch=REMOTEPIBOARD_2003 # http://www.msldigital.com/pages/support-for-remotepi-board-2013 ;system.power.switch=REMOTEPIBOARD_2005 # http://www.msldigital.com/pages/support-for-remotepi-board-plus-2015 =-=-=-=-=-=-=-=-=-=-=-=-=-=-= 100% functionnal for my RemotePi Board for Pi 2 and B+", after activating the switch in /recalbox/share/system/recalbox.conf! NOTE : since I updated my Recalbox from 4.0.0b1 to 4.0.0b2 using the auto-update, the file recalbox.conf was not up-to-date so I added the following section and deleted the last ";" to active it : # ------------ A - System Options ----------- # # Uncomment the system.power.switch you use ;system.power.switch=ATX_RASPI_R2_6 # http://lowpowerlab.com/atxraspi/#installation ;system.power.switch=MAUSBERRY # http://mausberry-circuits.myshopify.com/pages/setup ;system.power.switch=REMOTEPIBOARD_2003 # http://www.msldigital.com/pages/support-for-remotepi-board-2013 ;system.power.switch=REMOTEPIBOARD_2005 # http://www.msldigital.com/pages/support-for-remotepi-board-plus-2015 =-=-=-=-=-=-=-=-=-=-=-=-=-=-= Merci/Thanks !!! patriccote


  • Moderator
    Team

    Hello oui le fichier recalbox.conf n'est pas mis à jour via l update pour ne pas perdre la configuration existante, il faut le modifier manuellement et ajouter les sections manquantes présente dans recalbox.template de mémoire.



  • Is there any chance to get support for the "Witty Pi"-Board (see here) with 4.0.0? Being able to shutdown using the board would be completely sufficiant for me, no need for RTC and timers. Thanks, Lukas


  • Moderator
    Team

    TRY to Contact LaurentMarchelli on this issue : https://github.com/recalbox/recalbox-buildroot/pull/205



  • Hi Lukas, I had a look, on the version 4.0.0 beta 3, but the "wiring pi" package needed to enable Witty-pi is missing in this version. I have send a pull request for version 4.1.0, sorry for the inconvenience. Best regards, Added Witty Pi power switch support with Wiring Pi. #305 recalbox.conf<span style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: #eaffea;"> system.power.switch=WITTYPI</span>



  • Hi Laurent, Thanks a lot. Did not expect so see a solution at all. You are damn fast! Can't wait to check it out.   Best regards, Lukas


Log in to reply
 

Want to support us ?

Join us on :

217
Online

28807
Users

14640
Topics

110675
Posts

Looks like your connection to Recalbox Forum was lost, please wait while we try to reconnect.