What we do is edit /etc/rc.local and add the following line to spawn a new process and run a script at bootup. (put it after the 'By default this script does nothing.' comment in rc.local)
/home/pi/startshow &
Then create the startshow script (in /home/pi). You can use nano to create/edit the script. The script contains the following to run our shows constantly:
sudo rmmod ftdi_sio
sudo rmmod usbserial
cd /home/pi
while true
do
./player MerryChristmasEveryone.shp CarolOfTheBells.shp Frozen.shp Pirate.shp
done
Once you have created the script you need to give the script execute permissions with chmod. For example
sudo chmod +x /home/pi/startshow
If you want to run shows at hourly intervals just run the player with the required start times parameter. For example this startshow script would run shows on the hour from 1700 until 2100.
sudo rmmod ftdi_sio
sudo rmmod usbserial
cd /home/pi
while true
do
./player --t1700 Frozen.shp Pirate.shp
./player --t1800 Frozen.shp Pirate.shp
./player --t1900 Frozen.shp Pirate.shp
./player --t2000 Frozen.shp Pirate.shp
./player --t2100 Frozen.shp Pirate.shp
done
Hope that helps.
Also remember the Pi does not have a battery backed clock so needs the internet to get the time or needs to be set manually. Alternatively install a battery backed RTC modulle.
Craig
/home/pi/startshow &
Then create the startshow script (in /home/pi). You can use nano to create/edit the script. The script contains the following to run our shows constantly:
sudo rmmod ftdi_sio
sudo rmmod usbserial
cd /home/pi
while true
do
./player MerryChristmasEveryone.shp CarolOfTheBells.shp Frozen.shp Pirate.shp
done
Once you have created the script you need to give the script execute permissions with chmod. For example
sudo chmod +x /home/pi/startshow
If you want to run shows at hourly intervals just run the player with the required start times parameter. For example this startshow script would run shows on the hour from 1700 until 2100.
sudo rmmod ftdi_sio
sudo rmmod usbserial
cd /home/pi
while true
do
./player --t1700 Frozen.shp Pirate.shp
./player --t1800 Frozen.shp Pirate.shp
./player --t1900 Frozen.shp Pirate.shp
./player --t2000 Frozen.shp Pirate.shp
./player --t2100 Frozen.shp Pirate.shp
done
Hope that helps.
Also remember the Pi does not have a battery backed clock so needs the internet to get the time or needs to be set manually. Alternatively install a battery backed RTC modulle.
Craig