SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-17-2009, 12:48 PM
moamoa's Avatar
moamoa moamoa is offline
Sage Advanced User
 
Join Date: Nov 2006
Posts: 118
How to control Client/Server via TCP/IP socket

Hi,

Is is possible to open a network socket to a SageTVClient and then send commands to it in order to control it?

Basically, like a remote control but over the network rather then IR.

If this is possible, is that any documentation the outlines the process and the commands that can be sent in order to control it?

Thanks.
__________________
SageTV Server 7.0.23 - SageTV Client on 50" Plasma - HD100 Extender on 42" Plasma - HD300 on 92" Espon EH-TW3200 Projector 5.1 DB/DTS on all clients.
Reply With Quote
  #2  
Old 07-17-2009, 01:20 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Yep, its very possible, although not quite like you're describing. Check out Neilm's webserver which has a webremote that lets you send commands via HTTP requests.
Reply With Quote
  #3  
Old 07-17-2009, 01:45 PM
sic0048 sic0048 is offline
Sage Icon
 
Join Date: Nov 2007
Posts: 1,343
Actually I think the command are routed to the Sage Server which uses the API to actually control the clients. The end result is the same, but I'm not sure you can control a HD-200 in stand alone mode via this method. There is no connection with the Sage Server in stand alone mode, so there is no communication pathway open.

I know we use this method in CQC to control just about all the variables of a Sage system. But it doesn't work with a HD-200 in standalone mode while it works fine for a HD-200 (or other extenders/clients) that are using the SageTV software connection.
__________________
i5 quad core server with about 10tb of space currently
SageTV v9 (64bit)
Ceton InfiniTV ETH 6 cable card tuner (Spectrum cable)
OpenDCT
HD-300 HD Extenders (hooked to my whole-house A/V system for synched playback on multiple TVs - great during a Superbowl party)
Amazon Firestick 4k and Nvidia Shield using the MiniClient
Using CQC to control it all
Reply With Quote
  #4  
Old 07-17-2009, 01:58 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
It's fairly trivial for someone who knows Java to write a background class that runs in the SageTV process, accepts a telnet connection, listens for commands, and passes them to the SageCommand() API method. (This is more or less what the web server does, except that it uses an HTTP connection instead of a telnet connection.)

For clients that execute the UI on the server (i.e. Extender and Placeshifter clients), the listener class must run on the server. For SageTV Client, which executes the UI locally, the listener class must run on the client. (So if you want to control SageTV Client via the web server, you must install it on the client as well as on the server.)
__________________
-- Greg
Reply With Quote
  #5  
Old 07-17-2009, 02:14 PM
nyplayer nyplayer is online now
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,644
Quote:
Originally Posted by moamoa View Post
Hi,

Is is possible to open a network socket to a SageTVClient and then send commands to it in order to control it?

Basically, like a remote control but over the network rather then IR.

If this is possible, is that any documentation the outlines the process and the commands that can be sent in order to control it?

Thanks.
Did you checkout the SageTV Remote Control here?

http://forums.sagetv.com/forums/down...do=file&id=270
__________________
Windows 10 I3 Dual Core 3.0 Server, SageTV9... OpenDCT with 2 HDHRPrimes and 4 HDHRconnects for a total of 14 Tuners.

Last edited by nyplayer; 07-17-2009 at 02:19 PM.
Reply With Quote
  #6  
Old 07-17-2009, 02:18 PM
smoothtlk smoothtlk is offline
Sage User
 
Join Date: Jan 2007
Location: Metamora, Michigan
Posts: 23
Both MainLobby and CQC automation software can control and see status of SageTV and Sage Extenders. Both use the TCPServer that Fonceur / Beelzerob have been supporting. All connections are via TCP.
__________________
Allonis LLC.
Reply With Quote
  #7  
Old 07-17-2009, 02:32 PM
moamoa's Avatar
moamoa moamoa is offline
Sage Advanced User
 
Join Date: Nov 2006
Posts: 118
Quote:
Originally Posted by GKusnick View Post
It's fairly trivial for someone who knows Java to write a background class that runs in the SageTV process, accepts a telnet connection, listens for commands, and passes them to the SageCommand() API method. (This is more or less what the web server does, except that it uses an HTTP connection instead of a telnet connection.)
This sounds just about perfect for what I want.

Can you point me at the docs to this SageCommand() api, java I hope.

Also, any simple examples of how to make my java class install in to sage and any example of how to use the API to execute a commands such as "Play" or something.

Point me in the right direction and I'll have a go!
__________________
SageTV Server 7.0.23 - SageTV Client on 50" Plasma - HD100 Extender on 42" Plasma - HD300 on 92" Espon EH-TW3200 Projector 5.1 DB/DTS on all clients.
Reply With Quote
  #8  
Old 07-17-2009, 02:48 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
See the Studio Information Resources sticky for links to the SageTV API docs.

Java API docs are at http://java.sun.com/javase/6/docs/api/.

There are numerous examples in the Downloads section of plugins that run as background classes in the SageTV process. Some of them (the web server for example) include source, or have links to publicly accessible source. But basically it's just a matter of implementing the Runnable interface and adding your fully-qualified class name to the load_at_startup_runnable_classes property.
__________________
-- Greg
Reply With Quote
  #9  
Old 07-17-2009, 03:30 PM
moamoa's Avatar
moamoa moamoa is offline
Sage Advanced User
 
Join Date: Nov 2006
Posts: 118
thanks that's a big help.

I've downloaded;
sagex.api-6.5.15-5.zip

I've upzipped this into my server (JARS) and restarted it.

Is there something else I need to do configuration wise, as typing this;
http://<my-server-ip>/sagex/api
into the browser is doing nothing?

From the docs
Quote:
The /sagex/api handler has documentation built into the handler. If you call this handler from a browser without any arguments, it will return a page that shows the basic usage and the api documentation.
Am I missing something?




Quote:
Originally Posted by GKusnick View Post
See the Studio Information Resources sticky for links to the SageTV API docs.

Java API docs are at http://java.sun.com/javase/6/docs/api/.

There are numerous examples in the Downloads section of plugins that run as background classes in the SageTV process. Some of them (the web server for example) include source, or have links to publicly accessible source. But basically it's just a matter of implementing the Runnable interface and adding your fully-qualified class name to the load_at_startup_runnable_classes property.
__________________
SageTV Server 7.0.23 - SageTV Client on 50" Plasma - HD100 Extender on 42" Plasma - HD300 on 92" Espon EH-TW3200 Projector 5.1 DB/DTS on all clients.
Reply With Quote
  #10  
Old 07-17-2009, 03:58 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,682
Quote:
Originally Posted by moamoa View Post
thanks that's a big help.

I've downloaded;
sagex.api-6.5.15-5.zip

I've upzipped this into my server (JARS) and restarted it.

Is there something else I need to do configuration wise, as typing this;
http://<my-server-ip>/sagex/api
into the browser is doing nothing?

From the docs

Am I missing something?
This wasn't exactly what Greg was referring to... but since you asked, check out this page for instructions on enabling these apis in the neilm webserver or the jetty server. (i personally recommend the jetty server method).

EDIT: BTW, I just updated the wiki, because I realized the install instructions for jetty was outdated.

Last edited by stuckless; 07-17-2009 at 04:01 PM.
Reply With Quote
Reply


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

Advanced Search
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
SageTV: DVB-S2 streaming ueber TCP/IP popdog SageTV Germany 2 06-16-2009 01:11 AM
Delay and double clicks while controlling extender via TCP personalt SageTV Media Extender 2 09-17-2008 05:23 PM
Hauppauge's TCP/IP Optimization Taddeusz SageTV Media Extender 2 06-14-2007 01:11 PM
2-way TCP control of SageTV from CQC, anyone? IVB SageTV Customizations 5 08-26-2006 09:06 PM
W/PVR250 in client can client remote control server? mdmint General Discussion 8 05-01-2004 07:33 PM


All times are GMT -6. The time now is 05:25 PM.


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