I'm having issues with a python script (2.7). Up to several days ago, I was able to automatically launch a python script when booting up my RPI 3 Model B V1.2 (raspbian-stretch) in headless mode.
Simple crontab entry did the trick (had been working for years):
Code: Select all
@reboot /bin/sleep 20; sudo python /home/pi/Documents/PyScripts/myScript.py &Code: Select all
...
def main():
try:
setup_gpio()
add_callbacks()
show_ready()
while(True):
pass
time.sleep(0.5)
except KeyboardInterrupt:
print("\nCtrl-C pressed")
GPIO.cleanup() # clean up GPIO on CTRL+C exit
GPIO.cleanup()
main()
Any help would be appreciated - Thanks!