Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raspberry Pi Player Programming
#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


Messages In This Thread
Raspberry Pi Player Programming - by ChevyChase - 28-11-2017, 09:06 PM
RE: Raspberry Pi Player Programming - by TomP - 05-12-2017, 03:35 PM
RE: Raspberry Pi Player Programming - by TomP - 06-12-2017, 10:41 PM
RE: Raspberry Pi Player Programming - by Craig - 07-12-2017, 10:47 AM
RE: Raspberry Pi Player Programming - by Craig - 17-12-2017, 12:03 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)