|
|
![[Home]](/wiki.gif)
| Edit text of this pageView other revisions | ||
| | | |
CIR TRANSMITTER HARDWARE AND DRIVER
The Agenda Vr3 (AgVr3) is equipped with a CIR port to send infrared commands to consumer IR devices such as HI-FI sets, TV boxes, etc. This makes the AgVr3 unique with respect to other PDA's. Lacking a specialized CIR port, these other PDA's have to relay on using the IrDA interface, therebay failing to achieve useful ranges (tipically less than 2 m, in contrast with the 10 m that can be achieved with the Agenda).
The AgVr3 CIR device is just a IR diode driven by a 1-bit gpio signal (GPIO-6). The driver for this port is lirc_vrgpio. Version 8.1 (and higher) of the AgVr3 kernel includes an improved lirc_vrgpio module, based on the lirc_serial driver of lirc-0.6.6 (see http://www.lirc.org/). It implements all the enhanced timing methods of lirc-0.6.6, specifically tuned for the Agenda Vr3. This leads to a noticeable improvement of CIR signal fidelity (see LircVr3Performance).
Apart from this CIR port, the AgVr3 has also a conventional infrared IrDA interface, (mainly) aimed at short-range networking and data communication. This document is mainly devoted to CIR operation.
CIR RANGE
CIR signals produced by the AgVr3 have a range of at least several metres. The exact range depends on many factors, including the receiving equipment and the the fidelity of the IR signals.
As a first step when setting up a CIR environment it may be interesting to "see" whether the AgVr3 actually produces IR signals and how far they arrive. To this end you can try to use some IR receiving appliance which happens to have visual feedback for received IR commands. Note that some appliances only flash their IR feedback led when they detect IR commands they can "understand" (so, such appliances are not recommended for this purpose). A much better idea is to install a complete [LIRC] setup in your host PC and use LIRC receive debuging tools such as mode2 or xmode2.
The "standard" range of the AgVr3 CIR can be significantly extended through a very simple hardware patch described below. Applying this mod and using the lirc_vrgpio driver of kernel 8.1 (or later), you can achieve a (fine aiming) range of about 10 meters -- or about 5 meters with casual aiming.
SIMPLE AND USEFUL HARDWARE MODS
Given the small scale of the AgVr3, to do these mods you need a very tiny solder iron and a magnifying lens.
Boosting CIR power. A small 15 Ohm resistor is needed. Locate the 47 ohm resistor which is right on the leg of the AgVr3 IR diode and solder in the 15 Ohm resistor in parallel. This way you get an effective resistor value of about 10 Ohm, which is still safe. Note that this simple modification does not significantly increase the AgVr3 power consumption.
Tilt/movement suitch for auto-power-on. When the AgVr3 is used as a remote, it is quite convenient that it is allways ready; i.e., that you don't need to press the power button to awake it. This can be easyly accomplished by using a tilt-movement switch, connected in parallel with the AgVr3 stylus switch. I used C-7231 from [CEBEK] (follow the links "catalogue" -> "catalogue" -> "sensors" -> type: INCLINATION -> C-7231). It is made from no toxic materials (does not contain mercury). See other tilt switches at http://scmstore.com/english/sensor/highQuality/Tilt/index.htm. There is plenty of room available to place the C-7231 (and many other similar switches) in the AgVr3 motherboard area close to the up/down switches and to the CIR led. Most tilt switches have a metalic casing; so beware to adequately isolate the whole switch to avoid unwished contacts with other components in the motherboard!!!
Once installed, just start the "Power" application and set the "Stylus Replacement" acction to "Do Nothing", and (important!) remove the stylus (or remove the stylus switch if you want to keep the stylus). You may also want to reduce the auto-power-off time to a few seconds. The "Power" application does not allow times smaller than 1 min, but you can do it by hand (as root):
echo 10 > /etc/apm-sleep.conf ; /etc/rc.d/init.d/apm-sleep restart
Now, the AgVr3 it will be automatically awakened every time you take or move it and you can directly use it to send IR commands. It will automatically go to sleep after it is left quiet for a few seconds.
RECEIVING CIR COMMANDS
The AgVr3 has no CIR hardware to support receiving. However, the [LIRC] project provides drivers for using the IrDA as a CIR receiver (and transmitter). Some work has been done to patch the Agenda IrDA driver so as to support CIR operation. However, no operational driver exists so far (Feb-2003). Look at [this site] for a first step towards such a [kernel patch]
Because of explicit design restrictions of the IrDA hardware, only short ranges (about 30cm) could be expected by using IrDA to send CIR commands, which is mostly useless. However, although similarly short ranges can also be expected for IrDA reception, such a receiver would clearly be useful for some applications, such as e.g., learning the IR codes of arbitrary IR remotes (using e.g., irrecord -- see below).
SOFTWARE FOR IR REMOTE CONTROL
Most of the CIR [software] comes from the [LIRC] project. Given the above discussed CIR receiving limitations, it is a good idea to have a host PC with a LIRC setup. This makes things a lot simpler and, most importantly, this allows using irrecord to learn signals of arbitrary remotes. Without this, only the IR signals available from the LIRC [''remotes repository''] can be used.
Basic AgVr3 LIRC programs
Apart from the lirc_vrgpio driver mentioned above, only two LIRC userland programs are relevant for the AgVr3:
You can find info about these (and many other) programs in the doc directory of the LIRC package and/or at the LIRC site. In particular, the corresponding man pages are: http://www.lirc.org/html/lircd.html, http://www.lirc.org/html/rc.html.
As previously mentioned, the LIRC project also provides the irrecord program to learn the signals and codes of (almost) any remote. However, it does not (currently) work on the AgVr3 --you have to run it in your computer, provided it has some IR input device. See http://www.lirc.org/html/irrecord.html, http://www.lirc.org/receivers.html.
The "lircd" daemon and its config file
This is the LIRC CIR coding/decoding daemon. It can/must be started by root. Typically it is automatically started by its standard init script /etc/rc.d/init.d/lircd. This daemon needs a config file, typically located at /etc/lircd.conf, which contain descriptions of the IR signals and codes it will be allowed to handle. As previously mentioned, you can find IR signal descriptions for many commercial remotes at the LIRC [''remotes repository''], or you can make your own using irrecord on a lirc-enabled desktop or laptop PC. The lirc daemon communicates with the kernel driver through /dev/lirc and with its clients through /dev/lircd. For normal operation, these device sockets need permissions such as:
crw-rw-rw- 1 root root 61, 0 Mar 21 2002 lirc srwxr-xr-x 1 root root 0 Jan 9 13:58 lircd
In case you get wrong permissions, you can fix them by just adding to the /etc/rc.d/init.d/lircd init file a line such as:
chmod 666 /dev/lircd # after /sbin/lircd is started
The basic commandline client "rc"
This is the simplest lircd transmitting client. You can use it directly as a shell command and/or within a shellscript. Its basic syntax is:
rc SEND_ONCE <remote> <code> [ <code> ... ]
where <remote> is the name of a IR remote and <code> is the name of a remote control key of <remote>, as they appear in the lircd config file /etc/lircd.conf.
Here are a couple of examples of rc invocation:
rc SEND_ONCE DenonTuner PROG-SCAN rc SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP
Using just rc, it is very easy to write simple bash shellscripts to perform quite sophisticated IR control procedures.
Infrared control GUI
A flexible, very powerful, highly configurable GUI lircd client for the AgVr3 is the program BTP (Buttons To Press), available from [ASR] (See also its [original site]).
It features arbitrary layout geometry specification, multiple layouts or "views", arbitrarily complex definitions of IR macros -- including configurable delays, hardware button configuration of all the AgVr3 buttons, acoustic feedback and many other extras.
| Search agendawiki.com! |