Serial IR Blaster to control a STB

This was originally posted by permutation-jim. Thought I would use it as guide for anyone needing it.

Using a standard serial homebrew IR transceiver (i.e. it sends and receives) made by Iguana Works. Using the standard lirc modules loaded by MythDora, I ran the following command as root:

1) #modprobe lirc_serial type=0 io=0x2f8 irq=3 softcarrier=1 ; lsmod | grep lirc_serial

This command is to make sure things work using Com2 without a reboot. Com1 would be io=0x3f8 irq=4

2) Add these lines to the end of /etc/rc.d/rc.local

setserial /dev/ttyS0 uart none #ttyS0=com1 ttyS1=com2
/sbin/modprobe lirc_serial
lircd --device=/dev/lirc0 --output=/dev/lircd
lircd --driver=default --device=/dev/lirc1 --output=/dev/lircd1 --pidfile=/var/run/lircd1.pid

3) MythDora comes with a variety of remotes included and if you have one that is supported then you can skip this step. But if not, then you can possibly find the remote config to control your STB here. This file will go in /etc/lircd.conf and append to it if something is already there.

4) During install you may have already setup an IR Blaster. If not then you can set this up again in MythDora Tools -> Resetup -> IR Blaster. Choose the Com port you want. Remember what you chose in step 1.

5) Now create a file called change_channel.sh in /usr/local/bin. Use nano or any of the included editors. Enter the syntax below into your new file. Remember to change the name of your remote from DCT2000 to whatever you have listed in lircd.conf under name.

#!/bin/bash
REMOTE_NAME=DCT2000
for digit in $(echo $1 | sed -e 's/./& /g'); do
irsend --device=/dev/lircd1 SEND_ONCE $REMOTE_NAME $digit
sleep 0.4 # note, you may have to tweak the interdigit delay up a bit
done
irsend --device=/dev/lircd1 SEND_ONCE $REMOTE_NAME OK

Now give it the appropriate permissions as root. # chmod 777 /usr/local/bin/change_channel.sh

Am I on the right track?

Ok, I have done the command

modprobe lirc_serial type=0 io=0x3f8 irq=4 softcarrier=1 ; lsmod | grep lirc_serial

The result of lsmod | grep lirc_serial is:
lirc_serial 15104 0
lirc_dev 16292 3 lirc_serial,lirc_mceusb,lirc_mceusb2

What is next?
If I add the lines listed above into rc.local (i.e.)
-> setserial /dev/ttyS0 uart none #ttyS0=com1 ttyS1=com2 /sbin/modprobe lirc_serial
-> lircd --device=/dev/lirc0 --output=/dev/lircd
-> lircd --driver=default --device=/dev/lirc1 --output=/dev/lircd1 --pidfile=/var/run/lircd1.pid

I tried this... running the following commands:

[root@localhost ~]# lircd --device=/dev/lirc0 --output=/dev/lircd
lircd: there seems to already be a lircd process with pid 2870
lircd: otherwise delete stale lockfile /var/run/lircd.pid
[root@localhost ~]# lircd --device=/dev/lirc1 --output=/dev/lircd
lircd: there seems to already be a lircd process with pid 2870
lircd: otherwise delete stale lockfile /var/run/lircd.pid

So, Here are questions:

Am I going the right direction?
Will lirc0 work as my blaster?
How can I tell which lircX device is the correct one...
What changes do I need to make?
Do I have to 'shudder' compile anything?

What do I do after this? Will the command 'irsend' start to work?
Note: Currently I get the following

->[root@localhost ~]# irsend --device=/dev/lirc1 SEND_ONCE ICM-400 1
->irsend: could not connect to socket
->irsend: Connection refused

NOTES:
1. I have a USB reciever (hauppage MCE reciever) that I use for my remote...
2. I purchased a serial IR blaster from irblaster.info...
3. I have already recorded my remote info using irrecord.. so that is already

I feel like I am SOOOO close.. please help.

Thanks.

i see you got this working

i see you got this working here : http://mythdora.com/?q=node/2558

IR Blaster info

Hi Dennis,

I had used this link: http://www.eggshellskull.com/lirc/blaster/index.php

in previous installs and it was quite useful. What I wonder is how much of is still applies with MythDora 4.0?

Thanks