Serled-plugin

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
 
(4 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 11: Zeile 11:
  
 
                   R
 
                   R
        LED    ---------
+
        LED    ---------
RTS O----|>---|        |------| GND
+
RTS O----|>---|        |------| GND
              ---------
+
                ---------
  
 
                   R
 
                   R
        LED    ---------
+
        LED    ---------
DTR O----|>---|        |------| GND
+
DTR O----|>---|        |------| GND
              ---------
+
                ---------
  
 
Pins on a 9-Pin sub-d connector:
 
Pins on a 9-Pin sub-d connector:
Zeile 29: Zeile 29:
  
 
Notes:
 
Notes:
- I am not sure about the polarity of the LEDs, but it is not really important.
+
* I am not sure about the polarity of the LEDs, but it is not really important. You can set the polaity in the configuration file. Depending on the polarity of the LED it will light until vdr started.
  You can set the polaity in the configuration file. Depending on the polarity
+
* The value of the resistor R depends on the LED you are using (low current or not, color). Additinally the signal levels of a RS232-port are not precisely specified (3-20V). So you will have to try (start with using a potti). I am using 900 Ohms, but the LED is a little bit dark.
  of the LED it will light until vdr started.
+
- The value of the resistor R depends on the LED you are using (low current or
+
  not, color). Additinally the signal levels of a RS232-port are not precisely
+
  specified (3-20V). So you will have to try (start with using a potti). I am
+
  using 900 Ohms, bu the LED is a little bit dark.
+
 
    
 
    
 
Note: Since version 0.1.0 different means of connecting leds can be implemented.
 
Note: Since version 0.1.0 different means of connecting leds can be implemented.
Zeile 46: Zeile 41:
 
The console device supports 4 "leds":  
 
The console device supports 4 "leds":  
  
 +
<pre>
 
NUM_LOCK \
 
NUM_LOCK \
 
CAPS_LOCK |- = Keyboard leds
 
CAPS_LOCK |- = Keyboard leds
 
SCROLL_LOCK /
 
SCROLL_LOCK /
 
BEEP     1kHz beep from the PC speaker
 
BEEP     1kHz beep from the PC speaker
 +
</pre>
  
 
Notes:
 
Notes:
- The console device (/dev/console) must be writeable for the vdr-process
+
* The console device (/dev/console) must be writeable for the vdr-process
- The console device will not work when vdr runs in an xterm (KDE-konsole ..).
+
* The console device will not work when vdr runs in an xterm (KDE-konsole ..).
- You probably do not want to use the BEEPer if you really have connected a speaker. The idea is to connect a led instead of a speaker. For detailes see http://www.vdr-portal.de/board/thread.php?threadid=49268.
+
* You probably do not want to use the BEEPer if you really have connected a speaker. The idea is to connect a led instead of a speaker. For detailes see http://www.vdr-portal.de/board/thread.php?threadid=49268.
  
 
==Cutter-Mutex Patch==
 
==Cutter-Mutex Patch==
Zeile 61: Zeile 58:
 
patches subdirectory:
 
patches subdirectory:
  
cd /usr/src/vdr-1.X.XX
+
cd /usr/src/vdr-1.X.XX
patch -p1 <PLUGINS/src/serled/patches/cuttermutex.pathc
+
patch -p1 <PLUGINS/src/serled/patches/cuttermutex.pathc
  
 
If this patch is not applied, and the conditin "cutting" is used, vdr is will
 
If this patch is not applied, and the conditin "cutting" is used, vdr is will
 
frequently crash at the end of cutting.
 
frequently crash at the end of cutting.
 
  
 
==APIVERSION==
 
==APIVERSION==
Zeile 166: Zeile 162:
  
 
==Links==
 
==Links==
# [http://www.physik.uni-muenchen.de/~Felix.Rauscher Homepage des Plugins]
 
  
[[Kategorie:Plugins]]
+
[[Kategorie:Veraltete Plugins]]
 
{{i18n|serled-plugin}}
 
{{i18n|serled-plugin}}

Aktuelle Version vom 4. August 2013, 14:35 Uhr

Ansteuerung von 2 Status-LEDs über die Serielle Schnittstelle

Inhaltsverzeichnis

[Bearbeiten] Beschreibung

Autor: Felix Rauscher

[Bearbeiten] Hardware:

Serial port:


                 R
        LED    ---------
RTS O----|>---|         |------| GND
               ---------
                 R
        LED    ---------
DTR O----|>---|         |------| GND
               ---------

Pins on a 9-Pin sub-d connector:

RTS 7 DTR 4 GND 5

For internal connectors refer to your mother-board manual.

Notes:

  • I am not sure about the polarity of the LEDs, but it is not really important. You can set the polaity in the configuration file. Depending on the polarity of the LED it will light until vdr started.
  • The value of the resistor R depends on the LED you are using (low current or not, color). Additinally the signal levels of a RS232-port are not precisely specified (3-20V). So you will have to try (start with using a potti). I am using 900 Ohms, but the LED is a little bit dark.

Note: Since version 0.1.0 different means of connecting leds can be implemented. See file HOWTO_create_device_class if you want to adpt this plugin for a different device type.

[Bearbeiten] Console

The console device supports 4 "leds":

	NUM_LOCK	\
	CAPS_LOCK	|- = Keyboard leds
	SCROLL_LOCK	/
	BEEP		     1kHz beep from the PC speaker

Notes:

  • The console device (/dev/console) must be writeable for the vdr-process
  • The console device will not work when vdr runs in an xterm (KDE-konsole ..).
  • You probably do not want to use the BEEPer if you really have connected a speaker. The idea is to connect a led instead of a speaker. For detailes see http://www.vdr-portal.de/board/thread.php?threadid=49268.

[Bearbeiten] Cutter-Mutex Patch

If you plan to use the condition "cutting" you should apply the patch in the patches subdirectory:

cd /usr/src/vdr-1.X.XX
patch -p1 <PLUGINS/src/serled/patches/cuttermutex.pathc

If this patch is not applied, and the conditin "cutting" is used, vdr is will frequently crash at the end of cutting.

[Bearbeiten] APIVERSION

The latest vdr versions want the plugins to honor the APIVERSION instead of the VDRVERSION. For vdr-version>1.3.48 go into the plugin source directory and do:

rm Makefile mv Makefile.apiversion Makefile


[Bearbeiten] Config-File:

If no parameters are givn serled will look for /etc/vdr/serled. A different config file can be given (-Pserled <different config fie>).

An example configuration file is in example/serled.example. A line

DEVICE serial <device file>

starts a section for one serial port, which is ended by

/DEVICE

. The argument <device file> is the device pinting to the serial port (usually /dev/ttyS0 for COM1 and /dev/ttyS1 for COM2).

Inside a device section you can create two sections for the two signals by typing

RTS [inverted]

or

DTR [inverted]

. These sections are ended by /RTS or /DTR respectively. The flag 'inverted' indicates that the LED is connected with the inverse polarity (give this flag if the led lights during boot).

Inside an RTS or DTR section you can define an arbitrary number of signals. The signal which is defied first will have the highest priority. There are two different kind of signals:

ON <condition>

or FLASH <t on> <t off> <condition>

'ON' means that the led is on as long as <condition> is fulfilled. 'FLASH' means that the led flashes while <condition> is fulfilled. <t on> and <t off> is the time the led is on and off. Without denominator the time is interpreted as usec (micoseconds). You can give s ms or us as denomiator (e.g 1s 400us). Do not put a whitespace between number and denominator.

The valid <condition>s are:

replay A recording, DVD, .. is replayed record VDR is recording all_record All input devices are used for recording. This does not work if you have plugins providing devices (xine, softdevice ?). It is also quite untested as I have only one DVB card. cutting vdr is cutting

[Bearbeiten] BUGS:

The condition all record is untested. It does not work with my setup. I think he xine or the streamdev pluin gives an additional device, so that the condition is no longer fulfilled.

Additional conditions 'red', 'green', blue' and 'yellow' are forseen. They should be fulfilled when the respective color key is active. At the moment this does not work.


[Bearbeiten] Links

In anderen Sprachen