OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Starting ospi.py automatically › Re: Re: Starting ospi.py automatically
August 25, 2013 at 2:04 pm #24724
In addition to the question posted just above, I’m also having problems with it auto-starting and then going into the background. I am using a hard-wired version to the network (as of yesterday afternoon and evening – that was a ton of work). Here’s my rc.local file:
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %sn" "$_IP"
#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device
### Start the OSPi interval program
$host=$hostname -I | sed 's/ *$//g')
nohup /usr/bin/python ospi.py $host:$port 2>&1 &
I still have to manually start the program (change directory / sudo python ospi.py). And, it never goes into the background meaning I have to shut down putty. What could I be missing. It’s as though doesn’t know that it needs to go to the ospi on startup.