Scheduling/Timer for ola recorder / playback with raspberry pi

384 views
Skip to first unread message

dargs

unread,
Sep 21, 2013, 8:46:05 AM9/21/13
to open-l...@googlegroups.com
Hi

I'm loving the record/playback ability of OLA, and thinking of using OLA on a Raspberry PI to run a prerecorded sequence for in a gallery environment, but would like a way of shutting off the show after hours. 

Does anyone have ideas for scheduling OLA to run a recorded show on a schedule? (ie start running at 0900 and finish at 1700 daily)

Started reading up on the Cron job scheduler, and that looks like it could work, but what's the best way of stopping a playback that's set to run with '-i 0' ?  And then setting all dmx channels to 0, (or running another basic record that has every channel at 0)

Worst case I can use the buildings power control to cut power to the lights, and/or the raspberry pi, and have it run OLA on startup, but that doesn't seem very graceful. I also have access to close-contact relays from other scheduling systems (AMX & Dynalite), so could use GPIOs to start/stop the playback perhaps.

Also curious about the possibility of editing the record file to create a seamless loop in my record, is the file accessible and editable ? - sorry my linux (and python) skills are pretty poor.

Any tips would be awesome..

Thanks
dargs

dargs

unread,
Sep 21, 2013, 10:15:27 PM9/21/13
to open-l...@googlegroups.com
Ok.. after a bit more playing around and testing.. i think the 'killall' command could work.. 

ie

0900 $ ola_recorder -p MyRecord -i 0

1700 $ killall ola_recorder -p MyRecord -i 0
1701 $ ola_recorder -p MyBlackout
1702 $ killall ola_recorder -p MyBlackout

If there's a better/cleaner way to stop a playback let me know!

dargs

dargs

unread,
Sep 21, 2013, 10:38:57 PM9/21/13
to open-l...@googlegroups.com
And I've found the MyRecord file and was able to trim/tidy up the recording to get the playback tighter.. I'm assuming the number between frames is the delay in milliseconds.

For anyone else not very linux trying to do this, WinSCP made it easy to transfer file to a windows machine and edit the record file.

OLA Show
0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1000

dargs

unread,
Sep 22, 2013, 12:49:16 AM9/22/13
to open-l...@googlegroups.com
And for anyone playing along at home...

Looks like this is working ok... to start the show at 0900 daily, and stop it at 1705. and go to blackout at 1706.. I've got some logging going on as well, but to keep the example simple:

"sudo crontab -e" 

# m h  dom mon dow   command

00 09 * * * /usr/bin/ola_recorder -p /home/pi/MyRecord -i 0

05 17 * * * ps -eo pid,args | grep ola_recorder | awk '{print $1}' | xargs -I {} kill {}

06 17 * * * /usr/bin/ola_recorder -p /home/pi/MyBlackout


Not sure if I'll have an internet connection to keep the date/time synced. Was just going to have thee Raspberry Pi and an enttec ODE device with a cross-over cable and static IPs. Might look at real time clock solution or manually update the date/time when it gets installed, and keep an eye to see how much it drifts.

dargs

Simon Newton

unread,
Sep 22, 2013, 12:55:57 AM9/22/13
to open-lighting
On Sat, Sep 21, 2013 at 9:49 PM, dargs <dar...@gmail.com> wrote:
> And for anyone playing along at home...
>
> Looks like this is working ok... to start the show at 0900 daily, and stop
> it at 1705. and go to blackout at 1706.. I've got some logging going on as
> well, but to keep the example simple:
>
> "sudo crontab -e"
>
> # m h dom mon dow command
>
> 00 09 * * * /usr/bin/ola_recorder -p /home/pi/MyRecord -i 0
>
> 05 17 * * * ps -eo pid,args | grep ola_recorder | awk '{print $1}' | xargs
> -I {} kill {}

Sorry, I'm busy dealing with my day job right now but you'll want:


ps -eo pid,args | grep [o]la_recorder | awk '{print $1}' | xargs -I {} kill {}


Can you file a bug to add a --duration option to the recorder please.
Thats an easier way of doing what you want.



Simon
> --
> The Open Lighting Group: open-l...@googlegroups.com, #openlighting
> (irc.freenode.org)
> To unsubscribe from this group, send email to
> open-lightin...@googlegroups.com
> For more options, visit https://groups.google.com/groups/opt_out?hl=en

dargs

unread,
Sep 22, 2013, 1:10:08 AM9/22/13
to open-l...@googlegroups.com
report filed..thanks heaps!

Peter Newman

unread,
Sep 22, 2013, 6:12:30 PM9/22/13
to open-l...@googlegroups.com
Would ola_streaming_client not be a cleaner way for the blackout, assuming it allows you to send a single frame?
Reply all
Reply to author
Forward
0 new messages