IR-CTL(1) | User Commands | IR-CTL(1) |
ir-ctl - a swiss-knife tool to handle raw IR and to set lirc options
ir-ctl [OPTION]...
ir-ctl [OPTION]... --features
ir-ctl [OPTION]... --send [file to send]
ir-ctl [OPTION]... --scancode [protocol and scancode
to send]
ir-ctl [OPTION]... --keycode [keycode to send]
ir-ctl [OPTION]... --receive [save to file]
ir-ctl is a tool that allows one to list the features of a lirc device, set its options, receive raw IR, and send IR.
IR can be sent as the keycode of a keymap, or using a scancode, or using raw IR.
Note: You need to have read or write permissions on the /dev/lirc device for options to work.
When sending or receiving raw IR, two formats can be used. The first is a list of integers representing pulse and space values. A pulse value can be prefixed with + and a space with -, but this is optional. The rc-5 scancode 0x1e01 is encoded so:
+889 -889 +1778 -1778 +889 -889 +889 -889 +889 -889 +1778 -889 +889 -889 +889 -889 +889 -889 +889 -889 +889 -1778 +889
The other format mimics the mode2 tool. This produces one line per space or pulse. For receiving it can selected by specifying --mode2. Here is the same message as above, now encoded in mode2:
carrier 36000
pulse 940
space 860
pulse 1790
space 1750
pulse 880
space 880
pulse 900
space 890
pulse 870
space 900
pulse 1750
space 900
pulse 890
space 910
pulse 840
space 920
pulse 870
space 920
pulse 840
space 920
pulse 870
space 1810
pulse 840
Note that in this format, the carrier can also be specified. This can only by done with a separate --carrier=38000 command line option with the first format.
Rather than specifying just the raw IR, in this format you can also specify the scancode and protocol you want to send. This will also automatically set the correct carrier. The above can be written as:
scancode rc5:0x1e01
If multiple scancodes are specified in a file, a gap is inserted between scancodes if there is no space between them (see --gap). One file can only have one carrier frequency, so this might cause problems if different protocols are specified in one file if they use different carrier frequencies.
Note that there are device-specific limits of how much IR can be sent at a time. This can be both the length of the IR and the number of different lengths of space and pulse.
A scancode with protocol can be specified on the command line or in the pulse and space file. The following protocols are supported: rc5, rc5x_20, rc5_sz, jvc, sony12, sony15, sony20, nec, necx, nec32, sanyo, rc6_0, rc6_6a_20, rc6_6a_24, rc6_6a_32, rc6_mce, sharp, imon, rc_mm_12, rc_mm_24, rc_mm_32. If the scancode starts with 0x it will be interpreted as a hexadecimal number, and if it starts with 0 it will be interpreted as an octal number.
Most IR receivers have a narrowband and wideband receiver. The narrowband receiver can receive over longer distances (usually around 10 metres without interference) and is limited to certain carrier frequencies.
The wideband receiver is for higher precision measurements and when the carrier frequency is unknown; however it only works over very short distances (about 5 centimetres). This is also known as learning mode.
For most drivers, enabling carrier reports using -m also enables the wideband receiver.
All the options which can be set for lirc devices are maintained until the device is powered down or a new option is set.
On success, it returns 0. Otherwise, it will return the error code.
To list all capabilities of /dev/lirc2:
ir-ctl -f -d /dev/lirc2
To show the IR of the first button press on a remote in learning
mode:
ir-ctl -r -m -w
Note that ir-ctl -rmw would receive to a file called mw.
To restore the normal (longer distance) receiver:
ir-ctl -n -M
To send the pulse and space file play on emitter 3:
ir-ctl -e 3 --send=play
To send the rc-5 hauppauge '1' scancode:
ir-ctl -S rc5:0x1e01
To send the rc-5 hauppauage '1' key from the hauppauge keymap:
ir-ctl -k hauppauge.toml -K KEY_NUMERIC_1
Report bugs to Linux Media Mailing List <linux-media@vger.kernel.org>
Copyright (c) 2016 by Sean Young.
License GPLv2: GNU GPL version 2
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
To display decoded IR, or set IR decoding options, see ir-keytable(1).
The keymap format is described in rc_keymap(5).
Tue Jul 5 2016 | v4l-utils 1.20.0 |