Hallo,
habe ein Problem dass mein script nur von der command line aus startet.
Druecke ich am Piface den ersten Tater (input 0) sollte scipt ausvonalarm.py starten, das soll /bin/aus starten.
Leider geht das aber nur wenn ich vorher das script /bin/ausvonalarm.py von der command line aus starte.
In etc/rc.local habe ich folgendes eingetragen: /usr/bin/python /bin/ausvonalarm.py
Anbei die 2 scripte.
ausvonalarm.py
Python
#!/usr/bin/python
import subprocess
from subprocess import Popen
import pifacedigitalio
def alarmeinaus(event):
subprocess.Popen(["/bin/aus"])
pfd = pifacedigitalio.PiFaceDigital() # creates a PiFace Digital object
listener = pifacedigitalio.InputEventListener(chip=pfd)
listener.register(0, pifacedigitalio.IODIR_BOTH, alarmeinaus) # input 0 Taster 1
listener.activate()
Display More
aus
Bash
#!/bin/bash -x
# Alle Lichter ausschalten Zone 1,2,3 aber zuerst auf max. machen
# Zone1-4 auf max.
echo -n -e "\x38\x00\x55" | nc -u -q 1 192.168.0.6 8899
sleep .1
echo -n -e "\xB8\x00\x55" | nc -u -q 1 192.168.0.6 8899 # Zone 1 on max. Gang
Wenn ich es von der command line aus starte und dann Taster 1 (input 0) drueke, geht alles wie gewollt.
Warum geht es nicht ohne das script von der command liene aus vorher zustarten??
gruss
gwaag