LIRC Device Examples - ArchWiki

# LIRC Device Examples

Related articles

- LIRC

This article includes device specific examples of LIRC function configurations.

## Asus DH Deluxe series motherboard

Check the output of:

    $ cat /dev/usb/hiddevX

where X is 0,1 or bigger, and press some buttons on remote. If characters result, then the device is working, follow steps:

1. In file `/etc/conf.d/lircd.conf` add:

    LIRC_DRIVER="dvico"

2. Restart lirc.service.

## ASRock ION series (Nuvoton) quickstart

    $ ln -s /usr/share/lirc/remotes/lirc_wb677/lircd.conf.wb677 /etc/lirc/lircd.conf
    # systemctl restart lirc

## Logitech Wireless Presenter R400

The R400 Presenter can be used with default configuration from devinput. Follow the following steps to be able to use the following buttons: `KEY_PAGEDOWN KEY_PAGEUP KEY_DISPLAYTOGGLE KEY_PRESENTATION`.

1. Copy the default devinput configuration which should work out of the box for the R400:

    # cp /usr/share/lirc/devinput/lircd.conf.devinput /etc/lirc/lircd.conf

2. Create the following Udev rule to create the correct symlink whenever you connect your presenter:

    /etc/udev/rules.d/99-logitech-r400-lirc.rules

    [Service]
    ExecStart=
    ExecStart=/usr/bin/lircd --driver=devinput --device=/dev/input/ir

3. Create the lirc service configuration file to start the lirc service with the correct settings for your presenter whenever you want to transform it into a remote control:

    /etc/systemd/system/lirc.service.d/logitech-r400.conf

    [Service]
    ExecStart=
    ExecStart=/usr/bin/lircd --driver=devinput --device=/dev/input/ir

3. Start lirc and use `irw` to test whether your keys are recognised:

    $ irw
    000000008001006d 00 KEY_PAGEDOWN devinput
    0000000080010068 00 KEY_PAGEUP devinput
    00000000800101af 00 KEY_DISPLAYTOGGLE devinput
    00000000800101a9 00 KEY_PRESENTATION devinput

4. Create your program-specific configurations as described here.

## Serial Port "Home Brew" IR Receiver

1. Create a udev rule to give non-privleged users read/write access to the serial port. In this example, ttyS0 is used.

    /etc/udev/rules.d/z98-serial.rules

    # For serial port ttyS0 and LIRC
    KERNEL=="ttyS0",SUBSYSTEM=="tty",DRIVERS=="serial",MODE="0666"

2. Create the needed modprobe configs

    /etc/modules-load.d/lirc_serial.conf

    lirc_serial

    /etc/modprobe.d/lirc_serial.conf

    install lirc_serial /usr/bin/setserial /dev/ttyS0 uart none && /sbin/modprobe --first-time --ignore-install lirc_serial
    options lirc_serial type=0
    remove lirc_serial /sbin/modprobe -r --first-time --ignore-remove lirc_serial && /sbin/modprobe -r lirc_dev

Note: Using udev rules to run the setserial command does not work in my experience because lirc_serial gets loaded before the serial port rules are applied.

3. Install a custom systemd service file.

    /etc/systemd/system/lirc.service

    [Unit]
    Description=Linux Infrared Remote Control
    After=network.target

    [Service]
    Type=simple
    PIDFile=/run/lirc/lircd.pid
    ExecStartPre=/bin/rm -f /dev/lirc /dev/lircd /var/run/lirc/lircd
    ExecStart=/usr/sbin/lircd -n -r -P /run/lirc/lircd.pid -d /dev/lirc0 -o /run/lirc/lircd
    ExecStartPost=/usr/bin/ln -sf /run/lirc/lircd /dev/lircd
    ExecStartPost=/usr/bin/ln -sf /dev/lirc0 /dev/lirc
    ExecReload=/bin/kill -SIGHUP $MAINPID

    [Install]
    WantedBy=multi-user.target

4. We still need the default tmpfiles to be created, so copy that config file to `/etc/tmpfiles.d/lirc.conf`.

    # cp -a /usr/lib/tmpfiles.d/lirc.conf /etc/tmpfiles.d/lirc.conf

5. Create a `~/.lircrc` or a `/etc/lirc/lircrc` file for system wide use.

6. Enable lirc.service and reboot or load the `lirc_serial` kernel module and start lirc.service.

## PS3 Bluetooth BD remote controller

1. Create a udev rule to symlink /dev/input/bdremote -> /dev/input/event*. Input devices like /dev/input/event12 might come up as another device after a reboot.

    /etc/udev/rules.d/95-bd-remote.rules

    # symlink to /dev/input/event*
    KERNEL=="event*",SUBSYSTEM=="input",ATTRS{name}=="BD Remote Control",SYMLINK+="input/bdremote"

2. Reload udev rules.

    # udevadm control --reload-rules

3.Edit lirc service parameters.

    /etc/conf.d/lircd.conf

    #
    # Parameters for lirc daemon
    #
    LIRC_DEVICE="/dev/input/bdremote"
    LIRC_DRIVER="devinput"
    LIRC_EXTRAOPTS=""

4.Create keymap config file.

    /etc/lirc/lircd.conf.d/ps3.bdremote.lircd.conf

    # Please make this file available to others
    # by sending it to <lirc@bartelmus.de>
    #
    # this config file was automatically generated
    # using lirc-0.8.4a(devinput) on Sun May  3 19:43:29 2009
    #
    # contributed by
    #
    # brand:                       PS3
    # model no. of remote control:
    # devices being controlled by this remote:
    #

    begin remote

      name  ps3
      bits           32
      eps            30
      aeps          100

      one             0     0
      zero            0     0
      gap          102974
      toggle_bit_mask 0x8001019C

          begin codes
              1                        0x80010002
              2                        0x80010003
              3                        0x80010004
              4                        0x80010005
              5                        0x80010006
              6                        0x80010007
              7                        0x00010008
              8                        0x80010009
              9                        0x8001000A
              0                        0x8001000B
              eject                    0x800100A1
              audio                    0x80010188
              angle                    0x80010173
              subtitle                 0x80010172
              clear                    0x80010163
              time                     0x80010167
              red                      0x0001018E
              green                    0x8001018F
              yellow                   0x80010190
              blue                     0x80010191
              display                  0x80010166
              top_menu                 0x8001008B
              popup                    0x800101B6
              return                   0x80010001
              options                  0x80010165
              back                     0x8001009E
              view                     0x80010177
              x                        0x80010100
              enter                    0x8001001C
              up                       0x80010067
              down                     0x8001006C
              left                     0x00010069
              right                    0x8001006A
              l1                       0x80010136
              l2                       0x80010138
              l3                       0x8001013D
              r1                       0x80010137
              r2                       0x80010139
              r3                       0x8001013E
              select                   0x80010161
              start                    0x8001013B
              ps                       0x800100AC
              rew                      0x800100A8
              play                     0x800100CF
              ffw                      0x8001009F
              prev                     0x0001019C
              stop                     0x80010080
              next                     0x80010197
              slow_rew                 0x800101B4
              pause                    0x80010077
              slow_ffw                 0x800101B5
          end codes

    end remote

5.Restart lirc service.

    # systemctl restart lirc

6. Testing the remote

    # irw

    000000008001009f 00 ffw ps3
    000000008001001c 00 enter ps3
    00000000800100a1 00 eject ps3
    0000000080010005 00 4 ps3
    0000000080010190 00 yellow ps3

## MCEUSB

Configuration file can be found here.

## Streamzap USB Remote

Configuration files for LIRC as well as mplayer, mythtv and kodi are available for this remote at graysky's github repo.

## X10

There is a dedicated wiki page with information about X10

Category:

- Other hardware