Difference between revisions of "LIRC Device Examples"

From ArchWiki
Jump to: navigation, search
(added summary)
(alphabetized)
Line 6: Line 6:
 
{{Article summary wiki|LIRC}} - Main LIRC article.
 
{{Article summary wiki|LIRC}} - Main LIRC article.
 
{{Article summary end}}
 
{{Article summary end}}
 
=== X10 ===
 
There is a dedicated wiki page with information about [[X10]]
 
  
 
===Asus DH Deluxe series motherboard===
 
===Asus DH Deluxe series motherboard===
Line 27: Line 24:
 
  $ /etc/rc.d/lircd restart
 
  $ /etc/rc.d/lircd restart
  
===Streamzap PC Remote (USB)===
+
=== Receivers that do not depend on a kernel module ===
This particular remote is known to not function with the {{Pkg|lirc-utils}} package included lirc.service.  [https://bugs.archlinux.org/task/37958 Flyspray #37958] has been created.  Until it is acted upon, users can create a custom service file that does work:
+
  
{{hc|/etc/systemd/system/my-lirc.service|[Unit]
+
Usually, you only need to specify your the device where the receiver is plugged in and the lirc driver. This is an example for pinnacle or miro serial receivers):
Description=LIRC Daemon
+
After=network.target
+
  
[Service]
+
  LIRC_DEVICE="/dev/ttySX"
Type=forking
+
  LIRC_DRIVER="pinsys"
PIDFile=/run/lirc/lircd.pid
+
ExecStartPre=/bin/mkdir -p /run/lirc
+
ExecStartPre=/bin/rm -f /dev/lircd
+
ExecStartPre=/bin/rm -f /run/lirc/lircd
+
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
+
ExecStart=/usr/bin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid
+
ExecStopPost=/bin/rm -f /dev/lircd
+
ExecStopPost=/bin/rm -fR /run/lirc
+
  
[Install]
+
Then, start lircd daemon and create the remote/s configuration (/etc/lirc/lircd.conf), either by copying one of the configured defaults that comes with lirc-utils or by using irrecord. Even if you find your remote in the list of preconfigured remotes it might not work so you will have to use irrecord anyway.
WantedBy=multi-user.target
+
}}
+
  
{{Note|When the batteries in this remote are low, it may stop working even though the red LED on the received still flashes when you hit buttons!}}
+
After this you can use irw to check the remote, create your ~/.lircrc to assign remote buttons to actions and start irexec if you need to run arbitrary commands.
  
 
=== Serial Port "Home Brew" IR Receiver ===
 
=== Serial Port "Home Brew" IR Receiver ===
Line 96: Line 80:
 
# systemctl start lirc.service}}
 
# systemctl start lirc.service}}
  
=== Receivers that do not depend on a kernel module ===
+
===Streamzap PC Remote (USB)===
 +
This particular remote is known to not function with the {{Pkg|lirc-utils}} package included lirc.service.  [https://bugs.archlinux.org/task/37958 Flyspray #37958] has been created.  Until it is acted upon, users can create a custom service file that does work:
  
Usually, you only need to specify your the device where the receiver is plugged in and the lirc driver. This is an example for pinnacle or miro serial receivers):
+
{{hc|/etc/systemd/system/my-lirc.service|[Unit]
 +
Description=LIRC Daemon
 +
After=network.target
  
  LIRC_DEVICE="/dev/ttySX"
+
[Service]
  LIRC_DRIVER="pinsys"
+
Type=forking
 +
PIDFile=/run/lirc/lircd.pid
 +
ExecStartPre=/bin/mkdir -p /run/lirc
 +
ExecStartPre=/bin/rm -f /dev/lircd
 +
ExecStartPre=/bin/rm -f /run/lirc/lircd
 +
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
 +
ExecStart=/usr/bin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid
 +
ExecStopPost=/bin/rm -f /dev/lircd
 +
ExecStopPost=/bin/rm -fR /run/lirc
  
Then, start lircd daemon and create the remote/s configuration (/etc/lirc/lircd.conf), either by copying one of the configured defaults that comes with lirc-utils or by using irrecord. Even if you find your remote in the list of preconfigured remotes it might not work so you will have to use irrecord anyway.
+
[Install]
 +
WantedBy=multi-user.target
 +
}}
  
After this you can use irw to check the remote, create your ~/.lircrc to assign remote buttons to actions and start irexec if you need to run arbitrary commands.
+
{{Note|When the batteries in this remote are low, it may stop working even though the red LED on the received still flashes when you hit buttons!}}
 +
 
 +
=== X10 ===
 +
There is a dedicated wiki page with information about [[X10]]

Revision as of 12:26, 8 December 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki - Main LIRC article. Template:Article summary end

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 you can see reply, device works fine, follow steps:

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

LIRC_DRIVER="dvico"

2. Reload LIRC:

/etc/rc.d/lircd restart

ASRock ION series (Nuvoton) quickstart

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

Receivers that do not depend on a kernel module

Usually, you only need to specify your the device where the receiver is plugged in and the lirc driver. This is an example for pinnacle or miro serial receivers):

 LIRC_DEVICE="/dev/ttySX"
 LIRC_DRIVER="pinsys"

Then, start lircd daemon and create the remote/s configuration (/etc/lirc/lircd.conf), either by copying one of the configured defaults that comes with lirc-utils or by using irrecord. Even if you find your remote in the list of preconfigured remotes it might not work so you will have to use irrecord anyway.

After this you can use irw to check the remote, create your ~/.lircrc to assign remote buttons to actions and start irexec if you need to run arbitrary commands.

Serial Port "Home Brew" IR Receiver

Here's how to get a "Home Brew" serial port IR receiver working:

1. Create a udev rule to give non-privleged users read/write access to the serial port. I will be using ttyS0 in my example.

/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 your 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 file in your home directory for your user or a /etc/lirc/lircrc file for system wide use.

6. Have your service start at boot and then test with a reboot

# systemctl enable lirc.service
# systemctl reboot

or load the module and start the lirc.service.

# modprobe lirc_serial
# systemctl start lirc.service

Streamzap PC Remote (USB)

This particular remote is known to not function with the lirc-utils package included lirc.service. Flyspray #37958 has been created. Until it is acted upon, users can create a custom service file that does work:

/etc/systemd/system/my-lirc.service
[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
ExecStart=/usr/bin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc

[Install]
WantedBy=multi-user.target
Note: When the batteries in this remote are low, it may stop working even though the red LED on the received still flashes when you hit buttons!

X10

There is a dedicated wiki page with information about X10