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