[mythtv] Experimental serial control of Motorola DCT2000
Ian Forde
ian at duckland.org
Thu Jun 12 20:36:15 EDT 2003
Okay - I've got it working. *FINALLY*
I put crcgen.py and remote.py in /usr/local/bin. Then I modified
remote.py such that the last part of the program reads:
newchan = sys.argv[1]
print "changing channel to ",newchan
CHANCODE=''
for num in [1, 2, 3]:
if (newchan[num-1:num] == "1" ):
CHANKEY=ONE
if (newchan[num-1:num] == "2" ):
CHANKEY=TWO
if (newchan[num-1:num] == "3" ):
CHANKEY=THREE
if (newchan[num-1:num] == "4" ):
CHANKEY=FOUR
if (newchan[num-1:num] == "5" ):
CHANKEY=FIVE
if (newchan[num-1:num] == "6" ):
CHANKEY=SIX
if (newchan[num-1:num] == "7" ):
CHANKEY=SEVEN
if (newchan[num-1:num] == "8" ):
CHANKEY=EIGHT
if (newchan[num-1:num] == "9" ):
CHANKEY=NINE
if (newchan[num-1:num] == "0" ):
CHANKEY=ZERO
CHANCODE=CHANCODE+CHANKEY
#for channel in [NINE+ONE+ONE, ZERO+THREE+FIVE, CHAN_UP+CHAN_UP,
CHAN_DOWN]:
# send_to_unit(serCon, channel)
# time.sleep(1)
send_to_unit(serCon, CHANCODE)
I also added
include sys
right under the line
include time
Then I wrote a wrapper script, called /usr/local/bin/changechannel.sh,
as follows:
#!/bin/sh
# Change Channel Script Wrapper for DCT-2000
# written by Ian Forde
# License: GPL. If you don't know what that is,
# you can look it up!
PARM=$1
PARMLEN=`echo $PARM | wc -c`
if [ ${PARMLEN} -gt 4 ]; then
echo "too high."
exit
elif [ ${PARMLEN} -eq 4 ]; then
newparm=${PARM}
elif [ ${PARMLEN} -eq 3 ]; then
newparm="0"${PARM}
elif [ ${PARMLEN} -eq 2 ]; then
newparm="00"${PARM}
fi
/usr/local/bin/remote.py ${newparm}
Next, go into setup, and add the line /usr/local/bin/changechannel.sh
into the external tuner section in "Input Connections". I had to preset
both channels to 3 for it to not give me a green screen.
BUT IT WORKS!!!!!!!!! One more reason not to keep my Tivo!
Sorry to post this to the dev list, but if more people test these, can
they get included in the contrib section of mythtv? ;)
-Ian
On Tue, 2003-06-10 at 11:50, Chris Griffiths wrote:
> I've recently found myself with a free machine after building a new one,
> and the specs seemed suitable for mythtv.
> Only problem is a TV card that only accepts NTCS via composite - the
> tuner is PAL - so I'd need to control the cable box via serial.
>
> I know from my tivo that ir sucks, and I'd followed a thread on
> tivocommunity.com/tivo-vb and wrote something that appears to work.
>
> You can find the thread here
> http://www.tivocommunity.com/tivo-vb/showthread.php?s=&postid=1192561#post1192561
> My code (in python) is attached to my post. Please experiment with it,
> and read through the rest of the thread for more detail on the protocol.
>
> Chris
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev
--
__________________________________
Ian Forde, RHCE, CCSE, SCNA, SCDME
CYTBeN, Inc.
ian at duckland.org / ian at cytben.com
More information about the mythtv-dev
mailing list