# Steps to load lirc?

## whygentoo

I have read several post about lirc. But I´m not sure about the way to load lirc. I have compiled the kernel (2.4.25-gentoo-r1) with serial as a module, as often advised. I know my homebrew serialreciver and remote works, as I have been able to run it with winlirc.

Modprobe lirc_serial loads lirc_serial and lirc-dev. It looks good, dmesg gives the output:

lirc_dev: IR Remote Control driver registered, at major 61

lirc_serial: autodetected active low reciver

lirc_dev: lirc_register_plugin: sample_rate: 0

But I have not been able to get irrecord, irw or mode2 to work. Some posts talks about:

1) load serial/8250

2) setserial /dev/ttyS0 uart none

3) modprobe lirc_serial

Do I have to use setserial when serial is built as a module? What is the proper way to load lirc?

----------

## detroitx

settings for lirc (com1) in

/etc/modules.d/lirc

 *Quote:*   

> 
> 
> alias char-major-61 lirc_serial
> 
> alias /dev/lirc/lirc* lirc_serial
> ...

 

emerge options can be set in

/etc/make.conf

 *Quote:*   

> LIRC_OPTS="--with-driver=serial --without-soft-carrier --with-transmitter --with-irq=4 --with-port=0x3F8"

 

you also need to create the devices nodes for lirc

 *Quote:*   

> mknod -m 0660 /dev/lirc/lirc0 c 61 0

 

cu

----------

## whygentoo

Solved solved solved!

It turned out that the supply voltage was to low from the serial interface on the Via EPIA 5000 board. You who are familiar with the serial interface know that it´s possible to get a DC supply voltage around 8-12 volt by connecting to the serial interface pin 5 and 7, thats GND (Signal ground) and RTS (Request to send).

I activated the serial interface by modprobe lirc_serial and the messauring the ouput voltage. I got a 5 volt supply from my Via Epia 5000 board. I then switched board to my VIA ME6000 board. I did a modprobe lirc_serial an messaured the output voltage to my homebrew reciever. I got a 7.3 volt supply. And LIRC was up and running whitout any problem. I don´t know if it´s possble to recomstruct the serial reciver or if a parallell reciver would work with the Epia 5000 board. That is still to investigate. But it seems to me that the supply voltage is to low from the Via Epia 5000 serial interface. This is similar with the problem that some time happend to laptops: that the supply voltage is to low to operate the serial reciver, despite that it only consumes a few milliwatts.

----------

## bkunlimited

@detroitx

I followd your steps above. but anyway when trying to modprobe lirc_serial i get the following error message:

```

FATAL: Error inserting lirc_serial (/lib/modules/2.6.7-gentoo-r11/misc/lirc_serial.ko): Device or resource busy

```

/dev/lirc/lirc0 exists:

```

crw-rw----  1 root root 61, 0 12. Aug 11:39 lirc0

```

currently loaded kernelmodules:

```

gentoo / # lsmod

Module                  Size  Used by

lirc_dev               14348  0

e100                   31104  0

intel_mch_agp           8848  0

rtc                    12360  0

```

does anyone have an idea of how to solve this problem?

I'm using self built kernel 2.6.7-gentoo-r11

----------

## bkunlimited

ah i solved it by myself. sometimes it really helps to read the dmesg output   :Embarassed: 

this solved the problem:

```

gentoo / # setserial /dev/ttyS0 uart none

gentoo / # modprobe lirc_serial

gentoo / # lsmod

Module                  Size  Used by

lirc_serial            13184  0

lirc_dev               14348  2 lirc_serial

e100                   31104  0

intel_mch_agp           8848  0

rtc                    12360  0

```

----------

## b0fh

Any idea where to put that setserial stuff when I want to load lirc-serial automatically?

----------

## bkunlimited

hmm... i tried 2 different ways:

1) calling setserial command out of /etc/init.d/serial which is in runlevel "boot" -> no effect

2) calling setserial and modprobe lirc_serial from /etc/init.d/lircd before lirc gets started.

i also failed in second case... i have no idea why  :Sad: 

----------

## bkunlimited

maybe anyone has an idea where to put it???   :Question: 

----------

## mrnegitoro

No word on where to put this code still?

```
setserial /dev/ttyS0 uart none
```

----------

## bkunlimited

i have a very strange problem: i can insert the module without any problems. but i can't get irw, mode2 or irxevent to work. any ideas why??

----------

## mrnegitoro

Is your lircd running?  :Smile:   Mine is located in /usr/local/sbin/

----------

## mrnegitoro

Ok, I'm sure it is. Maybe it's a permissions problem? I like to state the obvious   :Very Happy: 

----------

## bkunlimited

my lircd is running. it is located in /usr/sbin.

i don't think it is a permissions problem because no such error messages are reported. i created /dev/lirc with the following command:

```

mknod -m 0666 /dev/lirc c 61 0

```

i can paste some parts of /var/log/messages:

```

Sep  2 14:40:52 mediab0ne lirc_dev: IR Remote Control driver registered, at major 61

Sep  2 14:40:53 mediab0ne lirc_serial: auto-detected active low receiver

Sep  2 14:40:53 mediab0ne lirc_dev: lirc_register_plugin:sample_rate: 0

Sep  2 14:41:09 mediab0ne 0.7.0pre7[7329]: lircd(serial) ready

```

the only thing that i could imagine is the following:

obviously irxevent tries to connect to /dev/lirc. that's why i removed /dev/lirc/lirc0 and created /dev/lirc instead.

but that didn't change the behaviour of mode2.

```

Sep  2 15:01:06 mediab0ne 0.7.0pre7[7483]: caught signal

Sep  2 15:01:11 mediab0ne 0.7.0pre7[7588]: lircd(serial) ready

Sep  2 15:01:28 mediab0ne 0.7.0pre7[7588]: accepted new client on /dev/lircd

Sep  2 15:01:28 mediab0ne 0.7.0pre7[7588]: could not get file information for /dev/lirc/lirc0

```

----------

## bkunlimited

i tried the same configuration on a suse 9.1. it also did not work. but i got it running w/o problems with winlirc 0.6.5. so my question is: did i forget to load something on my gentoo?

----------

## mrnegitoro

I installed lirc using a CVS version http://www.lirc.org/cvs.html. The CVS version created the Kernel modules, I didn't have to use a Kernel patch or anything like that. Excuse me if you used the CVS too, I didn't re-read this entire post. I'm looking for the post that turned me on to using the CVS when I find it I will post a link here... (stupid me didn't bookmark it).

----------

## mrnegitoro

Here it is...

https://forums.gentoo.org/viewtopic.php?p=1448997

----------

## bkunlimited

unfortunately this was not the reason. i tried the cvs version as you suggested but the result was the same. the kernel module was built properly and i was able to load it and start the lirc daemon. but no application (either irw, or irxevent or mode2) showed any output  :Sad: 

i'm lost... what could it be?

----------

