# RS-232 Command to change channel



## Earl Bonovich (Nov 15, 2005)

In one of the other threads, there was discussion for some of the advanced controler hardware that uses RS-232..

DirecTV saw that discussion and sent me this.
The command set to change the channel on the system.

Which will change it on the DISPLAYED tunner (regardless if it is Tuner 1 or Tuner 2).


```
The command has 6 bytes and is: FA A6 xx xx yy yy
Where:
FA: prefix (required)
A6: OpenUserCommand
xx xx: (16 bits) major channel
yy yy:  (16 bits) minor channel (FF FF when none, or actual minor number)

to tune channel 2, enter FA A6 00 02 FF FF

to tune ATSC channel 4-1, enter FA A6 00 04 00 01
```
Hopefully this will be helpfull to those that use the commands.


----------



## litzdog911 (Jun 23, 2004)

Earl, this begs the question ....

Is there a command reference guide available somewhere that documents these commands?


----------



## Earl Bonovich (Nov 15, 2005)

litzdog911 said:


> Earl, this begs the question ....
> 
> Is there a command reference guide available somewhere that documents these commands?


There is... but I don't have it off hand.

I did post it here a long time ago...
But will have to dig for it...


----------



## bt-rtp (Dec 30, 2005)

Oh ya, it's an oldie but a goodie.....and it is attached. Enjoy.


----------



## CrestronPro (Nov 25, 2007)

Earl Bonovich said:


> There is... but I don't have it off hand.
> 
> I did post it here a long time ago...
> But will have to dig for it...


Thanks for the update! I guess I never tried the command from the single tuner units to command the multiple tuners of the HR2* units.

For anyone interested, attached is the newest version I have of DirecTV's command protocols (updated in August 2007). I believe there are only a few minor updates from the version bt-rtp posted.


----------



## CrestronPro (Nov 25, 2007)

Earl Bonovich said:


> In one of the other threads, there was discussion for some of the advanced controler hardware that uses RS-232..
> 
> DirecTV saw that discussion ...


It's great to see D* at least keeping an eye on these kind of suggestions. I'm sure it all gets put on "the list", and then prioritized with everything else from there. In any case, it at least gives hope that some of the other suggestions in that thread might be implemented down the road.


----------



## Thaedron (Jun 29, 2007)

This would be great material to include in the FAQ thread (if it's not there already).


----------



## TigerDriver (Jul 27, 2007)

Earl Bonovich said:


> In one of the other threads, there was discussion for some of the advanced controler hardware that uses RS-232..


I never thought I'd see the words "advanced" and "RS-232" used in the same context!


----------



## HighVoltage (Nov 27, 2007)

TigerDriver said:


> I never thought I'd see the words "advanced" and "RS-232" used in the same context!


:lol:

You might be surprised how many advanced industrial controls still use/support RS232.


----------



## Drew2k (Aug 16, 2006)

Here are some recent threads on this:

*Interesting Information*

*HR20 Serial Control*

*RS-232 Codes for HR20 / HR21
*
All of them pretty much refer to the same PDF documents, but there may be some other discussion of interest ...


----------



## TigerDriver (Jul 27, 2007)

HighVoltage said:


> :lol:
> 
> You might be surprised how many advanced industrial controls still use/support RS232.


No, I wouldn't be surprised...but I am delighted.

I'm the author of _C Programmer's Guide to Serial Communications_ (see Amazon link). The First Edition came out in 1989, and the Second Edition in 1993. It was translated into about a dozen languages, too.

Astonishingly, I still get a nice royalty check every month, both from book sales _and _from source-code licenses. (One of my licensees is NASA, which REALLY scares me.)


----------



## HighVoltage (Nov 27, 2007)

TigerDriver said:


> No, I wouldn't be surprised...but I am delighted.
> 
> I'm the author of _C Programmer's Guide to Serial Communications_ (see Amazon link). The First Edition came out in 1989, and the Second Edition in 1993. It was translated into about a dozen languages, too.
> 
> Astonishingly, I still get a nice royalty check every month, both from book sales _and _from source-code licenses.


Sweet.



> (One of my licensees is NASA, which REALLY scares me.)


:lol:

It shouldnt scare you... You know one thing that RS232 has over most others is its inherant security. There is no multi-drop or network interfaces. You have to be physically be right there at the control/tool to access/change data and you have to have knowledge of whatever custom protocol they came up with. Most industries have strict security protocols to secure their IP. Some are fanatical. I know of several semiconductor fabs that ban Wifi. RS232 gives them piece of mind. So you should still be colecting those checks for a long time to come. 

/threadjack


----------



## TigerDriver (Jul 27, 2007)

HighVoltage said:


> Sweet.
> 
> :lol:
> 
> ...


I'm scared because I heard through the backdoor at NASA that my code connects the motor controller to the motors on one of the vehicles on (here comes the scary part) Mars. :eek2: (At least it wasn't used on the fuel-tank gauges on the shuttle's booster!)

Most of my other licensees are automation control companies (e.g., suppliers to semiconductor fab houses) for, I assume, the reasons you give.


----------



## bt-rtp (Dec 30, 2005)

I have that book sitting on a shelf by my PC at home. Back in the day, that was the RS-232 bible. I gusss that it still is...... :-O



TigerDriver said:


> No, I wouldn't be surprised...but I am delighted.
> 
> I'm the author of _C Programmer's Guide to Serial Communications_ (see Amazon link). The First Edition came out in 1989, and the Second Edition in 1993. It was translated into about a dozen languages, too.
> 
> Astonishingly, I still get a nice royalty check every month, both from book sales _and _from source-code licenses. (One of my licensees is NASA, which REALLY scares me.)


----------



## TigerDriver (Jul 27, 2007)

bt-rtp said:


> I have that book sitting on a shelf by my PC at home. Back in the day, that was the RS-232 bible. I gusss that it still is...... :-O


Yes it has that reputation--one-stop shopping (where else can you get optimized code for CRC computation, 2D Huffman encoding, etc).

Unfortunately, it's a bible for a religion with a diminishing number of devotees.


----------



## greynolds (Aug 19, 2006)

TigerDriver said:


> No, I wouldn't be surprised...but I am delighted.
> 
> I'm the author of _C Programmer's Guide to Serial Communications_ (see Amazon link). The First Edition came out in 1989, and the Second Edition in 1993. It was translated into about a dozen languages, too.
> 
> Astonishingly, I still get a nice royalty check every month, both from book sales _and _from source-code licenses. (One of my licensees is NASA, which REALLY scares me.)


Nice - my copy is sitting on the bookshelf next to my computer. I haven't refered to it in quite a while, but is has served me very well over the years - thanks for writing it.


----------



## David MacLeod (Jan 29, 2008)

> For anyone interested, attached is the newest version I have of DirecTV's command protocols (updated in August 2007). I believe there are only a few minor updates from the version bt-rtp posted.


keep in mind last weekend (3-7-08) ce (for life of me I forget # right now) on hr20-100 disabled some of the active-right button functionality. no idea if rs-232 commands were affected or not.


----------



## MountainMan10 (Jan 31, 2008)

TigerDriver said:


> No, I wouldn't be surprised...but I am delighted.
> 
> I'm the author of _C Programmer's Guide to Serial Communications_ (see Amazon link). The First Edition came out in 1989, and the Second Edition in 1993. It was translated into about a dozen languages, too.
> 
> Astonishingly, I still get a nice royalty check every month, both from book sales _and _from source-code licenses. (One of my licensees is NASA, which REALLY scares me.)


Pleased to meet you Joe. I have this book also. Refered to it many times. I program industrial controls and occasionally have needs for RS-232.

I have been playing around with controlling the DVR with RS-232. I am a little twisted as I find doing things like this fun and relaxing.

I started with my R15 as it does not need to be reset to recognized the RS-232 adapter and it doesn't disturb the mrs tv viewing. I was pleasantly surprised when the first adapter I plugged in was recognized and my standard RS-232 computer to computer cable worked.

I wrote a program that works with my Hava Platinum HD. I have been using the Hava program to change channels and record programs to a PC. Hava does not have a UI so I have hacked a system where I scan the active windows and locate the buttons on the virtual remote. I can then click button by sending mouse down/up messages. It works, but there is no feedback to tell if the channel really changed. I am trying to enhance it by using RS-232.

The first problem I have is sometime the wife puts the DVR in standby and then the Hava records a blank screen. I have the Wakup command on RS-232 working, so that one is fixed.

The second problem is sometimes two program are recording on the DVR and the channel won't change. With RS-232 I can read the active channel and detect this.

I got the change channel command to work and was a little disappointed when I found that no error code is returned if the DVR is already recording on both tuners. The status just comes back that the command worked. I got the GetCurrentChannel command to work so I can verify whether the channel changed.

I have one final issue. If the R15 is recording on the live channel and I send the A6 command to change the channel the screen goes blank. After that all I can do is go back to the channel being recorded. If the DVR is not recording the channel changes fine.

I am wondering if I will see the same thing on the HR21. Or could I be doing something wrong.

I am going to try changing the channel by sending remote control button commands instead.
Update: Changing the channel by sending remote control button commands works on my R15. I think the A6 command not working has to do with how the live tuner is handled.


----------



## dennisj00 (Sep 27, 2007)

I too have the book. Serial is enjoying somewhat of a resurgence with the 'modules' or processors that communicate over SPI or chip level interfaces.

For you bit-bangers, TI is having free seminars on the TI-430 family of low power micros with a free development kit. It's a USB stick with removable -standalone modules that have built-in RF transceivers --looks perfect to send those serial commands to the HR20s throughout the house.

I'm going to one tomorrow and will let you know. Search for '430 day' on TI.com.


----------

