Forum Audiophonics.fr
http://forum.audiophonics.fr/

LibreELEC power off with SPC II
http://forum.audiophonics.fr/viewtopic.php?f=12&t=2160
Page 1 sur 1

Auteur :  AlleyCat [ Lun 07 Mai 2018 11:29 ]
Sujet du message :  LibreELEC power off with SPC II

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

Auteur :  AlleyCat [ Lun 07 Mai 2018 12:16 ]
Sujet du message :  Re: LibreELEC power off with SPC II

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

Page 1 sur 1 Le fuseau horaire est UTC+1 heure
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/