I have a python script that besides other stuff does this:
#turn all lights 3 on
for val in EntranceFloodLights:
time.sleep(timeBetweenSwitches) #delay between switches for overload
GPIO.setup(val, GPIO.OUT)
GPIO.output(val, GPIO.LOW) # set LOW to switch ON
#save TSLA
f= open("lastActivation.txt","w+")
f.write( "%s" % timeNow)
f.close()
#set delay for lights to go off in timeToStayOn
time.sleep(timeToStayOn)
for val in currentStatus:
time.sleep(timeBetweenSwitches) #delay between switches for overload
if currentStatus[val] == 0:
GPIO.setup(val, GPIO.OUT)
GPIO.output(val, GPIO.HIGH) # set HIGH to switch OFF
When i run this through shell, it works perfectly,
Unfortunately, when i run it through the web page i set up to control my lights, it does turn off the light, but stops somewhere before writing the file i ask it to.
Any ideas on what i'm missing?
Keep in mind this is my first python script, so i am a total newbie on this.
Thanks in advance