I am trying to run a python script that uses the RPi Camera on boot from /etc/rc.local. This is the command I need to run:
python ~/Documents/camera/camera.py --conf ~/Documents/camera/conf.json
This is what my rc.local file looks:
#!/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 %s\n" "$_IP"
fi
python ~/Documents/camera/camera.py --conf ~/Documents/camera/conf.json &
exit 0
I also tried putting this in my rc.local file to find the error, but the log remained empty.
python ~/Documents/camera/camera.py --conf ~/Documents/camera/conf.json > ~/Documents/camera/logfile.log
I know for sure that the python command works because I tried running it from the terminal. The python code I am using is from this tutorial but modified,