The IR-receiver is plugged into a free port and sends the received data string to LIRC. The data from the pushed buttom of the remote control will be retrieved and and will be offered other programs.
1. Driver-Installation (only IR-2-usb)
Plug the IR-2-usb module into a free USB-port of your computer.
Check, if the neccessary driver is already installed
Load the file "/var/log/messages" with an editor of your choice (you need root-privileges to do this)
and look for the following lines:
"usbserial.c: FTDI 8U232BM converter detected"
"usbserial.c: FTDI 8U232BM converter now attached to ttyUSB0 (or usb/tts/0 for devfs)"
If you have found these lines, the work is already done.
The driver for your IR-2-usb module is installed and you can go on with step 2. Just note the printed device-name of your
IR-2-usb (here "/dev/ttyUSB0"). You need this for the ongoing installation, where
you replace the device-name of the serial-module with the USB-one!
If you didn't find these lines, some more work has to be done. To install the driver of your IR-2-usb
you have to configure, compile and install a kernel. For any help on this, check
the documentation of your installed linux-distribution.
Note: The needed driver "FTDI SIO" is included in the kernel since version 2.4.20. If you use an older kernel
and don't want to update, check the driver-website
http://ftdi-usb-sio.sourceforge.net, if a patch is
available for your kernel.
2. Kernel configuration
Start the kernel configuration (with a "make config", a "make menuconfig" or a "make xconfig").
Activate the following points:
"Support for USB"
"USB Host Controller Drivers"
"USB Serial Converter Support"
"USB FTDI Single Port Serial Driver"
For simplicity just install all drivers as module (M).
If you don't know the USB-controller-chip of you computer, just enable all drivers from "USB Host Controller Drivers".
Next compile and install the kernel; don't forget to install the modules
("make modules" and "make modules_install"). Then update your bootloader (LILO, Grub, ...).
Restart your computer and boot the new kernel.
Now you should see the lines from above in the file "/var/log/messages" and the driver installation of your
IR-2-usb is finished. Note the device-name of your IR-2-usb (e.g. /dev/ttyUSB0") and
go on with the next step.
3. Installation of libirman (IR-2-serial and IR-2-usb)
First extract the files from the libirman package:
tar -xf libirman_0.4.2.tar
Now change to the libirman-directory
Configure, compile and install libirman
Now execute ldconfig
Note: To execute "make install" and "ldconfig" superuser-rights are neccessary. Before executing these commands, login as user "root". From the commandline simply use the command "su".
4. Test of your ir2pc with libirman
Execute from within the directory "libirman_0.4.2" the program "test_io". "test_io" needs as only parameter the name of the serial port, your ir2pc is connected to. On linux systems the serial ports are named "/dev/ttySX", where X is the number of the port (0 for the first serial port , 1 for the second and so on). If your ir2pc is connected to the second serial port of your PC, execute "test_io" this way:
If the given serial port is correct and your ir2pc is connected properly, the following two lines should appear on you screen:
Now take you remote control and press some keys. For every keypress "test_io" should print a line, that looks like this one:
If you see these lines, your ir2pc is working under Linux. Congratulations! Now stop "test_io" by pressing the keys CTRL + C.
Note 1: Please remind the name of the serial port, your ir2pc is connected to. You need this one for the installation of lirc.
Note 2: If "test_io" only shows "IR" after the start, choose another serial port or check the connection of ir2pc to your PC.
Note 3: Due to the layout of the USB-module, the ir2pc can only be
initialized once on the USB bus. Every additional attempt will fail,
unless you unplugged and plugged your ir2pc again.
Since all programs (e.g. "test_io") won't work, if the initialization
failed, you have to unplug and plug again your ir2pc before using
them a second time _or_ disable the init-code (see the forum for help
Note 4: If your ir2pc seems to react too slow on key-presses, please
change the following line in "irman.h" (from the libirman-directory):
#define IR_POLL_TIMEOUT (1 MSEC)
Change the value from 1 msec to 50 msec. After this change the line
should look like this:
#define IR_POLL_TIMEOUT (50 MSEC)
Please recompile and reinstall libirman after this change with "make
clean; make; make install;".
(This problem occured _only_ with the USB version)
5. LIRC installation (IR-2-serial and IR-2-usb)
Extract the files of the lirc-package and change to the lirc-directory:
tar -xf lirc-0.6.6.tar
Start the lirc-"Setup":
You should see now a menu with different options. Please choose item 1 "Driver configuration" and then item 4 "Other serial port devices" and finally item 6 "Irman / UIR".
Now lirc will ask you for the name of the serial port, your ir2pc is connected to. Please select the port , you tested successfully with "test_io". In item 2 of the "setup" "Software configuration" you can select some additional options of lirc. If you don't want to do this, just select item 3 "Save configuration und run ./configure".
To compile and install lirc, execute:
6. Configuration of lirc and your ir2pc
To work with your IR-receiver and your remote control lirc needs a configuration file, which describes the remote control you want to use with lirc. This file says lirc what keys to use and what meanings the different keys possess.
Since libirman doesn't work with the lirc-program "irrecord", which is used normally to create this configuration-file, we have to use a workaround to create the lircd.conf for ir2pc.
7. Creation of lircd.conf
In the "contrib"-directory of your lirc-directory you will find a perl-script called "irman2lirc". "irman2lirc" normally should be used to convert a libirman-configurationfile to the lirc-format. But we will use it, to create the base for our lircd.conf. With:
./irman2lirc > /etc/lircd.conf
you create this base-file named "lircd.conf" in the etc-directory. (You are free to choose another name than "lircd.conf" or save the file in a different directory.) To adapt this file to the needs of ir2pc and your remote control, it is recommended to open two consoles. If there is no X installed on your system, that's no problem: change the lircd.conf in two steps.
To get the codes of your remote control start again "test_io" from the libirman-directory. Press all keys of your remote control you want to use with lirc . Please note the output of "test_io" for every key (or edit lircd.conf in parallel).
Now start the text editor of your choise and load the configuration-file you have created with "irman2lirc". You will easily see the two main parts of this file: The common remote-control configuration on top of the file and the key-assigments at the end of the file. Please don't change the common configuration on top of the file. Exception: If you want to use more than on remote control, adapt the remote control name, which is always "irman" in the original file.
In the lower part (between "begin codes" and "end codes") "irman2lirc" already added a lot of keys. But we don't need these, except one single entry. This entry is the base for the keys of your own remote control.
Now add such an entry (line) for every key of your remote control. First there is the name of the key in this line (e.g. Pause, Stop, Play, 0,1,2,... ) and second there is the key data. This data starts always with a "0x". This is only to inform lirc, what data format is used. After this "0x" there are 16 characters (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F), which represent the real data of a remote control key.
Because the data of a key contains 16 characters, but "test_io" sends only 12 characters per key, the first 4 characters after the "0x" have to be always 0. Afther this the 12 charaters of "test_io" follow.
Adapt now the configuration file to your remote control by creating such a line for every remote control key, changing the name of the key and entering the output of "test_io" after the keyname.
If you are ready with this, the worst part of the lirc-installation is done.
Note 1: Always use different names for different keys on remote control. Otherwise programs, that should use lirc, won't recognize clearly what key of the remote control was pressed.
Note 2: If you want to use more than one remote control with ir2pc and lirc, copy the complete content of the configuration file to the end of the file. Change the name of the remote control for this copy and the names and the data for the keys.
Note 3: If libirman was not installed, irman2lirc doesn't work since it is not able
to find the irman.conf. In this case just give the path of the irman.conf file
(from the libirman directory) to irman2lirc:
./irman2lirc /path/to/irman.conf > /etc/lircd.conf
8. Testing lircd.conf
To test the new lirc configuration file, the program "lircd" (the lirc daemon) should be started first. "lircd" is located after a default installation in /usr/local/sbin. If you have – as recommended – created the configuration file as "/etc/lircd.conf", start lircd like this:
If you configuration file is located in another directory or has got a different name start lircd as follows:
You can stop lircd with:
After starting lircd, start the program "irw". "irw" outputs for every received IR code a single line:
ffff5B4000000000 00 1 irman
ffff5B4000000000 00 2 irman
ffff5B4000000000 00 3 irman
Here you see, that the keys 1,2 und 3 of the remote control named irman have been pressed. If irw outputs such data, you did it! Your ir2pc is running with lirc.