# Writting to the IR blaster from linux



## martinfick (Apr 26, 2006)

Hi,

I would like to write a small shell script that can make us of the Tivo IR blaster/wand thingies to control my TV's power and volume controls, is this possible? What device is the IR port, ttyS1? 

I attempted a few simple tests with the tivoapp turned off (I moved it out of the way and rebooted.) First I tried capturing the remote control signals from my tivo remote by simply cat-ting a button press from /dev/ttyS0 to a file. Then I tried cat-ting the captured file to /dev/ttyS1 (and S3 and S0) and could not get it to do anything to my TV.

Any hints on whether this should work? Thanks,

-Martin


----------



## classicsat (Feb 18, 2004)

What you should do is somehow capture the serial commands going to the IR blaster micro, deconstruct them, then reconstruct them for your TV code. The database has the makeup of the code, to some degree. Perhaps TiVo has source code for irblast.o.


----------



## martinfick (Apr 26, 2006)

classicsat said:


> What you should do is somehow capture the serial commands going to the IR blaster micro, deconstruct them, then reconstruct them for your TV code.


Sure, although how is the question? I was attempting to do that by capturing the output from the linux remote control input device and sending it to the ir blaster device. This doesn't seem to work. Is there a better approach?



> The database has the makeup of the code, to some degree.


What do you mean, which database? If you are talking about the DB that allows the Tivo to change the channels on cable boxes, I don't think that is relevant, for two reasons:

1) I want to change the volume and power, not the channel
2) My old (1995 Toshiba) TV does not seem to be supported by the TV remote, so I doubt that any Tivo DB has the code.



> Perhaps TiVo has source code for irblast.o.


What does irblast.o do? Where is this?

-Martin


----------



## Da Goon (Oct 22, 2006)

Your tivo doesn't contain any info on ir codes for your tv (or any other tv for that matter). Since there's no native code available for your tv, you'll need to find some original ir code information, which is coded for set-top boxes, and stored in the MFS database.

You'll need the mfs-utils bundle on your tivo, find it on sourceforge if you don't have it already. Look thru /Component/Ir for starters. You'll have to dump mfs objects using the mfs-utils, disassemble that code, and reassemble it with your tv's ir info. Then reinsert it and hope it doesn't kill your box in the process. Then you'll need to repeat guided setup to assign your new ir code.

There may be other ways, such as creating a fake ir slice containing the information you need, but it would still require a bit of reverse engineering. I recall some sparse conversation on this kind of thing a while back, but it was in regards to updating ir codes for currently unsupported stb's. The code the tivo is looking for does things such as change channels, control power, and maybe send an "enter" keypress. So, apart from the other hacking, you'd have to spoof channel up/down commands for volume controls, etc.

Irblast.o is probably in /lib/modules. I poked thru some kernel source code I had laying around (6.3?) and didn't find any specific source code for it. Maybe it's available in S1 kernel source. You can find source code at tivo.com/linux.


----------

