1IR-CTL(1) User Commands IR-CTL(1)
2
3
4
6 ir-ctl - a swiss-knife tool to handle raw IR and to set lirc options
7
9 ir-ctl [OPTION]...
10 ir-ctl [OPTION]... --features
11 ir-ctl [OPTION]... --send [file to send]
12 ir-ctl [OPTION]... --scancode [protocol and scancode to send]
13 ir-ctl [OPTION]... --keycode [keycode to send]
14 ir-ctl [OPTION]... --receive [save to file]
15
17 ir-ctl is a tool that allows one to list the features of a lirc device,
18 set its options, receive raw IR, and send IR.
19
20 IR can be sent as the keycode of a keymap, or using a scancode, or
21 using raw IR.
22
23 Note: You need to have read or write permissions on the /dev/lirc
24 device for options to work.
25
27 -d, --device=DEV
28 lirc device to control, /dev/lirc0 by default
29
30 -f, --features
31 List the features of the lirc device.
32
33 -r, --receive[=FILE]
34 Receive IR and print to standard output if no file is specified,
35 else save to the filename.
36
37 -s, --send=FILE
38 Send IR in text file. It must be in the format described below.
39 If this option is specified multiple times, send all files
40 in-order with a 125ms gap between them. The gap length can be
41 modified with --gap.
42
43 -S, --scancode=PROTOCOL:SCANCODE
44 Send the IR scancode in the protocol specified. The protocol
45 must one of the protocols listed below, followed by a colon and
46 the scancode number. If this option is specified multiple times,
47 send all scancodes in-order with a 125ms gap between them. The
48 gap length can be modified with --gap.
49
50 -K, --keycode=KEYCODE
51 Send the KEYCODE from the keymap which must be specified with
52 --keymap. If this option is specified multiple times, send all
53 keycodes in-order with a 125ms gap between them. The gap length
54 can be modified with --gap.
55
56 -k, --keymap=KEYMAP
57 The rc keymap file in toml format. The format is described in
58 the rc_keymap(5) man page. This file is used to select the KEY‐
59 CODE from.
60
61 -1, --oneshot
62 When receiving, stop receiving after the first message, i.e.
63 after a space or timeout of more than 19ms is received.
64
65 --mode2
66 When receiving, output IR in mode2 format. One line per space or
67 pulse.
68
69 -w, --wideband
70 Use the wideband receiver if available on the hardware. This is
71 also known as learning mode. The measurements should be more
72 precise and any carrier frequency should be accepted.
73
74 -n, --narrowband
75 Switches back to the normal, narrowband receiver if the wideband
76 receiver was enabled.
77
78 -R, --carrier-range=RANGE
79 Set the accepted carrier range for the narrowband receiver. It
80 should be specified in the form 30000-50000.
81
82 -m, --measure-carrier
83 If the hardware supports it, report what the carrier frequency
84 is on receiving. You will get the keyword carrier followed by
85 the frequency. This might use the wideband receiver although
86 this is hardware specific.
87
88 -M, --no-measure-carrier
89 Disable reporting of the carrier frequency. This should make it
90 possible to use the narrowband receiver. This is the default.
91
92 -t, --timeout=TIMEOUT
93 Set the length of a space at which the receiver goes idle, spec‐
94 ified in microseconds.
95
96 -c, --carrier=CARRIER
97 Sets the send carrier frequency.
98
99 -D, --duty-cycle=DUTY
100 Set the duty cycle for sending in percent if the hardware sup‐
101 port it.
102
103 -e, --emitters=EMITTERS
104 Comma separated list of emitters to use for sending. The first
105 emitter is number 1. Some devices only support enabling one
106 emitter (the winbond-cir driver).
107
108 -g, --gap=GAP
109 Set the gap between scancodes or the gap between files when mul‐
110 tiple files are specified on the command line. The default is
111 125000 microseconds.
112
113 -?, --help
114 Prints the help message
115
116 --usage
117 Give a short usage message
118
119 -v, --verbose
120 Verbose output; this prints the IR before sending.
121
122 -V, --version
123 print the v4l2-utils version
124
125 Format of file
126 When sending or receiving raw IR, two formats can be used. The first is
127 a list of integers representing pulse and space values. A pulse value
128 can be prefixed with + and a space with -, but this is optional. The
129 rc-5 scancode 0x1e01 is encoded so:
130
131 +889 -889 +1778 -1778 +889 -889 +889 -889 +889 -889 +1778 -889 +889
132 -889 +889 -889 +889 -889 +889 -889 +889 -1778 +889
133
134 The other format mimics the mode2 tool. This produces one line per
135 space or pulse. For receiving it can selected by specifying --mode2.
136 Here is the same message as above, now encoded in mode2:
137
138 carrier 36000
139 pulse 940
140 space 860
141 pulse 1790
142 space 1750
143 pulse 880
144 space 880
145 pulse 900
146 space 890
147 pulse 870
148 space 900
149 pulse 1750
150 space 900
151 pulse 890
152 space 910
153 pulse 840
154 space 920
155 pulse 870
156 space 920
157 pulse 840
158 space 920
159 pulse 870
160 space 1810
161 pulse 840
162
163 Note that in this format, the carrier can also be specified. This can
164 only by done with a separate --carrier=38000 command line option with
165 the first format.
166
167 Rather than specifying just the raw IR, in this format you can also
168 specify the scancode and protocol you want to send. This will also
169 automatically set the correct carrier. The above can be written as:
170
171 scancode rc5:0x1e01
172
173 If multiple scancodes are specified in a file, a gap is inserted
174 between scancodes if there is no space between them (see --gap). One
175 file can only have one carrier frequency, so this might cause problems
176 if different protocols are specified in one file if they use different
177 carrier frequencies.
178
179 Note that there are device-specific limits of how much IR can be sent
180 at a time. This can be both the length of the IR and the number of dif‐
181 ferent lengths of space and pulse.
182
183 Supported Protocols
184 A scancode with protocol can be specified on the command line or in the
185 pulse and space file. The following protocols are supported: rc5,
186 rc5x_20, rc5_sz, jvc, sony12, sony15, sony20, nec, necx, nec32, sanyo,
187 rc6_0, rc6_6a_20, rc6_6a_24, rc6_6a_32, rc6_mce, sharp, imon, rc_mm_12,
188 rc_mm_24, rc_mm_32. If the scancode starts with 0x it will be inter‐
189 preted as a hexadecimal number, and if it starts with 0 it will be
190 interpreted as an octal number.
191
192 Wideband and narrowband receiver
193 Most IR receivers have a narrowband and wideband receiver. The narrow‐
194 band receiver can receive over longer distances (usually around 10
195 metres without interference) and is limited to certain carrier frequen‐
196 cies.
197
198 The wideband receiver is for higher precision measurements and when the
199 carrier frequency is unknown; however it only works over very short
200 distances (about 5 centimetres). This is also known as learning mode.
201
202 For most drivers, enabling carrier reports using -m also enables the
203 wideband receiver.
204
205 Global state
206 All the options which can be set for lirc devices are maintained until
207 the device is powered down or a new option is set.
208
210 On success, it returns 0. Otherwise, it will return the error code.
211
213 To list all capabilities of /dev/lirc2:
214 ir-ctl -f -d /dev/lirc2
215
216 To show the IR of the first button press on a remote in learning mode:
217 ir-ctl -r -m -w
218
219 Note that ir-ctl -rmw would receive to a file called mw.
220
221 To restore the normal (longer distance) receiver:
222 ir-ctl -n -M
223
224 To send the pulse and space file play on emitter 3:
225 ir-ctl -e 3 --send=play
226
227 To send the rc-5 hauppauge '1' scancode:
228 ir-ctl -S rc5:0x1e01
229
230 To send the rc-5 hauppauage '1' key from the hauppauge keymap:
231 ir-ctl -k hauppauge.toml -K KEY_NUMERIC_1
232
234 Report bugs to Linux Media Mailing List <linux-media@vger.kernel.org>
235
237 Copyright (c) 2016 by Sean Young.
238
239 License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
240 This is free software: you are free to change and redistribute it.
241 There is NO WARRANTY, to the extent permitted by law.
242
244 To display decoded IR, or set IR decoding options, see ir-keytable(1).
245
246 The keymap format is described in rc_keymap(5).
247
248
249
250v4l-utils 1.18.0 Tue Jul 5 2016 IR-CTL(1)