PDA

View Full Version : Remote Control w/Serial Port IR Receiver



BobHope2112
January 3rd, 2009, 09:18 AM
I've managed to build an infrared receiver (http://lnx.manoweb.com/lirc/?partType=section&partName=introduction) that attaches to my mythbuntu backend/frontend PC, but can't quite bring it home.

The hardware appears to be good, as I can install LIRC and get reasonable responses from mode2 and irw. A passable lircd.conf for my recycled Sony remote control has been generated, but I don't know how to configure Mythbuntu/MythTV. Nor any applications, really. Even though ~/.lircrc looks good, no applications seem to care that I'm mashing remote control buttons.

The manual acknowledges that there are some hand-operated configurations necessary to get serial IR receivers to work, but does not really expand upon those points.

If someone can nudge me in the right direction, I would be happy to write up what I've learned on that narrow topic, once I get it working.

Thanks for your time and consideration.

ian dobson
January 3rd, 2009, 10:11 AM
Hi,

I just setup my frontend again and am using a serial IR reciever.

Download the installation manual from the mythbuntu web site and follow the instructions in chapter 12.2. This tells the kernel not to play with the serial port that the IR is using.

For me I was at exactly the same point as you (/dev/lirc0 exists) but myth didn't respond to the remote until I edited the lircrc file in my home directory (/home/<user>/.mythtv/lircrc) to include the remote information (In my case Silver Haupage remote control).

Hope this helps abit
Regards
Ian Dobson

BobHope2112
January 3rd, 2009, 05:40 PM
Thanks for your response.

I must admit the installation manual isn't entirely clear to me. What settings do you use in the Mythbuntu Control Center, and when do you make them, relative to the instructions in 12.2?

ian dobson
January 3rd, 2009, 06:35 PM
Hi,

I had to manually configure LIRC from the terminal as the Control Center does not support configuring a serial remote.

Read through the installation manual chapter 12.2.1 to configure the receiver then 12.3 to configure the remote.

Regards
Ian Dobson

BobHope2112
January 3rd, 2009, 07:35 PM
Thanks again for your response. I hope I'm not abusing the situation, but I think I'm just about operable...

I went through 12.2.1, but had to download and install the current lirc from the website. It's the only way I could see to allow me to set configuration options.

Section 12.3 is going well enough: I have a lirc.conf generated by irrecord that I believe is good, so I copied it into /etc/lirc. I get stuck, though, when I get to this item:

Add the modules for the remote to /etc/lirc/hardware.conf under MODULES==
I can certainly edit that file, but I don't know what to add. I'm guessing that MODULES== means REMOTE_MODULES=, but what about the other entries in the Chosen Remote Control section?

#Chosen Remote Control
REMOTE="None"
REMOTE_MODULES=""
REMOTE_DRIVER=""
REMOTE_DEVICE=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""
Also, should START_LIRCD be set to "false", or should I change that as well?

ian dobson
January 3rd, 2009, 09:14 PM
Hi,

No your not abusing my help, if I didn't want to help I wouldn't be here.

I can't get access to my frontend at the moment, I'll have a look tomorrow and post my configuration here.

to check if the remote is working just do a cat /dev/lirc0 then just press afew keys on the remote any youll see "junk" on the terminal. Just press ctrl C to stop the cat process.

Regards
Ian Dobson

BobHope2112
January 3rd, 2009, 10:36 PM
Arrghh, I'm pulling my hair out trying to get this going. A prescription on how to install LIRC is really the only way I've been able to tell if the remote and receiver are working. They recommend:

1) Download and untar latest LIRC (0.8.4a)
2) ./setup.sh and select the appropriate port (ttyS0 in my case)
3) make
4) make install
5) Copy a lircd.conf appropriate for my remote into /etc/lirc/lircd.conf
6) setserial /dev/ttyS0 uart none
7) depmod -a
8) modprobe lirc_serial
9) lircd

If I do all that mode2 spits out pulses and spaces as expected, and irw returns the button names as defined in lircd.conf. cat /dev/lirc0 works anytime mode2 is working. Two character devices, /dev/lirc and /dev/lirc0 are defined at this point. The former after make install, and the latter after modprobe lirc_serial.

After I restart, I can go back to step #8 and get mode2 to work again, but only by supplying the device: /dev/lirc0. The only way I can get IRW to work again is by going back to step #4. How can I persist these settings?

I tried load lirc_serial on startup by adding it to /etc/modules, but /dev/lirc0 does not get created. I can probably manage to create a persistent symbol link, /dev/lirc that points to /dev/lirc0, but I need it defined first.

As for the Mythbuntu Installation Guide, section 12.2.1 seems to be in place. I don't have to setserial in order to get mode2 see the remote--that must mean that the kernel is leaving it alone? I'll wait to hear more about that bit in section 12.3.

One final question, should I have LIRC up an running, meaning that mode2 and irw are both working, before I can hook it up to mythtv?

Thanks again for your efforts.

ian dobson
January 4th, 2009, 10:55 AM
Hi,

OK the reciever is now working and accepting the IR pulses. All we now need to do is get that passed on to mythtv.

In my /etc/lirc/hardware.conf I have



# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Home-brew (16x50 UART compatible serial port)"
REMOTE_MODULES="lirc_dev lirc_serial"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""


And in /etc/lirc/lircd.conf



#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.

#No default remote configuration was included for Home-brew (16x50 UART compati$
#You will need to include your own custom configuration for
#this remote, and file a bug at https://bugs.launchpad.net/ubuntu/+source/lirc/$


begin remote

name Hauppauge
bla bla bla


Note Im using hauppauge Silver Remote with a serial receiver.

In /home/<user>/.mythtv I have a symbolic link from lircrc -> ../.lirc/mythtv

After checking/updating all these files on my config the remote suddenly started wotking in MythTV.

Regards
Ian Dobson

BobHope2112
January 5th, 2009, 06:04 AM
Thanks, you've been very helpful. I've managed to get it to work, but have now encountered other problems in getting my final setup.

I've decided to mount the IR receiver inside of the PC case, and because of that, use the second COM port (ttyS1, COM2, COM-B, whatever you want to call it.) Even though I've rebuilt lirc_serial with the proper configuration, inserting it into the kernel fails if I've not freed COM1. (If I do free it, then it just uses it and ignores my configuration.)

At any rate, thanks for helping me out, I'll be able to use that information once I get this burp straightened out.

ian dobson
January 6th, 2009, 06:10 AM
Hi,

Make sure you've got the serial port setup correctly (using set serial) and that the correct tty is configured in lirc.

Don't forget to check that com2 is enabled in the bios (That one got me on my frontend).

Regards
Ian dobson