
Originally Posted by
dneprrider
I think it more appropriate to post this under the WINLIRC thread as opposed to the external channel changer broken thread, as it is apparent that the .exe channel changer works, and my problem rests with WinLIRC.
Here is what I have learnt over the past few days. Thanks to all who have responded with similar scripts/apps to test out similar functionality. All have indicated the same issue! Which I am getting too below.
I have written a simplified NT script file (channel.cmd) that takes in the {channel} argument from the .exe channel changer, and passes the channel numbers to the WINLIRC command line IR transmit.exe executable.
The script file also logs the passed channel numbers into a text file c:\input.txt in order to check that correct channel numbers are being passed.
Results:
From the GB-PVR TV guide I can select a TV channel to watch, channel changer calls the script file which parses the 3 digit channel number into 3 seperate digits, and then calls transmit.exe. The correct IR commands are sent and the external satellite box changes to the selected channel. As evident from the changed contents of input.txt file and the satellite box switching channels.
From a command window I can run channel.cmd followed by the channel number, whereby the transmit.exe executable is called and the external satellite box changes to the selected channel.
However when in recording mode for any selected “to be recorded” TV show channel, at the correct time, the channel.cmd script is run, but transmit.exe executable dosen’t run. Therefore the recording starts but the external satellite box channel remains at the original setting. The input.txt file logs the correct channel number so the channel.cmd script is running but transmit.exe is not being called. The same situation exists when in instant record mode.
Does any one have any idea why for sometimes a batch called file will run but at other times it would not? Any other suggestions or altarnatives to a serial port IR blaster would be greatly appreciated.
System
I am running this on a Toshiba Tecra XP Pro laptop with SP2 installed.
No TV in encoder card installed as this is my testing machine. Easier to move around than my P3 desktop which will be the final system when my Nvidia MX440 TV out card arrives.
I have added the directories used to my PATH statement and ensured that the .cmd extension is included in the PATHEXT.
Please see below for the channel.cmd script file
///////////////////////////////////////
@echo off
REM .exe channel changer send out the 3 digit channel number as one number
rem i.e {345}
rem
rem However TRANSMIT.exe sends out the remote codes serially
rem
rem usage: transmit remotename codename #times to repeat IR signal
rem
REM Need to pass a string of 3 numbers to TRANSMIT i.e 345
rem
rem Therefore need to parse the 3 digit channel# 345 into three arguments
rem for example:
rem
rem transmit 3100 3 1
rem transmit 3100 4 1
rem transmit 3100 5 1
rem
rem make it easy and hard code the remotename = 3100
rem make it easy and hard code the repeat = 1
rem Need to take in the {channel} as %1 then parse it into 3 digits
SET CHANNEL=%1
call C:\WINLIRC\transmit 3100 %CHANNEL:~0,1% 4
rem copy 1st digit of channel # into input.txt file for debug purpose
echo 3100 %CHANNEL:~0,1% 4 >> C:\INPUT.TXT
SLEEP 1
call C:\WINLIRC\transmit 3100 %CHANNEL:~1,1% 4
rem copy 2nd digit of channel # into input.txt file for debug purpose
echo 3100 %CHANNEL:~1,1% 4 >> C:\INPUT.TXT
SLEEP 1
call C:\WINLIRC\transmit 3100 %CHANNEL:~2,1% 4
rem copy 3rd digit of channel # into input.txt file for debug purpose
echo 3100 %CHANNEL:~2,1% 4 >> C:\INPUT.TXT
SLEEP 1
EXIT
/////////////////////////////////////////////////////////