View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 11 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Mon May 04, 2009 10:21 am 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
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


Last edited by christ on Sun May 09, 2010 7:15 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 04, 2009 11:38 am 
Offline
Joined: Tue Sep 26, 2006 9:35 am
Posts: 85
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


Top
 Profile  
 
PostPosted: Sat Feb 20, 2010 11:19 am 
Offline
Joined: Thu Jan 13, 2005 9:55 am
Posts: 135
Location: Decatur, Ga., USA
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

_________________
R7.3 Backend
CPU: 1.8 GHz
RAM: 2Gb
Drives: 500Gb IDE; IDE DVD-RW
Mobo: eMachines
Tuners (Analog): PVR-250
Tuners (Digital): DCT-6200 Motorola Cable Box, HDHomeRun (OTA + cable)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 20, 2010 1:46 pm 
Offline
Joined: Tue Sep 26, 2006 9:35 am
Posts: 85
If it compiled ok, then you probably need to copy it somewhere in your path, perhaps /usr/local/bin?

Mark


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 20, 2010 4:22 pm 
Offline
Joined: Thu Jan 13, 2005 9:55 am
Posts: 135
Location: Decatur, Ga., USA
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

_________________
R7.3 Backend
CPU: 1.8 GHz
RAM: 2Gb
Drives: 500Gb IDE; IDE DVD-RW
Mobo: eMachines
Tuners (Analog): PVR-250
Tuners (Digital): DCT-6200 Motorola Cable Box, HDHomeRun (OTA + cable)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 21, 2010 10:00 am 
Offline
Joined: Sun Sep 25, 2005 3:50 pm
Posts: 1013
Location: Los Angeles
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

_________________
Mike
My Hardware Profile


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 21, 2010 10:11 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 21, 2010 4:17 pm 
Offline
Joined: Thu Jan 13, 2005 9:55 am
Posts: 135
Location: Decatur, Ga., USA
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

_________________
R7.3 Backend
CPU: 1.8 GHz
RAM: 2Gb
Drives: 500Gb IDE; IDE DVD-RW
Mobo: eMachines
Tuners (Analog): PVR-250
Tuners (Digital): DCT-6200 Motorola Cable Box, HDHomeRun (OTA + cable)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 22, 2010 7:38 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2010 8:09 pm 
Offline
Joined: Thu Jan 13, 2005 9:55 am
Posts: 135
Location: Decatur, Ga., USA
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

_________________
R7.3 Backend
CPU: 1.8 GHz
RAM: 2Gb
Drives: 500Gb IDE; IDE DVD-RW
Mobo: eMachines
Tuners (Analog): PVR-250
Tuners (Digital): DCT-6200 Motorola Cable Box, HDHomeRun (OTA + cable)


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 09, 2010 6:59 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
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/


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Google [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu