LibreELEC power off with SPC II

Ici on parle de Raspberry PI, Sparky, Odroid... avec des solutions comme Squeezelite, MPD, Max2Play... ainsi que leur DAC et accessoires dédiés
AlleyCat
Messages : 2
Inscription : lun. 07 mai 2018 11:14

LibreELEC power off with SPC II

Message par AlleyCat » lun. 07 mai 2018 11:29

Hi,
I am having a problem with LibreELEC (LE) and SPC II module. When I turn off the LE from the software on the TV Screen, the LED power button stays lit, and the SPC power module looks like it still having power. I am looking for a script to run at the Shutdown.sh script to send a signal to the SPC II to shut off / cut power. I suspect that I have to send signals to the GPIOs.

Beside this issue, I have a python script that works great to handle turn on and off using the power button.

Thanks,

AlletCat

AlleyCat
Messages : 2
Inscription : lun. 07 mai 2018 11:14

Re: LibreELEC power off with SPC II

Message par AlleyCat » lun. 07 mai 2018 12:16

Problem solved:

I created the following softshutdown1 script, and add one line to the shutdown.sh script:

softshutdown1

#! / Usr / bin / python
# "Audiophonics softshutdown script"
# " Openelec Version"
# "softShutdown: GPIO4 = out, low to high"
import sys
sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
import RPi.GPIO as GPIO
import time
import subprocess
GPIO.setmode (GPIO.BCM)
GPIO.setwarnings (False)

GPIO.setup (4, GPIO.OUT)
GPIO.output (4, GPIO.HIGH)
time.sleep (1)
GPIO.output (4, GPIO.LOW)

GPIO.cleanup ()



shutdown.sh

case "$1" in
halt)
# your commands here
;;
poweroff)
# your commands here
python /storage/.config/softshutdown1
;;
reboot)
# your commands here
;;
*)
# your commands here
;;
esac

Répondre