OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Starting automatically Re: Re: Starting automatically



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:

#!/bin/sh -e
# rc.local
# 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
# bits.
# 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
#hwclock -s

### Start the OSPi interval program
$host=$hostname -I | sed 's/ *$//g')
cd /home/pi/OSPi/
nohup /usr/bin/python $host:$port 2>&1 &

exit 0

I still have to manually start the program (change directory / sudo python 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.