1LIRCD(8)                System Administration Utilities               LIRCD(8)
2
3
4

NAME

6       lircd - Decode infrared signals and provide them on a socket.
7

SYNOPSIS

9       lircd [options] [config file]
10

DESCRIPTION

12       The main task of lircd is to decode the infrared signals and provide an
13       uniform interface for client applications. Clients can connect to lircd
14       through  a  Unix  domain socket, by default /var/run/lirc/lircd.  Using
15       this socket they will get the infrared codes received by lircd and they
16       can send commands to lircd.
17

ARGUMENTS

19       config file
20           The configuration file, by default /etc/lirc/lircd.conf. A relative
21           path is interpreted from /etc/lirc. The default configuration  file
22           includes all files in /etc/lircd.conf.d.
23
24           Each  remote which should be decoded by lircd usually requires that
25           a   specific   file   is   used   e.   g.,   by   copying   it   to
26           /etc/lirc/lirc.conf.d/.   The format is described in lircd.conf(5).
27           Configuration files could be found using irdb-get(1)  or  lirc-set‐
28           up(1).   It's  also  possible  to  generate  a  config  file  using
29           irrecord(1)
30
31

OPTIONS

33       Common options:
34
35       -d, --device <device>
36           Select the character device  which  lircd  should  read  from.  The
37           default is currently /dev/lirc0 on most systems.
38
39           Some  drivers,  including the default devinput driver, supports the
40           auto device which picks the  first  usable  device  found  for  the
41           actual driver.
42
43           When  using  the  devinput driver name=STRING or phys=STRING can be
44           used to select the device; lircd will look in /dev/input to find  a
45           device  with  a  matching  description.  This is useful in case the
46           device name isn't fixed. STRING may contain the '*' and  '?'  wild‐
47           cards and '\' to mark them as literal.  Use mode2 --driver devinput
48           --list-devices to list the actual devices.
49
50       -H, --driver <driver>
51           The driver to use.  Using --driver help lists all  available  driv‐
52           ers, see DRIVER LOADING below.
53
54       -h, --help
55           Displays short help message.
56
57       Other options:
58
59       -a, --allow-simulate
60           Enable  the SIMULATE command which can be issued using irsend(1) or
61           the client API. This will allow simulating arbitrary IR events from
62           the command line. Use this option with caution because it will give
63           all users with access to the lircd socket  wide  control  over  the
64           system.  E.g., if you have configured your system to shut down by a
65           button press on your remote control, everybody will be able to shut
66           down your system from the command line.
67
68       -c, --connect [host[:port]][,[host[:port]]]
69           Connects  to  other  lircd servers that provide a network socket at
70           the given host and port number (see --listen). The number  of  such
71           connections  is  currently  limited  to  100.  The connecting lircd
72           instance will receive IR events from the lircd instance it connects
73           to.  To  connect to multiple servers, add them as a comma separated
74           list.
75
76       -e, --effective-user <uid>
77           If started as user root, lircd drops it privileges and runs as user
78           <uid> after opening files etc.
79
80       -i, --immediate-init
81           Lircd  normally  initializes  the driver when the first client con‐
82           nects. If this option is selected, the driver is  instead  initial‐
83           ized immediately at start.
84
85       -A, --driver-options key:value[|key:value...]
86           Set  one  or more options for the driver. The argument is a list of
87           key:value pairs delimited by '|'. The key can not  contain  spaces,
88           but  such are allowed in the value part. Certain characters includ‐
89           ing '#' and ';' are used as comment markers in the config file  and
90           are not allowed anywhere.
91
92       -Y, --dynamic-codes  [EXPERIMENTAL]
93           Allows  use of codes which have been decoded for one remote but are
94           not defined in lircd.conf.  New codes are dynamically created  with
95           a  default  name.  This  feature is experimental and subject to all
96           sorts of changes. It has not ben tested thoroughly.
97
98       -l, --listen [[address:]port]]
99           Let lircd listen for network connections on the given address/port.
100           The default address is 0.0.0.0, which means that connections on all
101           network interfaces will be accepted.  The address must be given  in
102           dotted  numerical  form.   Port  defaults  to  8765.  The listening
103           lircd instance will send all IR  events  to  the  connecting  lircd
104           instances without any security checks.
105
106           On  non-glibc platforms the address:port argument is mandatory, but
107           can be given as an empty string e. g. --listen= which then defaults
108           to 0.0.0.0:8765.
109
110       -L, --logfile <logfile path>
111           Select  the  lircd  daemon  log  file. logfile is either the string
112           'syslog' indicating that syslog(1) should be used  or  a  log  file
113           path. The default is to use syslog.
114
115       -D, --loglevel [level]
116           Determine  the  amount  of logging information. level can be a sym‐
117           bolic syslog level: 'error','warning, 'info', 'notice' or  'debug'.
118           lircd  also  defines  three additional levels 'trace', 'trace1' and
119           'trace2' which gives even  more  messages  ('trace2'  bringing  the
120           most).  However, in the log these messages are marked as 'debug'.
121
122           On  non-glibc platforms the level argument is mandatory, but can be
123           given as an empty string e. g. --loglevel= which then  defaults  to
124           debug.
125
126           The  level  can  also  be an integer in the range 3 (almost no mes‐
127           sages) to 10.
128
129       -O, --options-file <path>
130           File containing default values for all options. A relative path  is
131           interpreted from current directory. See [FILES] below.
132
133       -o, --output <output socket>
134           Select  Unix domain socket, which lircd will write remote key codes
135           to.  The default currently is /var/run/lirc/lircd.
136
137       -p, --permission <perm>
138           Gives the file permission of the output socket if it has to be cre‐
139           ated  in  octal  representation.  See chmod(1).  If no --permission
140           option is given when the socket is initially created the default is
141           to  give all users read and write permissions (0666 in octal repre‐
142           sentation). If the socket already exists this option has no effect.
143
144       -p, --pidfile <path>
145           Select    the    lircd    daemon    pid    file,    defaults     to
146           /var/run/lirc/lircd.pid.
147
148       -U --plugindir <path>
149           Sets  the  directory from which lircd loads it's userspace drivers.
150           These are *.so files, by default found as  described  under  DRIVER
151           LOADING. The argument is a :-separated search path.
152
153       -r, --release [suffix]
154           This  option  is  deprecated  and  will  be  removed in an upcoming
155           release. See lircd-uinput(8) for a replacement.
156
157           Enables automatic generation of  release  events  for  each  button
158           press.   lircd  will append the given suffix to the button name for
159           each release event. If no suffix is given  the  default  suffix  is
160           '_EVUP'.
161
162           Note  the  suffix  _UP, which was used by lircd prior to 0.10.0, is
163           used by the linux kernel for other purposes since 4.7.
164
165       -R, --repeat-max <limit>
166           Sets an upper limit to the number of repeats when sending a signal.
167           The  current  default  is 600. A SEND_START request will repeat the
168           signal this many times.  Also,  if  the  number  of  repeats  in  a
169           SEND_ONCE  request exceeds this number, it will be replaced by this
170           number.
171
172

SOCKET BROADCAST MESSAGES FORMAT

174       When decoding a button press or receiving a  SIGHUP  signal  lircd.conf
175       lircd broadcasts messages to all connected clients.
176
177       For  each  decoded  button  press  a  package  is made available on the
178       socket. This is printable data formatted as:
179               <code> <repeat count> <button name> <remote control name>
180
181       e.g.,
182               0000000000f40bf0 00 KEY_UP ANIMAX
183
184
185
186       The fields are:
187
188
189       code
190           A 16 hexadecimal digits number encoding of  the  IR  signal.   It's
191           usage in applications is deprecated and it should be ignored.
192
193       repeat count
194           shows how long the user has been holding down a button. The counter
195           will start at 0 and increment each time a new IR  signal  has  been
196           received.
197
198       button name
199           is the name of a key defined in the lircd.conf file.
200
201       remote control name
202           is the mandatory name attribute in the lircd.conf config file.
203
204       These  packets are broadcasted to all clients. The only other situation
205       when lircd broadcasts to all clients is when  it  receives  the  SIGHUP
206       signal  and  successfully re-reads its config file. Then it will send a
207       SIGHUP packet to its clients indicating that  its  configuration  might
208       have changed.  The sighup packet is three lines
209
210               BEGIN
211               SIGHUP
212               END
213

SOCKET COMMAND INTERFACE

215       Applications can also send commands to lircd over the socket interface.
216       The most common task is sending data, but there  are  also  other  com‐
217       mands.  Each command is a single printable line, terminated with a new‐
218       line. For each command, lircd replies with a reply package.
219
220       Supported commands:
221
222       SEND_ONCE <remote control> <button name> [repeats]
223           Tell lircd to send the IR signal associated with the  given  remote
224           control and button name, and then repeat it repeats times.  repeats
225           is a decimal number between 0 and repeat_max.  The  latter  can  be
226           given  as  a  --repeat-max  command  line  argument  to  lircd, and
227           defaults to 600.  If repeats is not specified or is less  than  the
228           minimum number of repeats for the selected remote control, the min‐
229           imum value will be used.
230
231       SEND_START <remote control name> <button name>
232           Tell lircd to start repeating the given button until it receives  a
233           SEND_STOP  command.   However,  the number of repeats is limited to
234           repeat_max. lircd won't accept any new send commands  while  it  is
235           repeating.
236
237       SEND_STOP <remote control name> <button name>
238           Tell lircd to abort a SEND_START command.
239
240       LIST [remote control]
241           Without  arguments  lircd replies with a list of all defined remote
242           controls.  Given a remote control argument, lircd  replies  with  a
243           list of all keys defined in the given remote.
244
245       SET_INPUTLOG [path]
246           Given  a  path,  lircd will start logging all received data on that
247           file.  The log is printable lines as defined in mode2(1) describing
248           pulse/space  durations.   Without a path, current logfile is closed
249           and the logging is stopped.
250
251       DRV_OPTION key value
252           Make lircd invoke the drvctl_func(DRVCTL_SET_OPTION,  option)  with
253           option being made up by the parsed key and value.  The return pack‐
254           age reflects the outcome of the drvctl_func call.
255
256       SIMULATE key data
257           Given key data, instructs lircd to send this to all clients i.  e.,
258           to  simulate  that this key has been decoded.  The key data must be
259           formatted exactly as the packet described in [SOCKET BROADCAST MES‐
260           SAGES  FORMAT],  notably is the number of digits in code and repeat
261           count hardcoded.  This command is only accepted if the --allow-sim‐
262           ulate command line option is active.
263
264       SET_TRANSMITTERS transmitter mask
265           Make lircd invoke the drvctl_func(LIRC_SET_TRANSMITTER_MASK, &chan‐
266           nels), where channels is the decoded value of transmitter mask. See
267           lirc(4) for more information.
268
269       VERSION
270           Tell lircd to send a version packet response.
271
272       The  protocol guarantees that broadcasted messages won't interfere with
273       reply packets. But broadcasts may appear at any point between  packets.
274       The only exception are SIGHUP packages. These may appear just after you
275       have sent a command to lircd, so you have to make sure you  don't  con‐
276       fuse them with replies.
277
278       The format of the reply packet is
279
280         BEGIN
281         <command>
282         [SUCCESS|ERROR]
283         [DATA
284         n
285         n lines of data]
286         END
287
288       If  the command was successful, data is only sent for the commands that
289       return some information. Note that a packet containing 0 lines of  data
290       can be a valid reply.
291
292

RUNNING AS REGULAR USER

294       Traditionally  lircd  has  been  running as root since accessing kernel
295       devices like /dev/lirc0 by default requires root privileges.   However,
296       running a long-running service like this is a major security issue.
297
298       The   lirc   distribution  contains  example  udev  rules  which  makes
299       /dev/lirc[0-9] , USB and serial devices accessible by  the  lirc  user.
300       Using  these  rules,  it is possible to run lircd as a regular user and
301       group such as lirc.
302
303

FILES

305       /etc/lirc/lircd.conf
306           Main config file, see lircd.conf(5).
307
308
309       /etc/lirc/lirc_options.conf
310           The options file. lircd handles the values under the  [lircd]  sec‐
311           tion   in  this  file.  The  location  can  be  changed  using  the
312           -O/--options-file command-line  option  or  using  the  environment
313           variable  LIRC_OPTIONS_PATH.   The values here are used as defaults
314           for any option not present on command line.
315
316

ENVIRONMENT

318       LIRC_OPTIONS_PATH
319           Options file path, see FILES.
320
321       LIRC_PLUGINDIR
322           Plugin load path, se DRIVER LOADING.
323
324       LIRC_DEBUG_OPTIONS
325           If set, enables debugging in early stages when the  --debug  option
326           is yet not parsed.
327
328

DRIVER LOADING

330       Drivers  are  loaded  dynamically.  This is done from a traditional *ux
331       ´:´-separated path where each component in the path is searched  (lead‐
332       ing part first, trailing last).
333
334       The path used for this is determined by (falling priority):
335
336       - The --plugindir option.
337
338       - The    'plugindir'   entry   in    the   [lircd]   section   of   the
339         lirc_options.conf file.
340
341       - The environment variable LIRC_PLUGINDIR.
342
343       - A hardcoded default (/usr/lib64/lirc/plugins).
344
345

SIGNALS

347       HUP On receiving SIGHUP lircd  re-reads  the  lircd.conf  configuration
348           file (but not lirc_options.conf) and adjusts itself if the file has
349           changed.
350
351       USR1
352           On receiving SIGUSR1 lircd makes a clean exit.
353
354

DAEMONS

356       lircd  is a daemon.  It should be started in some system-dependent init
357       script.   By  default,  lirc  ships with systemd files enabling user to
358       control the lircd service.
359

SEE ALSO

361       irdb-get(1)
362       lirc-setup(1)
363       lircd.conf(5)
364       irrecord(1)
365       lirc(4)
366       lircd-uinput(8)
367
368
369
370lircd 0.10.0                 Last change: Jun 2017                    LIRCD(8)
Impressum