NASDVR is a web application and set of python scripts that let you manage an HDHomerun device, including:
- Discovery
Channels scan & lock for multiple tuners
- Schedule integration
- Recording
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:
- - Edit the /etc/apache2/sites-available/default file - Make sure it has:
<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:
http://IPaddress/htdocs (enter appropriate host IP address and port)
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
- Enter your Schedules Direct username and password in sd_username and sd_password
- Enter the HDHomeRun ID in the hdhr_id field
- Enter you timezone offset from GMT in tz_offset - this should be automatic when set to 0
- Click the Tuners link and then click the Scan button. This process will take a while to complete - DON'T CLICK ON ANYTHING. After it is done, you should see all the stations found by your HDHomeRun on both tuners.
- Change directory to /var/www/nasdvr/bin
- Run sd.pl (in /var/www/nasdvr/bin). This will populate your listings database. This will take a while depending on the sd_num_days value in the configuration above. Example output:
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
- Enter: crontab -e (choose nano as it's an easy to use editor)
- Add the following lines
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.