# lirc not working

## TheCoop

im using 2.6.5_rc3-love2, and got lirc sir and serial port support compiled into the kernel. hardware is a standard FIR laptop port. I start /etc/init.d/lircd to get /dev/lircd, then stop it to free up the dev entry. when i start mode2 i get:

```
tachyon simon # mode2 -d /dev/lircd

mode2: error opening /dev/lircd

mode2: No such device or address

```

what kernel config have i missed out?

----------

## pubecon

I failed to find either a good howto or any useful information on the topic a long while ago but did manage to make a bit of progress by adding

```
LIRC_OPTS="--with-driver=cph06x --with-syslog=LOG_DAEMON" 
```

 to my emerge command (it was for a tv card) to specify the driver to be used.

I failed to find a straight howto on the matter and since I can never seem to find the time I gave up eventually but there does seem to be a few howtos with laptop specific infrared information.

----------

## krinkle

thought i would bump this topic up becuse i'm having the same problem. 

```
bash-2.05b# mode2 -d /dev/lircd 

mode2: error opening /dev/lircd

mode2: No such device or address
```

i haven't had much time to fiddle around (big test tomorrow), but i'm not really sure how to go about approaching this... any ideas?

ps. i'm using a home brew reciever (via serial port)

----------

## krinkle

got it working. here's what i did. i d/l and installed the 2.6.4 patch from this page. then i patched the kernel and built it per the instructions on that page. rebooted, and it all worked. lemme know if it works for you though.. i might have forgot a step

----------

## TheCoop

tried that, doesnt work on my built in laptop fir port, i think i need the usb drivers but those bomb out when compiling  :Sad: 

----------

## ett_gramse_nap

 *TheCoop wrote:*   

> tried that, doesnt work on my built in laptop fir port, i think i need the usb drivers but those bomb out when compiling 

 

 :Very Happy:  Do you _really_ need a remote control to your laptop??

----------

## krinkle

prolly the same reason any desktop would want a remote. becuase we can  :Wink: 

(not to mention controlling xmms from my bed, the couch, etc.)

----------

## TooTallForPony

I don't know what TheCoop's motives are, but I definitely need a remote for my laptop.  I've got an old laptop that I'm hooking up to my stereo to be an mp3 streamer.  The server that houses the mp3s is in another room and doesn't have a sound card, and my desktop machine is upstairs, so running a cable from either of those is not an option.  So I've set up SlimServer on the server, and I'm streaming audio wirelessly to the laptop.  Works like a charm.  :Smile:   But, I need the remote for the stereo to control the mp3 streaming (skip, play, pause, volume, etc), so I can just close the laptop, slide it in next to the receiver, and ignore it.  I'm just starting to work on LIRC now; once I get it working I'll post an answer here.

----------

## TooTallForPony

Got lirc working with a 2.6 kernel.  Here's what I did:

1. I'm using the 2.6.5-mm6 sources (sys-kernel/mm-sources).

2. Get the lirc-2.6.5-mm1-20040406 patch from http://www.elektronikschule.de/~genannt/kernel-patche/lirc/index.html and save it somewhere.

3. cd /usr/src/linux-2.6.5-mm6 && patch -p1 < /tmp/lirc-2.6.5-mm1-20040406 (the patch applies just fine to the 2.6.5-mm6 kernel; not sure about the 2.6.6-pre kernels).

4. make menuconfig; in device drivers -> character devices -> serial drivers, make sure 8250/16550 and compatible is set as a module, rather than built-in.  If it's built-in and you can't change it, try setting other things (like mwave) to modules.

5. Linux InfraRed Controller should be right below it in character devices; turn off Parallel Driver (it doesn't build properly for me).  You really only need the SIR driver if you're using the built-in IRDA port.

6. For some reason, you have to set the IO port and IRQ in two different places in the LIRC config of the kernel.  If you have a serial port on the back of your machine, it's probably COM1 (0x3f8, IRQ 4), so your IR port will be COM2 (0x2f8, IRQ 3), otherwise it'll be COM1.  Choose the appropriate port.  For my purposes, I disabled the built-in serial port in the BIOS and set the IR port to 0x3f8, IRQ 4.

7. Rebiuld your kernel and install it.

8. Reboot into the new kernel.  Modprobe 8250, and then run "setserial /dev/ttyS0 uart none" (use /dev/ttyS1 if your IR port is the second serial port).  This will tell the serial driver not to use it.  I'm not sure why, but I had to insert the 8250 module and then disable the IR port to get LIRC working properly.

9. modprobe lirc_dev, and then modprobe lirc_sir (the kernel SHOULD automatically insert lirc_dev when you modprobe lirc_sir.  But on my laptop, it inserts lirc_dev and then lirc_sir doesn't insert properly, so I have to modprobe it again).  Once that's done, run /etc/init.d/lircd start.

10. At this point you should have LIRC set up properly!  Try using irrecord to pick up the signals for your remote, or grab the appropriate config file from www.lirc.org.  You'll need to have /etc/lircd.conf set up, and you'll also need a ~/.lircrc file to tell LIRC what to do when you press each button.  Since I'm using the remote to control a SlimServer server, I've got entries like this:

begin

  button = play

  prog = irexec

  repeat = 0

  config = wget "http://ww.xx.yy.zz:9000/status_header.html?p0=play&player=ww.xx.yy.aa"

end

I do all of this configuration and start irexec in /etc/conf.d/local.start, so it runs automatically when the laptop gets rebooted.

Hope this helps!

[/list][/list]

----------

