SageTV Community  

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

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-31-2017, 05:54 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
How do you get all contexts listed in sage.properties

In the sage.properties file of SageTV for Windows (on either V7 or V9) there is info stored on the UI contexts like this:
Code:
sagex/uicontexts/001d6a4bffa4/ip=192.168.1.147
sagex/uicontexts/001d6a4bffa4/name=Exercise Rm
sagex/uicontexts/001d6a4bffa4/type=Hardware
But in my V9 file Sage.properties on unRAID I only appear to have the /name line, not the /type or /ip lines. Should those other lines be there or does the Linux server not need this info?

Is this information available via the API or do you have to parse it out of Sage.properties? (Note - some of this info is available with calls to Slugger's Global Helpers code)

GetUIContexts will get the current Global.UIContextNames and Global.GetConnectedClients will get the clients but that is only for currently connected devices. I am pretty sure that the Sage.properties file contains data for all clients/miniclients that have ever been connected to the server.

One other issue with the /ip field is that this info does not appear to be correct to me when the IP changes, such as for DHCP. The IP addresses defined for my extenders are not the correct IP addreses as I recently used DHCP reservations to put them in the 192.168.1.5X range.
__________________
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
  #2  
Old 02-01-2017, 02:30 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
That information is not written by the SageTV core...it must be by some plugin. We only track the client identifiers (MAC addresses) and you can get those by looking at the entries in the clients subfolder based on their filenames.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #3  
Old 02-02-2017, 03:36 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
There are a couple of API calls that can return the addresses of all connected clients, but not the friendly names as you see there. SageTV does not support naming of clients, that is all 3rd party stuff.

GetConnectedClients() will return a list of all connected clients (this is full clients, as in the server based UI (SageTV.exe) and any connected windows clients (SageTVClient.exe). This is a list of IP addresses.
via sagex http://localhost:8080/sagex/api?c=GetConnectedClients

GetUIContextNames() will return a list of all UI Contexts on the server (this is miniclients, extenders, and placeshifter conenctions). This is a list of MAC addresses.
via sagex http://localhost:8080/sagex/api?c=GetUIContextNames
__________________
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
  #4  
Old 02-02-2017, 07:56 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I am aware of that but it will also be useful to get a list of all known clients, whether connected or not, and somebody is storing those in the sage.properties file. It would be nice to be able to be able to get a client (in my case HD200 or HD300) to connect to Sage without actually going and physically turning it on and selecting the server. For example, if you have to restart the docker or the sage service for any reason it will disconnect all clients.

I am trying to figure out how to do this from my server, such as via a web UI. I may try to add this to the Sage web UI using the add-on groovy web pages functionality that Slugger added a few years ago.

The next problem is figuring out how to change the server via a telnet session. It seems different for an HD200 vs an HD300. Rebooting a server via telnet is trivial, changing the server seems to be a bit trickier as it will involve editing some config files but I haven't yet been able to figure out which config files that is.
__________________
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
  #5  
Old 02-02-2017, 08:31 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
You're going to have to script (at least) the telnet session to log in and kill waitpower on the extender anyway, so you might as well use that same script to parse the clients folder to get the addresses of the extenders you are looking for (as Narflex mentioned).
__________________
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
  #6  
Old 02-07-2017, 08:46 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Ideally I would also like to have a script that runs when the SageTV service is being shut down that writes all of the extenders to a file. It might also be wise to send a command to disconnect the extender from the server, which is available in the API as you can do that from the Web UI.

Then when Sage starts up it would read that file and re-attach those extenders, presumably by doing a reboot of the extender unless there is an easier way of restarting the SageTV sessions.

In addition I would like to add a page to the WebUI (using the Groovy WebUI addon pages) that shows all of the contexts in the sage.props file and gives you the option to reboot that extender and reconnect the extender to the given server. But I haven't figured out how to do that yet.

I am currently in a bit of an intermediate stage with multiple SageTV servers but even when I am in my final state I will likely have at least one backup SageTV server that may be needed if anything goes wrong with the production server.
__________________
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
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
Sage.Properties = SageClient.Properties? PeteCress SageTV Software 10 01-11-2011 12:32 PM
Best way to communicate between threads in different UI contexts? tmiranda SageTV Studio 58 05-18-2010 03:21 PM
Tuners listed in the Sage.Properties file? Stuntman Hardware Support 3 04-20-2009 01:27 PM
Difference between SageClient.properties and Sage.properties? morfinx SageTV Software 1 12-30-2006 09:01 AM
When are the Win.bin, Win.bak, Sage.properties, and Sage.properties.autobackup saved? zubblwump SageTV Software 3 01-16-2005 08:54 AM


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


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