Eurocardsharing

Go Back   Eurocardsharing > Sharing receivers > Reelbox > Tutorials

Tutorials Discussion, The Simple VDR Protocol (SVDRP) at Reelbox forum; Introduction The Simple VDR Protocol (SVDRP) allows simple commands to be sent to VDR over a plain TCP connection on ...

Reply
 
LinkBack Thread Tools Display Modes
The Simple VDR Protocol (SVDRP)
Old
  (#1)
Cardmagedon
Senior Member
 
Cardmagedon's Avatar
 
Offline
Posts: 135

Level: 10 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Life: 0 / 241
Magic: 45 / 6873
Experience: 66%

Thanks: 19
Thanked 136 Times in 63 Posts
Join Date: Apr 2008
The Simple VDR Protocol (SVDRP) - 30-November-2008, 22:23

Introduction

The Simple VDR Protocol (SVDRP) allows simple commands to be sent to VDR over a plain TCP connection on port 2001. E.g. to send a message that gets displayed on TV.

It is possible to write a simple shell script to dump any text on the TV screen, for instance on an incoming phone call or when an email arrives:

Code:
#!/bin/sh

netcat -w 10 <HOSTNAME> 2001 <<eof
mesg $1
quit
eof
*HOSTNAME* has to be replaced with the hostname of the computer VDR is running on. The script takes the text to be displayed as a parameter. Netcat also exists for Windows.

As an alternative you may use the special TCP redirection of GNU Bash:

Code:
echo mesg 'Hello World!' >/dev/tcp/HOSTNAME/2001
By default only localhost is allowed to connect to VDR. To alter this one has to change the file svdrphosts.conf in the configuration directory /etc/vdr of VDR. The build up of this file is really simple.

Code:
IP-Adresse[/Netmask]
Just enter line by line the allowed host IPs, or whole networks. For networks you need the network mask (e.g. /24). For examples see the sample svdrphosts.conf that comes with VDR.

The commands

Overview

Code:
CHAN  CLRE  DELC  DELR  DELT
GRAB  HELP  HITK  LSTC  LSTE
LSTR  LSTT  MESG  MODC  MODT
MOVC  MOVT  NEWC  NEWT  NEXT
PUTE  STAT  UPDT  VOLU  QUIT
Description

CHAN
[ + | - | number | name | id ]
Switch channel up, down or to the given channel number, name or id. Without option (or after successfully switching to the channel) it returns the current channel number and name.

CLRE
Clear the entire EPG list.

DELC number
Delete channel.

DELR number
Delete the recording with the given number. Before a recording can be deleted, an LSTR command must have been executed in order to retrieve the recording numbers. The numbers don't change during subsequent DELR commands.

CAUTION: THERE IS NO CONFIRMATION PROMPT WHEN DELETING A RECORDING - BE SURE YOU KNOW WHAT YOU ARE DOING!

DELT number
Delete timer.

GRAB filename [ jpeg | pnm [ quality [ sizex sizey ] ] ]
Grab the current frame and save it to the given file. Images can be stored as JPEG (default) or PNM, at the given quality (default is 'maximum', only applies to JPEG) and size (default is full screen).

HELP [ topic ]
The HELP command gives help info.

HITK [ key ]
Hit the given remote control key. Without option a list of all valid key names is given.

LSTC [ number | name ]
List channels. Without option, all channels are listed. Otherwise only the given channel is listed. If a name is given, all channels containing the given string as part of their name are listed.

LSTE [ channel ] [ now | next | at time ]
List EPG data. Without any parameters all data of all channels is listed. If a channel is given (either by number of by channel ID), only data for that channel is listed. now, next, or at <time> restricts the returned data to present events, following events, or events at the given time (which must be in time_t form).

LSTR [ number ]
List recordings. Without option, all recordings are listed. Otherwise the summary for the given recording is listed.

LSTT [ number ]
List timers. Without option, all timers are listed. Otherwise only the given timer is listed.

MESG [ message ]
Displays the given message on the OSD. If message is omitted, the currently pending message (if any) will be returned. The message will be displayed for a few seconds as soon as the OSD has become idle. If a new MESG command is entered while the previous message has not yet been displayed, the old message will be overwritten.

MODC number settings
Modify a channel. Settings must be in the same format as returned by the LSTC command.

MODT number on | off | settings
Modify a timer. Settings must be in the same format as returned by the LSTT command. The special keywords 'on' and 'off' can be used to easily activate or deactivate a timer.

MOVC number to
Move a channel to a new position.

MOVT number to
Move a timer to a new position.

NEWC
settings
Create a new channel. Settings must be in the same format as returned by the LSTC command.

NEWT
settings
Create a new timer. Settings must be in the same format as returned by the LSTT command. It is an error if a timer with the same channel day, start and stop time already exists.

NEXT
[ abs | rel ]
Show the next timer event. If no option is given, the output will be in human readable form. With option 'abs' the absolute time of the next event will be given as the number of seconds since the epoch (time_t format), while with option 'rel' the relative time will be given as the number of seconds from now until the event. If the absolute time given is smaller than the current time, or if the relative time is less than zero, this means that the timer is currently recording and has started at the given time. The first value in the resulting line is the number of the timer.

PUTE

Put data into the EPG list. The data entered has to strictly follow the format defined in vdr(5) for the 'epg.data' file. A '.' on a line by itself terminates the input and starts processing of the data (all entered data is buffered until the terminating '.' is seen).

SCAN
Forces an EPG scan. If this is a single DVB device system, the scan will be done on the primary device unless it is currently recording.

STAT disk
Return information about disk usage (total, free, percent).

UPDT
settings
Updates a timer. Settings must be in the same format as returned by the LSTT command. If a timer with the same channel, day, start and stop time does not yet exists, it will be created.

VOLU [ number | + | - | mute ]
Set the audio volume to the given number (which is limited to the range 0...255). If the special options '+' or '-' are given, the volume will be turned up or down, respectively. The option 'mute' will toggle the audio muting. If no option is given, the current audio volume level will be returned.

QUIT
Exit vdr (SVDRP). You can also hit Ctrl-D to exit.

Editing Timers manually

status:channel:day:start:stop:priority:lifetime:fi lename:

status 0 = inactive, 1 = active channel channel number to record day day of month start start time for recording hhmm stop stop time for recording hhmm priority (50 will do) lifetime lifetime of the recording (99=indefinite) filename


NEWT 1:440:30:1900:1905:50:99:testfile:

SVDRP reply codes


Code:
214 Help message
215 EPG data record
220 VDR service ready
221 VDR service closing transmission channel
250 Requested VDR action okay, completed
354 Start sending EPG data
451 Requested action aborted: local error in processing
500 Syntax error, command unrecognized
501 Syntax error in parameters or arguments
502 Command not implemented
504 Command parameter not implemented
550 Requested action not taken
554 Transaction failed
Reply codes are in the format

Code:
Reply code*-|Space*Text*Newline
In the last line the "-" is replace be a space.

Example output ("help" command)

Code:
214-This is VDR version 1.3.11
214-Topics:
214-    CHAN    CLRE    DELC    DELR    DELT
214-    GRAB    HELP    HITK    LSTC    LSTE
214-    LSTR    LSTT    MESG    MODC    MODT
214-    MOVC    MOVT    NEWC    NEWT    NEXT
214-    PUTE    SCAN    STAT    UPDT    VOLU
214-    QUIT
214-To report bugs in the implementation send email to
214-    [email protected]
214 End of HELP info
YouTube Video
ERROR: If you can see this, then YouTube is down or you don't have Flash installed.


SVDRP - VDR Wiki
   
Reply With Quote
Reply

Bookmarks

Tags
(svdrp), protocol, simple


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



ECS on RSS ECS on Twitter ECS on Facebook ECS on Youtube
Follow us on:

Powered by vBulletin
Copyright 2002 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Dreambox