DIRECTV Box serial interface script

You probably came here for the directv.pl V1.10 script for controlling DIRECTV set top boxes. New Version 1.10 12/10/10, Change how serial port opened to work around modem_manager setting port to using hardware control signals. Old directv.pl version V1.9

This script should work with RCA boxes and the D10-100, D10-200, D10-300, D11, and H20 box. To talk to the box you will need a serial cable which is documented here. See this picture for pin one location and normal color order. Some people have found the cable they used had the colors backwards so the cable they made didn't work. To use with a D10-300 see this message To use a D11 you will need USB adapter documented here

To use this script with MythTV run mythtvsetup and select Input connections then select the input your DIRECTV box is connected to such as S-Video. Then under external channel change command enter the command for your box.
For older boxes
  /path_to_script/directv.pl setup_channel
For first generation RCA boxes DRD420RE,DRD480RE, and DRD505RB
  /path_to_script/directv.pl box_type RCA_OLD setup_channel
For D10-200
  /path_to_script/directv.pl box_type D10-200 setup_channel
For use with a D10-100 with recent firmware version 0x101B or for the D10-300 with recent firmware.
  /path_to_script/directv.pl box_type D10-100 setup_channel
If you have a high definition box but only subscribe to the standard definition channels such that you have to enter the channel number then hit channel up on the remote to see the channel.
  /path_to_script/directv.pl setup_channel_sd_hd

If your serial cable isn't on /dev/ttyS0 (com1) then use the port command to select the port, example port /dev/ttyS1. The port command must at the start of the command line before any command which talks to the directv box.

Run the script without any options to see all the commands.
I can help on using this script, email me. Link for DIRECTV MythTV setup. For general MythTV setup see this site. Also see the MythTV home site

This script is a modification of the one I found on the knoppix MythTV wiki

If you are wanting a script to run under windows you can run this one with a windows version of perl or another person has made a similar program for windows both discussed in this thread. Also see non Cygwin version of perl for windows

Since I like to over-do things I set up a script to graph the signal strength using RRDtool and a modification of the lm_sensors hardware monitoring sensord script.

View signal strength graph and signal loss statistics for my DIRECTV receiver.

The script which logs the data. It logs the channel and signal strength every 90 seconds alternating 15 and 45 seconds after the minute. This is so it shouldn't conflict with MythTV changing channel to start recording. I start it from /etc/rc.d/rc.local with

. /etc/init.d/functions
daemon /etc/rc.d/directv_loop.pl &

To configure apache to display the graphs etc on a Fedora system In /var/www/cgi-bin directv.cgi directv_stats.cgi. In /var/www/html/directv/ directv_all.shtml In /etc/httpd/conf.d/ local.conf

This is the command to create the database

rrdtool create /var/log/directv.rrd -s 90 DS:signal:GAUGE:120:0:100  \
  DS:channel:GAUGE:120:0:900  \
  RRA:AVERAGE:0.5:1:961 RRA:MIN:0.5:1:961 RRA:MAX:0.5:1:961 \
  RRA:AVERAGE:0.5:8:843 RRA:MIN:0.5:8:843 RRA:MAX:0.5:8:843 \
  RRA:AVERAGE:0.5:37:806 RRA:MIN:0.5:37:806 RRA:MAX:0.5:37:806 \
  RRA:AVERAGE:0.5:439:802 RRA:MIN:0.5:439:802 RRA:MAX:0.5:439:802

Also see my online PDP-8, a 1970's minicomputer.



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have any PDP-8 stuff you are willing to part with.