Posts: 22
Threads: 6
Joined: Nov 2017
Reputation:
0
28-11-2017, 09:06 PM
(This post was last modified: 29-11-2017, 02:43 PM by ChevyChase.)
Does anyone know if it`s possible to program the Pi Player to do an hourly show? Infact I`m having lots of trouble trying to get the show to run from rc.local on startup. Everything works fine from the terminal but nothing seems to happen when I run the script on startup? I`m a programming novice to say the least so any help is appreciated.
Posts: 23
Threads: 5
Joined: Dec 2016
Reputation:
0
05-12-2017, 03:35 PM
(This post was last modified: 05-12-2017, 03:35 PM by TomP.)
Hi, I am also having exactly the same problem as you. If i find a solution I will post here on your thread.
I thought the solution would be to create a CRON job to play an hourly show however as well as you being a Pi / Linux novice I am having trouble too.
Using: Sudo ./player show.shp doesnt work from CRON as I suspect its something to do with paths or that the Pi doenst seem to like being stuck waiting form something to complete in a cron.
Posts: 23
Threads: 5
Joined: Dec 2016
Reputation:
0
I've been doing some digging into this and I now think part of the problem is to do with not being able to login on Raspbian as root. I've tried pretty much every information resource I can find however resetting the root password on the Pi and still not being able to login as root which is why I suspect the cron doesn't work correctly if used to trigger shows at times.
Posts: 186
Threads: 8
Joined: Sep 2016
Reputation:
6
07-12-2017, 10:47 AM
(This post was last modified: 07-12-2017, 10:59 AM by Craig.)
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
Posts: 22
Threads: 6
Joined: Nov 2017
Reputation:
0
Thanks for your help Craig
That all works well apart from a few minor issues. Before the first show all the lights remain off completely and once the last show has played it seems to keep on repeating constantly?
Any ideas how to solve these bugs?
Posts: 186
Threads: 8
Joined: Sep 2016
Reputation:
6
Try using the 'sleep' command after the last ./player to put the process to sleep for a few hours, at least until after midnight.
Whilst a 'player' command is active any standalone sequences on the controllers will not play (as the PI is in control). If you want the stand alone sequences to play you will need to use scripting and the sleep command to control the timing instead. For example if your show is 10 minutes long, add a sleep for 50 minutes between each hourly player command.
Craig.
Posts: 22
Threads: 6
Joined: Nov 2017
Reputation:
0
Will give it a try.
Many Thanks