Webbased Sky/Sky+ remote control software
=========================================

Connecting up the hardware
==========================

Connect one of the outputs from the controller to the RF2 output on the
Sky/Sky+ box.

If you have an aerial amplifier between the usb sky controller and the
sky/sky+ box, it must be one that supports the IR backpath. (If you have a
'magic eye' that works when connected to the amplifier then the usb
controller will also work fine. http://www.tvlink.co.uk/ make excellent
amplifiers if you need to buy a new one.)


Software Installation
=====================

1. Install apache

Download apache 1.3.34 for windows:

http://apache.mirror.positive-internet.com/httpd/binaries/win32/apache_1.3.34-win32-x86-no_src.exe

Install using the default options.

(This wasn't available last time I checked, but go to:

http://www.heenan.me.uk/control-sky-from-pc/software/windows-utils/ to get a
copy.)

2. Install perl

Download activestate perl 5.8.7 for windows:

http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.7.813-MSWin32-x86-148120.msi

Install using the default options.

3. Install cgi scripts

Copy the cgi-bin and htdocs directories from this zip file to
C:\Program Files\Apache Group\Apache
(there should already be copies there)

Configuration
=============

At the top of cgi-bin/controls.cgi, there are several configuration options.

skyplus: set this to zero if you're not using a sky+
boxoutput: set this to 1 or 2 depending which output the box you want to
           control is connected to
delay: you may want to increase this if you sky box is slower and the
       screengrab is taken too early a lot

Using it
========

Firstly, make sure that your TV card is tuned to the sky/sky+ channel.

To first check it works, visit:

http://127.0.0.1/cgi-bin/image.cgi

You should see an image grabbed from your TV card.
If you don't, try running the steps in 'Further configuration'.

Once you see an image, carry on and try the full page:

http://127.0.0.1/cgi-bin/controls.cgi

You should see a sky remote control on the right, and an image from the TV
card on the left. Clicking on the buttons on the remote should cause the
image on the left to update.

Potential problems
==================

If you have problems getting the tv image to display, please ensure you're
running the latest version of directx, as some earlier versions have known
bugs.

The latest version can be downloaded either from windows update or from:

http://www.microsoft.com/directx/


Further configuration
=====================

The image grabbed can be configured. By default, it uses the default/current
settings for the first video capture device on your system. Normally this
works fine - if so, you do not need to follow the next steps.

You can configure the:
- device
- input
- capture size
- RF channel (if applicable).

To configure this, run the batch file grabimage-configure.bat, and answer
the onscreen prompts. The configuration is stored into 'grabimage-config.txt'
in the cgi-bin directory.

Visit:

http://127.0.0.1/cgi-bin/image.cgi

to check your new selections work ok.


Password protecting the web pages
=================================

1. Change apache configuration to require a password

Open C:\Program Files\Apache Group\Apache\conf\httpd.conf in an editor.

Locate this section of the file (around line number 621):

    <Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

Change that section to:

    <Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
        
        AuthName "SkyWeb"
        AuthType Basic
        AuthUserFile "C:/Program Files/Apache Group/Apache/cgi-bin/.htpasswd"
        Require valid-user
    </Directory>
(ie. add the lines beginning 'Auth' and 'Require')


2. Create a password file

Open a command window (go to the 'start menu', select 'Run...' and enter 'cmd'
and press 'Ok').

Enter:

"c:\Program Files\Apache Group\Apache\bin\htpasswd.exe" -b -c "c:\Program Files\Apache Group\Apache\cgi-bin\.htpasswd" skyweb cheese

to create a password file with a username of 'skyweb', password 'cheese'.
Obviously change these values to the username and password you want to use.

(If you want to add more than one user, run the command again with the new
user, but *without* the '-c' option.)

3. Restart apache

In the command window, type:

net stop apache
net start apache

4. Check the authentication now works

Go to http://127.0.0.1/cgi-bin/controls.cgi and make sure you get asked for a
password.

-- 
Copyright (C) Joseph Heenan 2005-2006
joseph@heenan.me.uk
