Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
#!/usr/bin/python import RPi.GPIO as GPIO #This line alone caused 90 minutes of frustration import sys import time GPIO.setmode(GPIO.BCM) GPIO.setup(25, GPIO.OUT) #set pin 21 to output p = GPIO.PWM(25,100) #set the PWM on pin 25 to 100 hrz / full power p.start(0) #I dont remember what this does but trust me you need it. var1 = sys.argv #get the variable sent from php on/off print (var1) if var1 == ('on'): p.ChangeDutyCycle(100) print ("was turned on") elif var1 == ('off'): p.ChangeDutyCycle(0) print ("was turned off")
shell_exec("sudo python /home/pi/Desktop/light.py 'on' ") shell_exec("sudo python /home/pi/Desktop/light.py 'off' ")