[mythtv-users] Transmitting on two separate IR transmitters via IguanaIR

Kirk Bocek t004 at kbocek.com
Tue Apr 13 17:33:04 UTC 2010



On 4/13/2010 10:20 AM, Ben Eisemann wrote:
> That makes sense... it be good if you have a means to share that
> script with the group.
> 
> It sounds like the best / most elementary option is to do the
> set_transmitter prior to each and every channel change from within the
> script (not a huge deal, just wanted to make sure I wasn't missing the
> boat).
> 
> I like your idea of making it one script with an option flag.  That
> makes it efficient if I ever go to troubleshoot.
> 
> God Bless,
> 
> Ben T. Eisemann
> beisemann at gmail.com
> 
> Faith means trusting in advance what will only make sense in reverse.
> - Philip Yancey
> 
> 
> 
> On Tue, Apr 13, 2010 at 12:58 PM, Kirk Bocek <t004 at kbocek.com> wrote:
>>
>>
>> On 4/13/2010 9:46 AM, Ben Eisemann wrote:
>>> Hey gang,
>>>
>>> Well (I think) I finally got my Iguana USB IR Transceiver (2 plugs
>>> version) changing channels on a Motorola DTA100 under Mythbuntu.
>>>
>>> My next step is to setup a second tuner and DTA100 combo, and drive it
>>> off the 2nd plug from the IguanaIR.
>>>
>>> My questions is this: how do I go from transmitting out channel 1 and
>>> then go and send an IR signal to a separate DTA100 sitting behind
>>> channel 3?
>>> I realize I could probably make two separate channel change scripts
>>> just send the "set_transmitter 1" at the top of 1 and "set_transmitter
>>> 3" at the top of the other.  But is there a more elementary way that I
>>> am missing?
>>
>> I'm not using the Iguana transceiver but in my dual-tuner setup I made the
>> transmitter selection one of the parameters to my channel change script. So in
>> myth I specified the channel change script as "myscriptname 1" for the first
>> tuner and "myscriptname 2" for the second. This way I have only one script to
>> maintain. I'll be happy to share it if you want.

Of course I have the means to share. It's called text! ;)

This puts a 0.3 second pause between digits. It can also be used from the
command line to send special commands like volume up, etc. Myth itself doesn't
use those special commands.

You'll need to modify the variables at the top of the script for your lirc
setup. This was written before I discovered my revised lirc configuration
shared here previously would also work with the Pace DC50X and before I
changed that config to use the new standard strings in lirc.



#!/usr/bin/perl
#
# MythTV Channel Changer
# For Motorola DTA100
#
# First parameter is emitter, second is command or channel
#
use strict;

my $emit = shift;
my $com = shift;
my $enterkey = 'enter';
my $remote = 'Motorola-DTA100';
my @specials = qw/mute chup chdn volup voldown info enter/;
#@num2key contains the lirc command strings for each key
my @num2key = qw/zero one two three four five six seven eight nine/;

die "Invalid emitter number.\n"
	unless $emit >0 and $emit < 5 and grep(/$emit/, qw/1 2 3 4/);
print "Setting transmitter to $emit\n";
system "irsend set_transmitters $emit";

#send single special command & exit
if (grep /$com/, @specials) {
	print "Sending $com\n";
	system "irsend SEND_ONCE $remote $com";
	exit;
}

die "Invalid channel number.\n" unless $com > 0;
#Sending multi-digit channel
my @chan=split(//,$com);
foreach my $num (@chan) {
	next unless $num>0 or $num eq '0';
	print "Sending $num\n";
	system "irsend SEND_ONCE $remote $num2key[$num]";
	system "sleep 0.3";
}

#Send enter key for one or two digit changes
system "irsend SEND_ONCE $remote $enterkey"
	if $com < 100 and $enterkey;

exit;




More information about the mythtv-users mailing list