[mythtv-users] Solution to getting an IR blaster to work with a DCT700 cable box

mythmail at gmail.com mythmail at gmail.com
Thu Jul 26 01:33:58 UTC 2007


Hi,
    I'm posting this to the list so that other people who run into
this situation won't have to go through as much trouble as I did.

  I recently got digital cable that required me to go through a cable
box, a DCT700, which appears to becoming quite common.  After setting
up a serial ir blaster from irblaster.info, I ran into the following
problems (The blaster is in combination with my hauppauge remote so
that hauppauge=lircd and blaster=lircd1).  The zero signal doesn't
work!?  For some reason the box just doesn't see it. And the box
didn't seem to respond to the first signal sent to it in a string of
signals, so channel changing was sketchy at best.
    I ended up having to write a custom python script that seems to
have fixed all of the problems and the MythTV is controlling the cable
box smoothly now.  I hope it's of use to anyone else who runs into
this situation.

The script


#!/usr/bin/python

#This script is for MythTV to change channels through a serial
transmitter.  The first argument is expected to be
#the channel.  This script has an added adjustment to deal with the
DCT700 digital cable box not recognizing
#the 0 signal from my IR Blaster. By Craig Betts.

import os, sys, re, time

def changeChannel(channel):
	### Send the commands to change the cable box to a certain channel,
including the zero button kluge
	def sendChannel(channel):
		### Breaks down the digits in a channel and sends them via irsend
plus the ok/select signal
		for number in range(len(channel)):
			irsend(channel[number])
		irsend('ok/select') #you may have to change this depending on your lircd.conf
		return

	def hasZero(channel):
		### Tests to see if the channel has a zero, returns True or False
		zeroRe = re.compile('0')
		if zeroRe.search(channel):
			return True
		else:
			return False
		return
		
	def irsend(button):
		### Uses lirc to send the IR signals
		remote = 'DCT700' #change to the name of your remote
		lircd = '/dev/lircd1' #change to the lircd of you transmitter
		command = 'irsend -d ' + lircd + ' SEND_ONCE '+ remote + ' ' + str(button)
		os.system(command)
		time.sleep(0.5)
		return
	irsend('exit') #make sure that the on screen display is down and
possibly warm up blaster?
	irsend('exit')	
	if hasZero(channel):
		#deal with the zero button not working by changing to one channel
lower then going up a channel
		channel = str(int(channel) - 1)
		sendChannel(channel)
		irsend('ch+') #you may have to change this depending on your lircd.conf
		return
	else:
		sendChannel(channel)
	return

def main():
	channel = sys.argv[1]
	changeChannel(channel)
	return

if __name__== '__main__' : main()


More information about the mythtv-users mailing list