SageTV Community  

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

Notices

SageTV v9 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 9 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 9 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-20-2017, 12:19 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
sagex api

Installed the sagex API plugin (image attached)

The documentation says:

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.
Cannot seem to access the API:

Quote:
hxxp:://localhost/sagex/api
This returns nothing... not found (image attached)

I can see in the log file that sagex api gets loaded but says failed:

Quote:
Mon 2/20 10:10:15.248 [SageTV@9470df] LOADED PLUGINS=[SageTVPlugin[sagex-api state=Failed name=sagex-api - SageTV API Extensions version=9.0.0.8 type=Library desc=SageTV API Wrappers with Remote API capabilities author=stuckless screenshots=null videos=null modified=8/21/2016 installed=2/20/2017 resPath=sagex-api webpages=[http://forums.sagetv.com/forums/showthread.php?t=36044] implementation= desktopOnly=false serverOnly=false OS=Win,Linux,Mac dependencies=[PluginDependency[Java minVer=1.7 type=JVM], PluginDependency[SageTV minVer=9.0.0 type=Core]] packages=null], SageTVPlugin[googleweather state=Failed name=Google Weather version=2.0.3 type=Library desc=A weather support library that is used by SageTV's updated weather system to retrieve weather information from Weather Underground. author=Opus4 screenshots=null videos=null modified=7/1/2015 installed=2/13/2017 resPath= webpages=null implementation= desktopOnly=false serverOnly=false OS=Win,Linux,Mac dependencies=null packages=null]]
Mon 2/20 10:10:15.255 [LibraryImporter@1f5eec7] Starting to scan lib import root: \\nas\public\Videos
Mon 2/20 10:10:15.260 [SageTV@9470df] Starting all core plugins...
Mon 2/20 10:10:15.265 [SageTV@9470df] Done starting core plugins.
Mon 2/20 10:10:15.276 [PSNATMGR@bd279a] Starting UPnP NAT Manager...
Mon 2/20 10:10:15.281 [PluginRepoUpdater@1b40511] Checking to see if the plugin repository file SageTVPlugins.xml needs to be updated using MD5 URL: http://download.sagetv.com/SageTVPlugins.md5.txt
Mon 2/20 10:10:15.302 [LibraryImporter@1f5eec7] Seeker has finished the library import scan.
Mon 2/20 10:10:15.441 [PluginRepoUpdater@1b40511] Local plugin repository file's checksum matches server's, no need to download a new one for SageTVPlugins.xml
Mon 2/20 10:10:15.446 [PluginRepoUpdater@1b40511] Checking to see if the plugin repository file SageTVPluginsV9.xml needs to be updated using MD5 URL: https://raw.githubusercontent.com/Op...VPluginsV9.md5
Mon 2/20 10:10:16.039 [PluginRepoUpdater@1b40511] Local plugin repository file's checksum matches server's, no need to download a new one for SageTVPluginsV9.xml
Mon 2/20 10:10:16.045 [PluginRepoUpdater@1b40511] Analyzing plugin repository XML file: SageTVPlugins.xml
Mon 2/20 10:10:16.167 [PluginRepoUpdater@1b40511] Done processing plugin repository XML file[SageTVPlugins.xml] repositoryVersion=1.0.1988
Mon 2/20 10:10:16.173 [PluginRepoUpdater@1b40511] Analyzing plugin repository XML file: SageTVPluginsV9.xml
Mon 2/20 10:10:16.184 [PluginRepoUpdater@1b40511] Done processing plugin repository XML file[SageTVPluginsV9.xml] repositoryVersion=2017.0216.2144
This is SageTV 9 with Java 8.

Please let me know what I am doing incorrectly.
Attached Images
File Type: png sagex-plugin-installed.PNG (605.0 KB, 203 views)
File Type: png sagex-not found.PNG (13.7 KB, 207 views)
Reply With Quote
  #2  
Old 02-20-2017, 12:30 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Is your server really hxxp:://localhost/sagex/api or should it be hxxp:://localhost:8080/sagex/api (ie default sagetv web server port is 8080)
Reply With Quote
  #3  
Old 02-20-2017, 12:57 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
oops...

1. installed sagex-api instead of sagex-services...
2. url is: localhost:8080/sagex/api not localhost/sagex/api

after installing sagex-services and restarting works.
Reply With Quote
  #4  
Old 02-20-2017, 01:01 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
From the sagex doc:

http://download.sage.tv/api/sage/api...g.String, int)


Quote:
TransmitCommandUsingInfraredTuningPlugin

public void TransmitCommandUsingInfraredTuningPlugin(java.lang.String TuningPlugin,
int TuningPluginPort,
java.lang.String RemoteName,
java.lang.String CommandName,
int RepeatFactor)
Causes SageTV to instruct the specified tuning plugin to send a command
Parameters:
TuningPlugin - the name of the tuning plugin that should send the command
TuningPluginPort - the name of the port the specified tuning plugin is on
RemoteName - the name of the 'Remote Control' that should be used to send the command
CommandName - the name of the command to be sent
RepeatFactor - the 'repeat factor' to use for sending the infrared command, 2 is the default


So the format would be:

Code:
http://hostname:8080/sagex/api?c=TransmitCommandUsingInfraredTuningPlugin&1=TuningPlugin&2=TuningPluginPort&3=RemoteName&4=CommandName
What should be used for parameters for the built in USB-UIRT tuning?
Reply With Quote
  #5  
Old 02-20-2017, 01:24 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
tried:

http://10.0.0.25:8080/sagex/api/?c=G...putBeingViewed

while watching a source that uses OpenDCT with my BM3000-HDMI and it returns empty:

Quote:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Result/>
How do I identify the parameters to use with the call to "TransmitCommandUsingInfraredTuningPlugin"?


A call to:

returns:

Quote:
<Result size="2">
<Item>
<![CDATA[ ACTiSYS IR200L ]]>
</Item>
<Item>
<![CDATA[ USB-UIRT Transceiver ]]>
</Item>
</Result>

I have no idea how to identify the parameters for the tuner being used to send a call to the tuner to change channel...

See attached image for source I am trying to change the channel for...


Thanks in advance.
Attached Images
File Type: jpg SageTV Network Encoder BM3000-HDMI source.jpg (104.4 KB, 197 views)
Reply With Quote
  #6  
Old 02-20-2017, 01:41 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
Ran this command:

Code:
http://10.0.0.25:8080/sagex/api/?c=GetActiveCaptureDevices
Output:

Code:
Result size="3">
<Item>
<![CDATA[
DCT-HDHomeRun Prime Tuner 131104FC-0 on 127.0.0.1:9000
]]>
</Item>
<Item>
<![CDATA[ STB-2 on 127.0.0.1:9000 ]]>
</Item>
<Item>
<![CDATA[ STB-1 on 127.0.0.1:9000 ]]>
</Item>
</Result>
Then tried:

Code:
http://10.0.0.25:8080/sagex/api/?c=GetInfraredTuningPlugin&1=%22STB-2%20on%20127.0.0.1:9000%22
which returned this empty:


this:

Code:
http://10.0.0.25:8080/sagex/api/?c=GetInfraredTuningPluginPortNumber&1=%22STB-2%20on%20127.0.0.1:9000%22
also returns empty:

Code:
<Result/>
Please advise.

Last edited by sflamm; 02-20-2017 at 01:45 PM.
Reply With Quote
  #7  
Old 02-20-2017, 01:50 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
this:

Code:
http://10.0.0.25:8080/sagex/api/?c=GetInfraredTunerRemoteName&1="STB-2%20on%20127.0.0.1:9000"
also returns empty:


Quote:
<Result/>
Reply With Quote
  #8  
Old 02-20-2017, 03:16 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I don't know much about this stuff... but it appears that you are passing a CaptureDevice when you need a CaptureDeviceInput.

Try calling GetCaptureDeviceInputs to with a capture device to get the list of inputs...and then call your GetInfraredTunerRemoteName with one of those values.

btw, you don't need %22 (quote) and you don't need leading and trailing spaces (%20) since chrome is just adding that for readability.
Reply With Quote
  #9  
Old 02-21-2017, 12:42 AM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
Thanks that worked!

I've created a working powershell script that can tune the USB-UIRT channels remotely:

Code:
Param([string]$TunerNumber, [string]$ChannelNumber)


$ChannelNumberArray = $ChannelNumber.ToCharArray()

$TuningCommand = "http://10.0.0.25:8080/sagex/api/?c=TransmitCommandUsingInfraredTuningPlugin"
$TuningPlugin = "&1=USB-UIRT Transceiver"
$TuningPluginPort = "&2=0"
$BaseRemoteName = "PaceRNG150"
$RemoteName = "&3=" + $BaseRemoteName + "-" + $TunerNumber
$RepeatFactor = "&5=2"

$Username = "sage"
$Password = "frey"

$Headers = @{ Authorization = "Basic {0}" -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $Username,$Password))) }

$Output = "output.txt"


foreach ($digit in $ChannelNumberArray) {

#Write-Output ********

$CommandName = "&4=$digit"
$Uri = $TuningCommand +  $TuningPlugin + $TuningPluginPort + $RemoteName + $CommandName + $RepeatFactor

Write-Output uri:$Uri

Invoke-RestMethod -Uri $Uri -Headers $Headers -Outfile $Output
This can be used with OpenDCT for the tuning executable.
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
sagex help needed Skirge01 SageTV v7 Customizations 4 04-16-2016 07:46 PM
sagex-api Plugin MISSING: sagex-api-FAILED http://ubuntone.com/5NNCHGlywxvXBgRw8B3nMr antplugger SageTV v7 Customizations 10 06-10-2014 01:34 AM
sagex-api - how can I tell if it works? gveres SageTV v7 Customizations 2 01-27-2012 10:56 PM


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


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