[mythtv-users] New Sky+ App - control Sky box via tcp/ip network

Dave Pearson lists at the-pearsons.co.uk
Fri Dec 14 12:05:28 UTC 2012


-----Original message-----
> From:Michael Watson <michael at thewatsonfamily.id.au <mailto:michael at thewatsonfamily.id.au> >
> Sent: Friday 14th December 2012 5:51
> To: Discussion about MythTV <mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org> >
> Subject: Re: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network
> 
> On 14/12/2012 4:42 PM, Dave Pearson wrote:
> > RE: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network
> >
> >     -----Original message-----
> >     *From:* Michael Watson <michael at thewatsonfamily.id.au <mailto:michael at thewatsonfamily.id.au> >
> >     *Sent:* Fri 14-12-2012 00:10
> >     *Subject:* Re: [mythtv-users] New Sky+ App - control Sky box via
> >     tcp/ip network
> >     *To:* Discussion about MythTV <mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org> >;
> >     On 14/12/2012 10:54 AM, Michael Watson wrote:
> >     >
> >     > Try changing the header line to this
> >     >
> >     > headers=  { "SOAPACTION":
> >     > "urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI"}
> >     >
> >     Or
> >
> >     headers=  { "Content-Length": "%d" % len(XML), "SOAPACTION":
> >     "urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI",
> >     "Content-Type": "text/xml; char-set=utf-8"  }
> >
> >
> >     >
> >     > Regards,
> >     > Michael Watson
> >     >
> >
> >     _______________________________________________
> >     mythtv-users mailing list
> >     mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org> 
> >     http://www.mythtv.org/mailman/listinfo/mythtv-users <http://www.mythtv.org/mailman/listinfo/mythtv-users> 
> >
> >
> >  Hi,
> >
> > Thanks for the suggestions, the second of them seems to be the 
> > closest, but sadly it still fails with this error:
> >
> > 500 Internal Server Error
> >
> > <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope <http://schemas.xmlsoap.org/soap/envelope> /" 
> > s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding <http://schemas.xmlsoap.org/soap/encoding> /">
> >
> > <s:Body>
> >
> > <s:Fault>
> >
> > <faultcode>s:Client</faultcode>
> >
> > <faultstring>UPnPError</faultstring>
> >
> > <detail>
> >
> > <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
> >
> > <errorCode>-111</errorCode>
> >
> > <errorDescription>Invalid Action</errorDescription>
> >
> > </UPnPError>
> >
> > </detail>
> >
> > </s:Fault>
> >
> > </s:Body>
> >
> > Regards,
> >
> > Dave.
> >
> >
> Ok, lets see whats going on.  Download nettool from 
> http://sourceforge.net/projects/nettool <http://sourceforge.net/projects/nettool> /
> Extract the zip file, and chmod +x start-nettool.sh
> run the start-nettool.sh script, then click on TCP Tunnel.
> Make sure the Listen On details are "all local addresses" and port "49153"
> Set the Tunnel to Details to ip address of the skybox and port 49153.  
> Click Listen
> 
> Use firefox as you did previously, but use localhost (or 127.0.0.1) as 
> the address instead of 192.168.1.202
> We should see all the output that firefox sends and the skybox returns.  
> Please post the contents of both windows.
> 
> Once we work this out, Ill give you a complete channel change script.
> 
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org> 
> http://www.mythtv.org/mailman/listinfo/mythtv-users <http://www.mythtv.org/mailman/listinfo/mythtv-users> 
> 

Hi Michael,

Thanks very much for your help with this.

This is what nettool recorded when I used Poster:

POST /SkyPlay2 HTTP/1.1
Host: 192.168.1.250:49153
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
SOAPACTION: "urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI"
Content-Type: text/xml; charset=UTF-8
Content-Length: 408
Cookie: __utma=78958164.946757379.1354785368.1354785368.1354785368.4; __utmz=78958164.1354785368.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESSION-GUID=m8v9lrxfpks; __jwpusr=c461999f-789b-4497-b8b5-d894df56d717
Pragma: no-cache
Cache-Control: no-cache

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:SetAVTransportURI xmlns:u="urn:schemas-nds-com:service:SkyPlay:2">
<InstanceID>0</InstanceID>
<CurrentURI>xsi://9c7</CurrentURI>
<CurrentURIMetaData>NOT_IMPLEMENTED</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>



This is what nettool recorded when I used your python script

POST /SkyPlay2 HTTP/1.1
Host: 192.168.1.250:49153
Accept-Encoding: identity
SOAPACTION: urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI
Content-Length: 409
Content-Type: text/xml; char-set=utf-8

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:SetAVTransportURI xmlns:u="urn:schemas-nds-com:service:SkyPlay:2">
<InstanceID>0</InstanceID>
<CurrentURI>xsi://fa6</CurrentURI>
<CurrentURIMetaData>NOT_IMPLEMENTED</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>

As you can see, the two conversations are different, I'm pretty sure that, even with my limited knowledge of python, once we can get the channel change part working correctly, I can do the rest to accept the channel number as input and then use a lookup table to get the correct hex code to send to the Sky box. I think I'll even be able to interrogate the box to find out what channel it is on before and after the script runs (which is important, because there is an error generated if I try to switch to the channel it's already on.

Regards,
Dave.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20121214/0f09d233/attachment.html>


More information about the mythtv-users mailing list