Hallo
Leider kann ich keine Programmierspreche !
mein curl Befehl für ein:
curl http://admin:admin@192.168.1.220/dev/sps/io/on/impuls
mein curl Befehl für aus:
curl http://admin:admin@192.168.1.220/dev/sps/io/off/impuls
soweit funktionierts auch, nur möchte ich wenn der Kontakt GPIO17 geschlossen ist das "on" und beim öffnen
des Kontaktes GPIO17 "off" gesendet wirt.
hab es jetzt mit dem Script vom Forum getestet
https://forum-raspberrypi.de/forum/thread/917-dauer-bei-gpio-input/&highlight=GPIO
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN)
while True:
global n
n = 4
global count
count = 0
for count in range(0,n):
if (GPIO.input(17)):
count = count + 1
time.sleep(1)
if (count > 3 and GPIO.input(17) == 1):
os.system('curl http://admin:admin@192.168.1.220/dev/sps/io/on/impuls')
break
if (count > 1 and GPIO.input(17) == 0):
os.system('curl http://admin:admin@192.168.1.220/dev/sps/io/off/impuls')
break
count = 0
time.sleep(1)
Danke