SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-27-2008, 09:59 AM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Powering on and off extender via API?

There's been some clamoring for this capability, and I wasn't aware that the java API included it. I added in the SageCommands of "Power On" and "Power Off", but according to them, those only cause it to go in and out of sleep mode, not actually powering on or off. I've put in "Quit" also, but to my knowledge, that causes Sage itself to quit.

Is there any API command to control the extenders power setting?
Reply With Quote
  #2  
Old 05-27-2008, 12:16 PM
matt91's Avatar
matt91 matt91 is offline
Sage Icon
 
Join Date: Feb 2005
Location: Washington, DC
Posts: 1,185
It can be done with Nielms www server, so it would seem to be possible.
__________________
Server: Ubuntu 16.04 running Sage for Linux v9
Reply With Quote
  #3  
Old 05-27-2008, 12:59 PM
CollinR CollinR is offline
Sage Icon
 
Join Date: Dec 2004
Location: Tulsa, OK
Posts: 1,305
I dunno about that, when I do it with the webserver it's only a soft off.

Why do they want to cold boot the thing?
Reply With Quote
  #4  
Old 05-27-2008, 01:41 PM
matt91's Avatar
matt91 matt91 is offline
Sage Icon
 
Join Date: Feb 2005
Location: Washington, DC
Posts: 1,185
Quote:
Originally Posted by CollinR View Post
I dunno about that, when I do it with the webserver it's only a soft off.
Red light off (on my MVPs), to me, meant power off. I didn't think that it was asleep.
__________________
Server: Ubuntu 16.04 running Sage for Linux v9
Reply With Quote
  #5  
Old 05-27-2008, 02:13 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by matt91 View Post
Red light off (on my MVPs), to me, meant power off. I didn't think that it was asleep.
I believe one of the updates for the MVP was to turn the light off when it was put into soft-off mode with the remote or with the web server - but I'm just going off of memory on this.
Reply With Quote
  #6  
Old 05-27-2008, 02:28 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
When they're off (either extender) they're no longer connected to the server, so there'd be no way to turn them back on.
Reply With Quote
  #7  
Old 05-27-2008, 02:56 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
ok....I didn't know if maybe Sage could write to a network port to turn it back on..some kind of WOL thing.

As for why they want it...well, it's mainly one person, and I think he's having some kind of other issues. He said that the extender tends to freeze up, and a quick "reboot" clears it up. Of course, the better solution would be to figure out why it's freezing, but I think I saw a thread indicating he's not the only one having that issue.

The better reason was he said that his extender appeared to shut off by itself after a while...and his extender is in a remote part of the house, so it's cumbersome to have to go to it to turn it back on..it's something he'd rather be able to do remotely.

I know many people point to the webserver as proof it can be done, but you're saying that's just the soft on/soft off also?
Reply With Quote
  #8  
Old 05-27-2008, 03:25 PM
carlgar carlgar is offline
Sage Icon
 
Join Date: Oct 2003
Location: Brentwood, TN
Posts: 1,866
Quote:
Originally Posted by beelzerob View Post
As for why they want it...well, it's mainly one person, and I think he's having some kind of other issues. He said that the extender tends to freeze up, and a quick "reboot" clears it up. Of course, the better solution would be to figure out why it's freezing, but I think I saw a thread indicating he's not the only one having that issue.
This is a known issue and using a soft power on/off is the best way to correct it. Sometimes the remote (soft power on/off) appears to be non-responsive. I have found that it will be responsive if you wait 3-4 minutes. The hard power off is only needed if you are not willing to wait the 3-4 minutes. I have not used the power switch in a long time, since I discovered the 3-4 minute wait solution. When I encounter the lockup, I just hit the power switch on the remote and then wait till I see the extender go off. I then power back on.
__________________
Server : Intel Core i7 2.8 GHz Processor: Gigabyte X58A-UD3R Motherboard: 6 GB Memory : 1 120 GB Intel SSD :3 2 TB WD hard drives:1 Hauppauge PVR 2250: 3 HDHomeRuns:1 HD300 extender;1 HD200 extender;1 HD100 extender 2 MVP Media Extenders: Windows 7 64 bit Home Premium all updates applied, SageTV V7.1.7.254.
Reply With Quote
  #9  
Old 05-27-2008, 07:22 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Quote:
Originally Posted by stanger89 View Post
When they're off (either extender) they're no longer connected to the server, so there'd be no way to turn them back on.
I had a conversation about this with nielm a while back. I can't recall if it was a PM or a forum post. He is using ARP and then telnet to do the power off command. You can't use ARP to determine the ipaddress, but you could just have the IP available if one were to reserve DHCP addresses or static map. You would then be able to telnet back in to turn them back on. You would need to store the info somewhere though like a properties file etc.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #10  
Old 05-27-2008, 07:34 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Man, nielm does all the fancy stuff....

If it involves telneting into the thing to do this on/off thing, then I think I've just about hit the limit of what I'm willing to do to make this work. But what is the "api" of an extender? I can telnet in from the command prompt, but how to I then turn it on or off. Is that documented somewhere?

Ya know, I think I downloaded a recent copy of nielms server, I should just browse that. His code is my Rosetta stone...
Reply With Quote
  #11  
Old 05-27-2008, 08:43 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Quote:
Originally Posted by beelzerob View Post
Man, nielm does all the fancy stuff....

If it involves telneting into the thing to do this on/off thing, then I think I've just about hit the limit of what I'm willing to do to make this work. But what is the "api" of an extender? I can telnet in from the command prompt, but how to I then turn it on or off. Is that documented somewhere?

Ya know, I think I downloaded a recent copy of nielms server, I should just browse that. His code is my Rosetta stone...
Actually, if you tail your server log while you power it off you see the commands scroll by. Or if you're stuck on windows try http://tailforwin32.sourceforge.net/

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #12  
Old 05-28-2008, 01:38 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
MVP and HD100 both run linux. To power them off (and disconnect from the server), you need to telnet to the extender's IP address, login as root (no password), and then...

For an an MVP you need to run:
killall miniclient
For an STX-HD100, run
poweroff
This is the same as hitting the power button on the remote, puts the extender in stanby mode and, most importantly, releases the client licence.

To power it back on, find the remote, or run the command:
MVP: killall sagewait
STX-HD100: unknown, possibly poweron

To warm-reboot (same as unplugging power and replugging -- the OS and sage software are reloaded from the server) run:
reboot


My webserver interface can do poweroff and reboot for an MVP. It may also be able to do it for an HD extender, but some people have reported problems... (the reason it uses ARP is to find the IP address of the extender so that it can connect to it.).


There are 'PowerOff' and 'PowerOn' commands in the Sage API, but this just puts the extenders to sleep/screen saver mode.

(PS: the lines in my webserver code are here
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 05-28-2008 at 01:40 AM.
Reply With Quote
  #13  
Old 05-28-2008, 09:23 AM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Excellent, thanks!

I could just make them enter the IP address of the extender when they install the plugin, so I don't have to search for it...but those can probably be dynamically allocated, can't they? If the extender had a host name, then couldn't I just telnet to that ("telnet hd100") instead of to the IP address?

Time to learn how to telnet with java....TCP I can handle, that was easy.
Reply With Quote
  #14  
Old 05-28-2008, 09:44 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
I looked at the source code, doesn't look too difficult to understand. The other piece is a static html link or get uber fancy and have it read a list of ip addresses from a properties file. The list to power off MVPs/PS Clients/HD100s is built from a query to the sagetv server.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #15  
Old 09-02-2008, 11:14 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by nielm View Post
For an an MVP you need to run:

MVP: killall miniclient
MVP: killall sagewait
For the HD Extender:

HD100: killall miniclient
HD100: killall waitpower
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.