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