Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Ready: IR Controller with remote power on



Hi list,

first of all: thanks to everyone involved in developing and improving
the VDR project. I've started with VDR a couple of months ago (my first
Linux contact, I have to admit) and I am very impressed with the result
and the incredible amount of time and effort the people of the VDR
community spend for this project -- and all this for free! It's also
remarkable that there is nothing on the market coming even close to the
VDR with all its features and its flexibility.

I hope that I can give something back to you now. After I got the VDR
with the AIO running, I felt that this VDR definitely deserves some
hardware improvements. So, on a rainy weekend I started with an IR
remote controller. The main purpose for developing this controller
was, of course, the missing possibility of turning on the VDR by the
IR remote. The first prototype was ready quite fast, but as we had
a lot more rainy weekends recently I had some time to add extra
features ;-)

The IR controller consists of an IR receiver chip, a PIC16F628 micro,
and a few standard components. I chose the Philips RC5 code as this is
widely used, very reliable (bi-phase coding), and has a toggle bit.
Please note that the IR Controller does not replace LIRC, but works as
an add-on.

Here is a description of the main features:

IR remote power key to turn VDR on/off
--------------------------------------
If the ATX power supply is in standby, VDR can be turned on by pressing
the remotes' power key for at least one second. If VDR is running,
pressing the remotes' power key invokes the shutdown script as usual.

PC power switch to turn VDR on/off
----------------------------------
The PC power and reset switches on the PC front panel could be
pressed unintentionally, causing an unwanted hard reset. The IR
Controller solves this problem as follows (provided that the hardware
changes described below have been applied): If VDR is in standby,
pressing the power switch will simply turn on VDR. If VDR is running,
pressing this switch will cause the IR Controller to send a software
generated RC5 code directly to LIRC via the RS232 interface. This way,
the usual VDR shutdown script can by initiated. If necessary, pressing
and holding the power switch for at least 5 seconds will cause the IR
Controller to reset the PC immediately via the reset input of the
motherboard. Therefore, the reset switch becomes redundant.

RS232 level within specifications
---------------------------------
All of the home brew LIRC receivers use only a single 5 volts supply.
However, the RS232 specs require signals of +/- 5 to +/- 15 volts. The
range from -3 to +3 volts is undefined. Additionally, the IR receiver
chips do not pull their output fully down to 0, but only to about
1 volt. This makes it even worse, but still most of the RS232 interfaces
will tolerate this. But there are also many people wondering that their
LIRC receiver isn't working. The IR Controller level shifts the incoming
signals as well as the PIC generated codes to +/- 5 volts which is
within the specs.

Learning mode
-------------
You can enter a learning mode to teach the IR Controller which key of
the remote transmitter should be used for turning on/off VDR. All other
keys are still defined in LIRC. Also, a boot delay time can be entered
(this is for the status LED, see below).

Emergency reboot ;-)
--------------------
Well, sometimes VDR or DVD player crash ...
If you press the 0-key for at least 5 seconds, the IR Controller will
send a special RC5 code to LIRC. Suitable entries in lircd.conf and
lircrc can now call a reboot script via irexec. I have used the IR
Controller for several weeks now. Whatever happened to VDR: the LIRC
demon was always alive, so a convenient remote reboot was possible.

Bicolor status LED
------------------
A bicolor LED (red/green) turns on or flashes as follows:

VDR standby     red
VDR booting     flashing green (while no remote commands are accepted)
VDR running     green
VDR shutdown    flashing red (while no remote commands are accepted)

Additionally, there are some special LED signals related to the learning
mode. Also, each time a valid RC5 code has been received, the LED turns
off for 50ms. As the RC5 code repetition rate is 114ms, it will actually
flash 9 times per second. The RC5 decoding is very reliable, so no codes
from other keys or other IR transmitters can start VDR.

ICSP-Interface
--------------
The PIC micro can be programmed via this interface (Microchip's ICSP =
In Circuit Serial Programming). This even works while VDR is running.
There should be some simple DIY serial programmers on the net, but I
have not yet looked for any.


Of course, some connections to the PC hardware are required. Just in
brief so that you are warned ;-)

- The power and reset switches must be unplugged from the motherboard.
  The connector at the end of the power switch cable must be plugged
  onto the IR Controller. The (now unconnected) power and reset pin
  headers on the motherboard must be connected by two wires with the
  IR Controller.
- A 10-wire ribbon cable with 10-pin connectors on either side is
  used to connect the motherboard's RS232 (usually a 10-pin header for
  COM2 is available on the MB) with the IR Controller. Only two wires
  are actually used, data and ground.
- The +5 volts standby (brown) and -5 volts (white) of the cable bundle
  coming from the ATX power supply must be tapped using tap splices and
  connected to the IR Controller.

If anyone is interested, I will upload the schematic, the layout, the
PIC assembler source code, and the hex code. The schematic and the
layout were made with EAGLE (of course). So far the layout is in SMT
only, but routing a layout for thru-hole components should be quite
easy. You can have a look at some info right now, it's here:
http://www.tb-electronic.de/vdr/ir_controller.html

If the rain continues (well, actually even then I don't have that much
time left ...) one could think of the following:

- Making the communication to the PIC micro bidirectional via RS232
- Using a PIC with some more I/O pins
- Adding an RTC, an LCD-Interface, and some spare I/O lines
- Adding some software in VDR (plugin-version ...)

Then this PIC module could handle the IR power on/off and the other
stuff as described above, could receive all timer information from VDR,
display this info on the LCD (without LCDproc) even if VDR is standby,
turn on and off VDR depending on the timer settings (without using
nvram-wakeup), some keys could also be added, as well as one or more
record LEDs, and so on ...


In this context I would also like to ask Klaus to add a full LIRC
support to VDR (i.e. with the possibility of defining entries in
lircrc). For example, I had a problem with the reaction to the Power
key command: If sent by an RC5 remote transmitter (about 9 times per
second), holding this key a bit too long starts and immediately aborts
the shutdown. I solved this in my IR Controller now. Another example:
The URC-7040 has a 'Record' key (which has to be pressed two times to
prevent unintentional recording). It would be great if this key could be
defined for instant recording in VDR.

How is Andreas' DVD player integrated into VDR? It uses the same keys as
VDR, but could it also be made controllable by LIRC defined keys exactly
as done with MPlayer? I just ask because I solved the problem with the
different remote 'layers' by using a universal remote control, namely
the OneForAll URC-7040. I can control VDR/MP3/Mplayer with one layer and
change to another layer for DVD control. This is quite perfect, but
changing the layer wouldn't be necessary if the DVD control codes could
be defined separately in the lircd.conf and lircrc as it is the case
with MPlayer. Take a look at the site listed above, I also placed two
tables there with the URC-7040 keys that I use. The content of the first
table is copied from the VDR manual, and the second table contains my
additional definitions for both layers (MPlayer and DVD). You can also
find my lircrc and lircd.conf for the URC-7040 there.

BTW, to Karsten Mueller: I have exactly the same problem with the
'Pause' key in MPlayer as you described in the MPlayer Users List :-(
It used to work when I installed MPlayer 0.90pre3 the first time. After
updating to 0.90pre5 it failed, and now I can't get it to work again.
Did you also notice that sometimes the > symbol of the MPlayer OSD turns
into the || symbol for a split of a second when you press pause? Without
LIRC, 'Pause' works just fine via the keyboard.

Thomas














Home | Main Index | Thread Index