NASDVR is a web application and set of python scripts that let you manage an HDHomerun device, including:

This requires to have the hdhomerun-config package installed only (no DVB drivers needed).

It's originally intended to run on NAS devices but this guide indicates how to set it up on Ubuntu 12.04 LTS.

This guide is based on the original instructions at NASDVR. Please consider contributing to the project directly, this is documented here for convenience.

Use these instructions at your own risk - perhaps it's best to experiment in a virtual machine.

Feel free to edit the following, specially the Apache configuration part and wiki formatting. The original web application should require a password for access, when testing on Ubuntu full access to the application was granted.

- Become root:

sudo -s

- Enable the web and database servers:

apt-get install apache2 mysql-server

(for this document we assume your password is "secret")

- Install the nasdvr directory to /var/www/

chown -R nobody /var/www/nasdvr
chmod 777 /var/www/nasdvr/dat
chmod 755 /var/www/nasdvr/bin/*.pl
chmod 755 /var/www/nasdvr/cgi-bin/*.cgi

Change to the /var/www/nasdvr/sql directory:

/var/www/nasdvr/sql

- Create the nasdvr database:

# mysql -u root -psecret (password is your admin password specified when installing MySQL)
  create database nasdvr;
  \q
# mysql -u root -ppassword nasdvr < base.sql

Invoke CPAN and install needed Perl packages:

# cpan

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes]

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')
 [local::lib] sudo

Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes]

cpan[1]> install CPAN
cpan[1]> reload cpan
cpan[1]> install CGI
cpan[1]> install Date::Calc 
cpan[1]> install SOAP:Lite 
cpan[1]> install XML::Twig 
cpan[1]> exit
#

The last two packages were not needed in Ubuntu, but were specified in the original instructions.

- Change to the /var/www/nasdvr/lib directory

cd /var/www/nasdvr/lib

- Edit the config.pm file and set the MySQL admin username and password (remember in Ubuntu the user for mySQL is "root")

- Change the Apache config so the document root is /var/www/nasdvr/htdocs and CGI scripts are enabled:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/nasdvr
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/nasdvr>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

#       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        ScriptAlias /cgi-bin/ /var/www/nasdvr/cgi-bin/

- Restart the apache web server:

# service apache2 restart

- In your web browser enter the URL that points to your new install:

You can find out your own address from command line:

ip addr

- Click on the Tuners link

- Click the "Discover" button and make note of the ID returned. Example:

hdhomerun device 1043557 found at 192.168.35.202 

(the ID in this example is 1043557

- Click on the Configure link, complete the information as follows:

data_dir:       /var/www/nasdvr/dat
hdhr_config:    /usr/bin/hdhomerun_config
hdhr_id:        1043557
log_file:       /var/www/nasdvr/log.txt
recording_dir:  /Videos/hd
root_dir:       /var/www/nasdvr
sd_num_days:    14
sd_password:    SDpassword
sd_url:         http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl
sd_username:    SDusername
tz_offset:      0

2012-02-21T05:00:00Z - 2012-02-22T04:59:59Z
2012-02-22T05:00:00Z - 2012-02-23T04:59:59Z
2012-02-23T05:00:00Z - 2012-02-24T04:59:59Z
2012-02-24T05:00:00Z - 2012-02-25T04:59:59Z
2012-02-25T05:00:00Z - 2012-02-26T04:59:59Z
2012-02-26T05:00:00Z - 2012-02-27T04:59:59Z
2012-02-27T05:00:00Z - 2012-02-28T04:59:59Z
2012-02-28T05:00:00Z - 2012-02-29T04:59:59Z
2012-02-29T05:00:00Z - 2012-02-30T04:59:59Z
2012-02-30T05:00:00Z - 2012-02-31T04:59:59Z
2012-02-31T05:00:00Z - 2012-03-01T04:59:59Z
2012-03-01T05:00:00Z - 2012-03-02T04:59:59Z
2012-03-02T05:00:00Z - 2012-03-03T04:59:59Z
2012-03-03T05:00:00Z - 2012-03-04T04:59:59Z

- Edit the root crontab

00 0 * * * cd /var/www/nasdvr/bin;./sd.pl
* * * * * cd /var/www/nasdvr/bin;./scheduler.pl

This will run the Schedules Direct updater once a day and the program scheduler once per minute.

You should be ready to start scheduling shows!!

This was tested on Ubuntu 12.04 LTS.

HDhomerun/NASDVR (last edited 2014-07-04 01:10:16 by magicfab)