SageTV Community  

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

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 01-13-2010, 09:55 PM
bodagetta bodagetta is offline
Sage User
 
Join Date: May 2008
Posts: 11
Sage Server Discovery for iPhone Remote

I have written a remote control app for the iPhone, but I would like to add auto-discovery of Sage Servers. Can someone direct me to the way that the placeshifter client does this?
Reply With Quote
  #2  
Old 01-14-2010, 07:33 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
All I know is it uses port 31100 for the detection system. I'd assume it uses a EDP broadcast. Odds are you'll have to use a packet analyzer to determine what is actually passed.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 01-14-2010, 02:25 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Fuzzy View Post
Odds are you'll have to use a packet analyzer to determine what is actually passed.
Wireshark is useful for this - you can filter it for IP traffic to/from a specific IP to help to narrow down what you are looking for.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #4  
Old 01-29-2010, 02:23 PM
dwalton22 dwalton22 is offline
Sage Advanced User
 
Join Date: Feb 2007
Location: Apex, NC
Posts: 89
Several years ago I started working on a Sage client for xbox media center.
I never finished it but I did keep my notes. Here is what I have on server
discovery....you will notice that there are many many pieces I hadn't figured
out yet. Hope this helps.

Step 1 - Server Discovery
The application is launched (but we do not click "connect" yet) and the client
sends a broadcast packet to UDP port 31100 in an attempt to find any SageTV
servers on the LAN. The initial UDP source port is random, so far the lowest I
have seen is 1133 and the highest is 4429. The payload of this UDP packet is
32 bytes and the first four bytes are 0x53545601 but I have no idea what these
numbers mean. The remainder of the payload is all zeros:

0x53545601 0x00000000000000000000000000000000000000000000000000000000

The server responds with a payload of 15 bytes where the first four bytes are
0x53545602 which is the same as client payload except for a 2 at the end instead
of 1. The 5th byte is 0x01, not sure what this is used for. The next 8 bytes are the
Locator-ID while the remaining 2 bytes are the port number for the server (0x797b
is 31099):

0x53545602 0x01 0x3fd1d5d3a62b4c8f 0x797b

This discovery process repeats itself every 10 seconds until we proceed to Step 2,
the only delta is the UDP source port number which increments by one with each iteration.

Wireshark capture: step_1.pcap

Step 2 - Establish "Media" TCP connection to the server
We click "connect" and establish two TCP sessions to port 31099. The TCP source port
for the first session is random. The lowest source port I have seen is 1183, the highest
is 4434. Once the session is established the client will send two packets to the server.
The payload of the first packet is 7 bytes where the first byte is 0x01 and the remaining
6 bytes contain the MAC address of the client. The payload of the second packet is 1
byte and contains the value 0x01. The value 0x01 indicates to the server that this is the
"media" socket. The server should then respond with a 1 byte payload containing 0x02.
If the server responds with any other value then there has been an error and the session
should be torn down.

The rest can be found here:
http://sagetvplaceshifter.wikidot.co...ial-connection

Last edited by dwalton22; 01-29-2010 at 02:28 PM.
Reply With Quote
  #5  
Old 04-14-2010, 08:44 PM
Addict's Avatar
Addict Addict is offline
Sage Aficionado
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 335
Was this app ever done? Would LOVE this!
__________________
Al Bsharah / Twitter
Clients:
Two STX-HD100 High-Def Extenders
Media Server / NAS:
Case: Thermaltake Armor CPU: AMD Opteron 1218 (2.6GHz Dual Core) Motherboard: ASUS MN2-LR Memory: 2GB Gfx Card: Headless Tuner: Hauppauge HD-PVR, Hauppauge PVR-350 (not in use) O/S: Windows 7 Sage: Latest RAID: On-Board Drives: 6 x 1.5TB SATA RAID-5, 2 x 80GB IDE RAID-1 (O/S) Storage: 7.5TB Total
Reply With Quote
  #6  
Old 04-15-2010, 12:04 AM
tonysathre tonysathre is offline
Sage Advanced User
 
Join Date: Jun 2008
Posts: 233
Quote:
Originally Posted by Addict View Post
Was this app ever done? Would LOVE this!
I second that.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone/iPod Touch web remote interest? maxpower SageTV Customizations 14 02-01-2010 10:23 PM
Another possible iPhone Remote Control for Sage ybrew Hardware Support 0 09-06-2009 01:50 PM
Use of Hauppauge remote on sage server EdPhotoguy Hardware Support 3 09-08-2008 06:07 PM
Will you watch Sage recordings on your iPhone? flavius SageTV Mac Edition 10 07-28-2007 05:24 AM
Test for server discovery by Client Opus4 SageTV Beta Test Software 8 07-27-2005 07:39 PM


All times are GMT -6. The time now is 02:08 AM.


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