2005-01-06, 05:31 PM
I was looking for a simple and inexpensive way to make GBPVR change channels on my Starchoice satellite box. After some fooling around I managed to get this working.
You will need WinLIRC http://winlirc.sourceforge.net/. There are instructions there on installation, configuration and how to make a simple $5 IR blaster that plugs into your serial port. You will need the file "transmit.exe" which unfortunately they left out of the latest v6.5. It can be found in some older archives such as 6.4 at http://cmail.info.kuzbass.net/~nav/
The hard part is getting the IR codes for your tuner. WinLIRC has a learning feature (which requires additional hardware) but I found it's not that accurate at capturing the IR timings. I ended  up using a scope to measure the IR timings but now they are dead on. If you are lucky you can find what you need for your tuner - I can post my WinLIRC.RC config file which works for the Starchoice box if that helps somebody.
I wrote a simple jscript program which calls transmit.exe to send the IR codes. You will have to put a copy of transmit.exe in \windows\system32. You will also have to have WinLIRC running, setting it up in you windows startup is probably a good idea so its running after a reboot.
/////////////////////////////////////////////////////////////////////////////
var cmdline;
var WshShell = new ActiveXObject("WScript.Shell"
objArgs = WScript.Arguments;
// channel changer script for GBPVR
// r heslip jan 1 2005
//
// executes WinLIRC "transmit.exe" three times to send the three digits
// usage:
// channel <remote> <channel> <repeats> <delay>
// <remote> is the remote name as defined in winlirc.rc
// <channel> is the three digit channel number
// <repeats> is a repeat count passed to transmit.exe
// <delay> is the delay in milliseconds to wait before transmitting again
cmdline=new String ("transmit "
cmdline=cmdline + objArgs(0)+ " " + objArgs(1).substr(0,1) +" " + objArgs(2);
//WScript.Echo(cmdline); // helps with debugging !
var oExec = WshShell.Exec(cmdline);
while (oExec.Status == 0)
{
  WScript.Sleep(10);
}
WScript.Sleep(objArgs(3));
cmdline="transmit ";
cmdline=cmdline + objArgs(0)+ " " + objArgs(1).substr(1,1) +" " + objArgs(2);
// WScript.Echo(cmdline);
var oExec = WshShell.Exec(cmdline);
while (oExec.Status == 0)
{
  WScript.Sleep(10);
}
WScript.Sleep(objArgs(3));
cmdline="transmit ";
cmdline=cmdline + objArgs(0)+ " " + objArgs(1).substr(2,1) +" " + objArgs(2);
// WScript.Echo(cmdline);
var oExec = WshShell.Exec(cmdline);
while (oExec.Status == 0)
{
  WScript.Sleep(10);
}
/////////////////////////////////////////////////////////////////
GBPVR must pass the script 4 parameters - the name of the remote as configured in WinLIRC (in my case its "star", the 3 digit channel number, an IR repeat count, and the delay in milliseconds between IR commands. I use a repeat of 1 and a delay of 1000ms - you may have to change this for your tuner.
Configure GBPVR for an external .exe channel changer. The executable is windows script host:
\WINDOWS\system32\wscript.exe
The parameter string in my case is:
"\Program Files\devnz\gbpvr\Winlirc PVR files\channel.js" star {channel} 1 1000
The quotes around the script path are required. I installed the WinLIRC stuff in a subdir of GBPVR as you can see. Check the zero pad and 3 digit channel number boxes. If you have a 2 digit tuner, take out the last block that calls transmit.exe in the script.
Its possible you might need the latest windows scripting host (5.6 ?) to make this work but it works fine on my XP Pro SP1 installation as is.
WinLIRC seems to suck up a lot of CPU when its transmitting. On a Duron 900mhz box GBPVR would sometimes go back to the main menu when changing channels in Live TV, but it changed channels for recordings properly. On a P4 1.7ghz there is no problem.
Hope this helps somebody.
Rich
You will need WinLIRC http://winlirc.sourceforge.net/. There are instructions there on installation, configuration and how to make a simple $5 IR blaster that plugs into your serial port. You will need the file "transmit.exe" which unfortunately they left out of the latest v6.5. It can be found in some older archives such as 6.4 at http://cmail.info.kuzbass.net/~nav/
The hard part is getting the IR codes for your tuner. WinLIRC has a learning feature (which requires additional hardware) but I found it's not that accurate at capturing the IR timings. I ended  up using a scope to measure the IR timings but now they are dead on. If you are lucky you can find what you need for your tuner - I can post my WinLIRC.RC config file which works for the Starchoice box if that helps somebody.
I wrote a simple jscript program which calls transmit.exe to send the IR codes. You will have to put a copy of transmit.exe in \windows\system32. You will also have to have WinLIRC running, setting it up in you windows startup is probably a good idea so its running after a reboot.
/////////////////////////////////////////////////////////////////////////////
var cmdline;
var WshShell = new ActiveXObject("WScript.Shell"
objArgs = WScript.Arguments;
// channel changer script for GBPVR
// r heslip jan 1 2005
//
// executes WinLIRC "transmit.exe" three times to send the three digits
// usage:
// channel <remote> <channel> <repeats> <delay>
// <remote> is the remote name as defined in winlirc.rc
// <channel> is the three digit channel number
// <repeats> is a repeat count passed to transmit.exe
// <delay> is the delay in milliseconds to wait before transmitting again
cmdline=new String ("transmit "
cmdline=cmdline + objArgs(0)+ " " + objArgs(1).substr(0,1) +" " + objArgs(2);
//WScript.Echo(cmdline); // helps with debugging !
var oExec = WshShell.Exec(cmdline);
while (oExec.Status == 0)
{
  WScript.Sleep(10);
}
WScript.Sleep(objArgs(3));
cmdline="transmit ";
cmdline=cmdline + objArgs(0)+ " " + objArgs(1).substr(1,1) +" " + objArgs(2);
// WScript.Echo(cmdline);
var oExec = WshShell.Exec(cmdline);
while (oExec.Status == 0)
{
  WScript.Sleep(10);
}
WScript.Sleep(objArgs(3));
cmdline="transmit ";
cmdline=cmdline + objArgs(0)+ " " + objArgs(1).substr(2,1) +" " + objArgs(2);
// WScript.Echo(cmdline);
var oExec = WshShell.Exec(cmdline);
while (oExec.Status == 0)
{
  WScript.Sleep(10);
}
/////////////////////////////////////////////////////////////////
GBPVR must pass the script 4 parameters - the name of the remote as configured in WinLIRC (in my case its "star", the 3 digit channel number, an IR repeat count, and the delay in milliseconds between IR commands. I use a repeat of 1 and a delay of 1000ms - you may have to change this for your tuner.
Configure GBPVR for an external .exe channel changer. The executable is windows script host:
\WINDOWS\system32\wscript.exe
The parameter string in my case is:
"\Program Files\devnz\gbpvr\Winlirc PVR files\channel.js" star {channel} 1 1000
The quotes around the script path are required. I installed the WinLIRC stuff in a subdir of GBPVR as you can see. Check the zero pad and 3 digit channel number boxes. If you have a 2 digit tuner, take out the last block that calls transmit.exe in the script.
Its possible you might need the latest windows scripting host (5.6 ?) to make this work but it works fine on my XP Pro SP1 installation as is.
WinLIRC seems to suck up a lot of CPU when its transmitting. On a Duron 900mhz box GBPVR would sometimes go back to the main menu when changing channels in Live TV, but it changed channels for recordings properly. On a P4 1.7ghz there is no problem.
Hope this helps somebody.
Rich