LinHES Forums
http://forums.linhes.org/

HOWTO: firewire Power ON, change channels on SA boxes
http://forums.linhes.org/viewtopic.php?f=11&t=19838
Page 1 of 1

Author:  christ [ Mon May 04, 2009 10:21 am ]
Post subject:  HOWTO: firewire Power ON, change channels on SA boxes

NOTE: This has now been superseded by stb-command see: http://mysettopbox.tv/phpBB2/viewtopic. ... 193#128193

Hi folks,

This HOW-TO enables you to control power on/off a Scientific Atlanta Set Top Box (STB) and subsequently change channels.

This weekend, I was motivated to move my analogue connections to digital. I now have two of my Scientific Atlanta set top boxes (SA3250HD and an SA4250HD) connected in via s-video to my PVR-500 card and the channel changing is done via ieee1394 (firewire).

The channel changer included with KM is the older version and could not handle more than one STB; however I did find one that works at:
http://ubuntuforums.org/showthread.php?t=756508 . It also has an example of converting the GUID to a Node.

The next issue was to find a way to ensure the set top box is turned on before changing channels. There are many reasons why it might get powered off (upgrades, remote resets, power glitches, etc). Others have done some strange things to determine this but this program uses the actual commands and should be very reliable.

Nothing seemed available so I wrote a program called sa3250cmd to be able to power on or off the STB and also to check the current state of the STB.

Because I run multiple STBs on one firewire link, I also wrote a script which
* accepts the unique GUID of the STB as an input,
* converts it to the correct node
* checks current power state & powers the STB on if needed
* changes the channel

The project page and all downloads are at: http://code.google.com/p/sa3250cmd/

Included on the project page is the following:
* the program sa3250cmd.c and its Makefile
* a script which takes a GUID and executes the command (based on grytpype's example)
* a script which takes a GUID, ensure STB is on, and changes channel

Although, I currently only implemented on, off, status, I am happy to add other commands if desired. Just let me know what the command code is and what it does.

The new command is used as follows:
Code:
USAGE: Usage: sa3250cmd [-v] -n <node> <command>
         -v : Verbose Mode
         -n : Node to change - required
  <command> : on, off, status
 
RETURN Value: Dependent on command
              -1 = error
               0  = success but no return value
               on, off, and status return:
                  1 = OFF
                  2 = ON


I will eventually look to add this to the mythtv contribs. As soon as I figure out the proper process for doing so.

Enjoy!

Christian

Author:  mlbuser [ Mon May 04, 2009 11:38 am ]
Post subject: 

Very nice, it doesn't happen often, but once in a while the box will be off and we get a couple of empty recordings. I'll be checking this out.

Thanks,


Mark

Author:  steeve [ Sat Feb 20, 2010 11:19 am ]
Post subject:  Re: HOWTO: firewire Power ON, change channels on SA boxes

christ wrote:
Hi folks,

This HOW-TO enables you to control power on/off a Scientific Atlanta Set Top Box (STB) and subsequently change channels.

This weekend, I was motivated to move my analogue connections to digital. I now have two of my Scientific Atlanta set top boxes (SA3250HD and an SA4250HD) connected in via s-video to my PVR-500 card and the channel changing is done via ieee1394 (firewire).

The channel changer included with KM is the older version and could not handle more than one STB; however I did find one that works at:
http://ubuntuforums.org/showthread.php?t=756508 . It also has an example of converting the GUID to a Node.

The next issue was to find a way to ensure the set top box is turned on before changing channels. There are many reasons why it might get powered off (upgrades, remote resets, power glitches, etc). Others have done some strange things to determine this but this program uses the actual commands and should be very reliable.

Nothing seemed available so I wrote a program called sa3250cmd to be able to power on or off the STB and also to check the current state of the STB.

Because I run multiple STBs on one firewire link, I also wrote a script which
* accepts the unique GUID of the STB as an input,
* converts it to the correct node
* checks current power state & powers the STB on if needed
* changes the channel

The project page and all downloads are at: http://code.google.com/p/sa3250cmd/

Included on the project page is the following:
* the program sa3250cmd.c and its Makefile
* a script which takes a GUID and executes the command (based on grytpype's example)
* a script which takes a GUID, ensure STB is on, and changes channel

Although, I currently only implemented on, off, status, I am happy to add other commands if desired. Just let me know what the command code is and what it does.

The new command is used as follows:
Code:
USAGE: Usage: sa3250cmd [-v] -n <node> <command>
         -v : Verbose Mode
         -n : Node to change - required
  <command> : on, off, status
 
RETURN Value: Dependent on command
              -1 = error
               0  = success but no return value
               on, off, and status return:
                  1 = OFF
                  2 = ON


I will eventually look to add this to the mythtv contribs. As soon as I figure out the proper process for doing so.

Enjoy!

Christian


Christian,
I have to ask the dumb question <sorry>:
How do we use this in R6?

I tried compiling it, but when I try to run it I get a "command not found" error.

-sTv

Author:  mlbuser [ Sat Feb 20, 2010 1:46 pm ]
Post subject: 

If it compiled ok, then you probably need to copy it somewhere in your path, perhaps /usr/local/bin?

Mark

Author:  steeve [ Sat Feb 20, 2010 4:22 pm ]
Post subject: 

mlbuser wrote:
If it compiled ok, then you probably need to copy it somewhere in your path, perhaps /usr/local/bin?

Mark


I *think* it compiled correctly (no errors), and there is a "sa3250cmd" in /usr/local/bin...it is executable...hmmm....okay, I'm lost.

-sTv

Author:  mihanson [ Sun Feb 21, 2010 10:00 am ]
Post subject: 

I don't believe /usr/local/bin is in your $PATH by default under R6.
Code:
$ echo $PATH
will show you what it currently is. If /usr/local/bin not there you can add it by editing /etc/profile and logging out and back in. Alternatively, simply use the full file path to your executable.
Code:
$ /usr/local/bin/sa3250cmd

Author:  tjc [ Sun Feb 21, 2010 10:11 am ]
Post subject: 

To check whether bash can find a command use the "type" builtin command. Start with:
Code:
type -a sa3250cmd

If this doesn't show anything, then the directory isn't in your path. To verify this follow Mike's suggestion for looking at your PATH setting.

Author:  steeve [ Sun Feb 21, 2010 4:17 pm ]
Post subject: 

tjc wrote:
To check whether bash can find a command use the "type" builtin command. Start with:
Code:
type -a sa3250cmd

If this doesn't show anything, then the directory isn't in your path. To verify this follow Mike's suggestion for looking at your PATH setting.


Done and done. Thanks, tjc and Mike. My "Linux noob" gene is gloriously expressing itself...

-sTv

Author:  christ [ Mon Feb 22, 2010 7:38 pm ]
Post subject: 

sorry for the delay, i was traveling last week but I see our friends have answered your question.

I use this on R6 with no issues.

Author:  steeve [ Fri Mar 05, 2010 8:09 pm ]
Post subject: 

christ wrote:
sorry for the delay, i was traveling last week but I see our friends have answered your question.

I use this on R6 with no issues.


No prob. I now use this in my master backend shutdown script to turn off the cable box when the master backend is shutting down.

Works perfectly...almost. Every once in a while the cable box does not turn off, and I haven't tried to figure out why. It's no biggie, I'll live with it.

-sTv

Author:  christ [ Sun May 09, 2010 6:59 pm ]
Post subject: 

I have now generalized this and added a bunch of new commands. The new version can be found at: http://code.google.com/p/stb-command/

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/