In the interest in doing things the same way for different systems, I will
describe setting it up with a working IR receiver so that you can do it
the same way in the future if you wand to start using an IR remote
with your (serial) IR receiver.
I assume you have a standard (lirc.org or igwanaworks.com) serial
blaster on COM1.
In case you didn't know, everything in Linux is case sensitive, so make
sure you get the capitalization of everything correct.
If you don't have a preferred editor (like vi or emacs) I suggest that
you use pico to make the changes. It is real easy to use.
You will need to be logged in as root to do most of this...
This is all from memory, please post if it works or does not and I will
move it to the wiki.
First comment out (Just put a hash mark ("#") at the beginning of it)
the '/dev/ttyS0 blah blah' line at the end of /var/lib/setserial/autoserial.conf
and add this line after it:
Quote:
/dev/ttyS0 uart none
Mine wound up looking like this:
Quote:
###PORT STATE GENERATED USING AUTOSAVE-ONCE###
###AUTOSAVE-ONCE###
###AUTOSAVE-ONCE###
###AUTOSAVE###
#
# If you want to configure this file by hand, use
# dpkg-reconfigure setserial
# and change the configuration mode of the file to MANUAL. If you do not do this, this file may be overwritten automatically the next time you upgrade the
# package.
#
#/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
/dev/ttyS0 uart none
FYI you are actually supposed to tell the system that you
want to configure this manually by running this first:
Code:
dpkg-reconfigure setserial
Next, rename /etc/lirc to /etc/lirc.save and /etc/irblaster to
/etc/irblaster.save and create new lirc and irblaster directories so we
start from a blank slate:
Code:
cd /etc
mv lirc lirc.save
mv irblaster irblaster.save
mkdir lirc irblaster
Next run /usr/local/bin/lirc-reconfig.sh and select the 'rca-6n1' device
as it is a serial device and thus will set up your lirc to work with serial:
Code:
/usr/local/bin/lirc-reconfig.sh
When it asks you what kind of remote you have do NOT put in
the actual kind of remote you use with your receiver. Think about it,
you would have a remote sending the exact same codes that the
irblaster sends and when you press '1' the IR receiver will see it and make
the blaster send a '1' which the IR receiver will see as the exact same
code you just sent from the remote and it will make the blaster send '1'
over and over. You can get this kind of setup to work if you put the
blaster sender right on the satellite receiver and shield this combination
from seeing anything else, but that is outside the scope of this post and
usually requires removing the IR sender LED and putting it back on a long
wire.
Next run /usr/local/bin/irblaster.sh:
Code:
/usr/local/bin/irblaster.sh
and select your correct satellite receiver and serial COM port.
Next add the lirc.conf that you have for your receiver to the end of
/etc/lirc.conf (replace the obvious in the code below):
Code:
cat insert-the-name-of-your-lirc.conf >>/etc/lir/lircd.conf
insert-the-name-of-your-lirc.conf will usually be /etc/irblaster/irblasterd.conf
Next shutdown your mythtv frontend by pressing ESC from the home
menu and answering Yes. Then right click on the desktop and
select 'xshells -> xterm'. Then get root by running 'su' and entering your
root password. Then shutdown the backend and run mythtv-setup.
Code:
su
<enter your password>
/etc/init.d/mythtv-backend stop
mythtv-setup
Go into 'input connections' and select the connection that you want to
control the channel changing of. In the 'External channel change
command' field enter
Quote:
/etc/irblaster/channel_change.sh
Finish and get out of mythtv-setup.
Edit /etc/irblaster/channel_change.sh and remove the part of the line
that says:
Quote:
--device=/dev/irblasterd
OR If you want to you can replace the channel_change.sh this way
Save the following code into the file /etc/irblaster/channel_change.sh:
Quote:
#!/bin/bash
# Change the following line to reflect the receiver you want to control in /etc/lirc/lircd.conf
REMOTE_NAME=new-remote-name-goes-here
# cancel in case it is at a ppv that won't take channel down
#/usr/bin/irsend SEND_ONCE $REMOTE_NAME cancel
#sleep 0.5
# channel down in case it is at a pay channel that accepts only channel up or down
#/usr/bin/irsend SEND_ONCE $REMOTE_NAME down
#sleep 0.5
for digit in $(echo $1 | sed -e 's/./& /g'); do
/usr/bin/irsend SEND_ONCE $REMOTE_NAME $digit
sleep 0.5
done
...and make it executable:
Code:
chmod a+x /etc/irblaster/channel_change.sh
...and change /etc/irblaster/channel_change.sh by replacing
new-remote-name-goes-here with the name of the receiver you are
controlling in /etc/lirc/lircd.conf The line in lircd.conf will begin
with the word 'name'.
Reboot and test:
Code:
reboot
The payment for this is for you to help someone else with something that
you know about Knoppmyth, possibly later on when you are more
comfortable with it.
Cliff