I just assembled a little HD44780-based LCD display that uses the LCDd driver and built it into the front of my Myth box (I ran the parallel cable through the inside of the case). Instructions for LCDd and wiring up such a display are available here:
http://lcdproc.omnipotent.net/
As mentioned elsewhere, of course LCDd support is already in Knoppmyth (thanks Cesman!) but you must configure LCDd.conf and start LCDd, perhaps via a line like this in bootmisc.sh:
Quote:
/etc/init.d/LCDd start
After getting it all working, I thought the LCD display was neat, but using setup in MythTV 0.18 I could not find any option to display TV program titles on the LCD display as they are being recorded. For example, my wife asks if program X is being recorded and we'd end up having to turn on the TV (or stop watching something else) to make sure -- but not anymore...
Perhaps there's a better way to do this, but below is a little perl script I wrote that goes through the mythbackend.log file and displays the title of the last 2 shows that started recording (today) and the time that the recording started.
To use it, save the text below as "/usr/local/bin/lcdrec.pl" and use "chmod a+x lcdrec.pl" to make it executable (you might also have to fix the end-line characters since this was pasted via windows). Then go into webmin and set up a crontab entry to make it execute at 00 and 30 minutes past the hour, every hour. Also, be sure to disable the LCD support in the mythfrontend so it doesn't overwrite what's displayed on the screen.
9/29 UPDATE: To use this, you must also modify /etc/init.d/LCDd to add "-i" to DAEMON_OPTS, so that LCDd does not revert back to the server screen when no TCP clients are connected. For example:
Quote:
DAEMON_OPTS="-i -s -f -c /etc/LCDd.conf"
I hope someone else finds this useful.
Quote:
#!/usr/bin/perl -w
#
# lcdrec.pl - display MythTV recording programs to a VFD/LCD display
# Mark Thompson 2005
#
# Use webmin to add a crontab entry to execute this at 00 and 30
# minutes past each hour
#
use IO::Socket;
use Fcntl;
use strict;
my $path = "/var/log/mythtv/mythbackend.log";
# Sleep a few seconds to make sure that myth logfile has been updated;
sleep 10;
# Open mythbackend.log to check recording history
sysopen( LOGFILE, $path, O_RDONLY | O_NONBLOCK ) || die "Cannot read logfile $path\n";
# Open TCP port to LCDd
my $remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "localhost",
PeerPort => 13666)|| die "Cannot connect to LCDd\n";
$remote->autoflush(1);
sleep 1; # give the server time to notice us...
print $remote "hello\n";
# we must read the response even if we ignore it:
my $lcdresponse = <$remote>;
# Turn off blocking mode...
fcntl($remote, F_SETFL, O_NONBLOCK);
# Set up some screen widgets...
print $remote "client_set name lcdmsg\n";
$lcdresponse = <$remote>;
print $remote "screen_add scr1\n";
$lcdresponse = <$remote>;
print $remote "screen_set scr1 -duration 10 -priority 2 -heartbeat off\n";
$lcdresponse = <$remote>;
print $remote "widget_add scr1 wid1 string\n";
$lcdresponse = <$remote>;
print $remote "widget_add scr1 wid2 string\n";
$lcdresponse = <$remote>;
#
my $s;
my $t;
my $l1;
my $l2;
while( $s = <LOGFILE> )
{
if ($s =~ /scheduler:/) {}
else
{
#(move this # to the next line down if you want to finished recordings
#to be displayed as well:)
# if ($s =~ /recording/)
if ($s =~ /Started recording/)
{
$t = substr($s, 11, 5);
if ($s =~ /Started recording/) {
$s = substr($s, index($s, "Started recording")+18);
$s = "$t $s";
} else
{
if ($s =~ /Finished recording/) {
$s = substr($s, index($s, "Finished recording")+19);
$s = "$t f:$s";
}
}
$_ = substr($s, 0, rindex($s, " on channel"));
tr/"'//d;
$l1=$l2; $l2=$_;
}
}
}
close(LOGFILE);
# I'm assuming here that the LCD is only 2 lines
if ($l1)
{
print $remote "widget_set scr1 wid1 1 1 \"$l1\"\n";
$lcdresponse = <$remote>;
}
if ($l2)
{
print $remote "widget_set scr1 wid2 1 2 \"$l2\"\n";
$lcdresponse = <$remote>;
}
# sleep so TCP connection will stay open until LCD has been updated
sleep 5;