Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raspberry Pi Player Programming
#1
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.
Reply
#2
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.
Reply
#3
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.
Reply
#4
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
Reply
#5
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?
Reply
#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.
Reply
#7
Will give it a try.

Many Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)