ir Blasting in Linux

I never realized how easy I had it by using the serial tuning plugin for DirecTV in SageTV. I recently switched to Verizon’s FiOS for all TV needs, their bundle pricing was too good to pass up. I also purchased a HD-PVR unit to capture HD streams.The only downside is that VZ does not allow for serial port tuning.

On a recommendation I purchased iguanaIR blaster which has suport for up to 4 devices. I set everything up trying different versions of lirc, etc., and finally settled in on the version hosted at Iguana Networks and using their prepackaged server software. With the help of the same friend, he has written a plugin for SageTV which executes a script whenever a tuning call is performed. The script is included after the break.

#!/bin/bash
# Generated by lircconfig at lircconfig.commandir.com
# Mon Jun 9 4:12:39 MDT 2008 for bcjenkins
# Modified by bcjenkins to work with GenericTuner library by jpwegas

# Define multiple remotes in lircd.conf can be referenced below. Place them in order of the
# ports. Place your remotes in sequential order. It is not necessary to use -#.

REMOTE=( FiOS-TV-1 FiOS-TV-2 FiOS-TV-3 )
DELAY=.2
LOCKFILE=/tmp/lirclock
export PATH=/bin:/usr/bin:/usr/local/bin
REMOTE_NAME=$2
cmd=”$3″

for (( x = 0 ; x < ${#REMOTE[@]} ; x++ )); do
if [ $2 = ${REMOTE[$x]} ]; then
TRANSMITTER_NUM=$(($x+1))
fi
done

if [ $1 = “PlayCommand” ]; then
while [ -f $LOCKFILE ]
do
#echo “Waiting for lock…”
sleep .1
done

touch $LOCKFILE
irsend SET_TRANSMITTERS $TRANSMITTER_NUM
sleep .15
irsend SEND_ONCE $REMOTE_NAME $cmd
rm $LOCKFILE
fi

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: