Hi, not a solution but a workaround.
I have the piusv+ since today and I installed the system 2 days ago, so it should be the newest raspbian (not the light version, I followed the steps from cbrauweiler - thanks a lot :-))
By reading this thread and following the links I do the following and it fits my needs:
code of /usr/local/bin/allOff.sh:
code of /home/pi/.kodi/addons/skin.carpc-xtouch/scripts/system_poweroff.py
Good luck
Karsten
I have the piusv+ since today and I installed the system 2 days ago, so it should be the newest raspbian (not the light version, I followed the steps from cbrauweiler - thanks a lot :-))
By reading this thread and following the links I do the following and it fits my needs:
- Install piusv software as described in the manual
- changed in /etc/piupsmon/piupsmon.conf:
ShutdownCmd=shutdown -h now &
(I think init 0 & will do the job too) - that is the bug in piusv, it seems to me that the job to shutdown needs to run in background, so that the piusv daemon get control back even if it is for a short time, but I'm not sure
- copied a small script from a user in another forum and modified it slightly, store it under /usr/local/bin/allOff.sh and make it executable (sudo chmod +x ... ) code see below
I changed the python-script /home/pi/.kodi/addons/skin.carpc-xtouch/scripts/system_poweroff.py to call "my" script.
code of /usr/local/bin/allOff.sh:
Code:
#!/bin/bash
#Skript zum programmatischen Abschalten der PiUSV+
#gpio-tools müssen installiert sein
#Autor: raspiuser, 2015-08-10
#Benutzung auf eigenes Risiko !
echo "$(date +%Y-%m-%d" "%H:%M:%S) [NOTICE] Programmatic system shutdown!" >> /var/log/piupsmon.log
#systemctl stop piupsmon # arch linux
/etc/init.d/piupsmon stop # raspbian
#systemctl poweroff & #arch linux
#init 0 & #raspbian
i2cset -y 1 0x18 0x10
i2cset -y 1 0x18 15
shutdown -h now &
echo "$(date +%Y-%m-%d" "%H:%M:%S) [NOTICE] System halted!" >> /var/log/piupsmon.log
exit
code of /home/pi/.kodi/addons/skin.carpc-xtouch/scripts/system_poweroff.py
Code:
import os
import xbmc
xbmc.executebuiltin('XBMC.Quit');
# os.system("sudo poweroff &");
os.system("sudo /usr/local/bin/allOff.sh &")
Good luck
Karsten