OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) can’t autostart ospi.py…rc.local or init.d Re: Re: can’t autostart ospi.py…rc.local or init.d

#25468

dennyfmn
Participant

The ^M in your error makes me wonder if you somehow added DOS type line endings () to the /etc/init.d/ospy script when you created it. The script needs to have only Linux/Unix type line endings ().

There is a utility that will convert the line endings for you that is not installed in Raspbian by default. You can install it like this:


sudo aptitude update
sudo aptitude install dos2unix

You may notice there are other updates offered. If you want to keep your whole system up to date do


sudo aptitude safe-upgrade

To change the DOS line endings to linux line endings:


sudo su - root
cd /etc/init.d
mv ospi ospi.dos
dos2unix < ospi.dos > ospi

Make the script executable


chmod +x ospi

Try it


./ospy start

Hope this helps…