The scrip runs fine from the command line
Other scripts (not python - New to python and picked this up) and they work fine
What am I missing?
Where can I look for errors?
What can I add to try and de-bug?
Thanks .....
In rc.local I've tried
python /home/pi/relay/bootGPIO.py &
and
/home/pi/relay/bootGPIO.py &
Code: Select all
#!/bin/sh -e
# rc.local
# Fire up the GPIO scripy
/home/pi/relay/bootGPIO.py &
exit 0
#!/usr/bin/env python
and
#!/usr/bin/python
Code: Select all
#!/usr/bin/python
from time import sleep
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
def switchState(switch,state):
#print "Sw {0} sec {1}" .format(switch,state)
if state > 0:
GPIO.output(switch, GPIO.LOW)
else:
GPIO.output(switch, GPIO.HIGH)
switchState(7,1)
sleep(1)
switchState(7,0)
sleep(1)
switchState(7,1)
sleep(1)
switchState(7,0)