<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta name="Generator" content="Zarafa WebApp v7.1.1-37812">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>RE: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network</title>
</head>
<body>
<pre style="white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;" wrap="">-----Original message-----<br>&gt; From:Michael Watson &lt;<a href="mailto:michael@thewatsonfamily.id.au">michael@thewatsonfamily.id.au</a>&gt;<br>&gt; Sent: Friday 14th December 2012 5:51<br>&gt; To: Discussion about MythTV &lt;<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a>&gt;<br>&gt; Subject: Re: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network<br>&gt; <br>&gt; On 14/12/2012 4:42 PM, Dave Pearson wrote:<br>&gt; &gt; RE: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network<br>&gt; &gt;<br>&gt; &gt;     -----Original message-----<br>&gt; &gt;     *From:* Michael Watson &lt;<a href="mailto:michael@thewatsonfamily.id.au">michael@thewatsonfamily.id.au</a>&gt;<br>&gt; &gt;     *Sent:* Fri 14-12-2012 00:10<br>&gt; &gt;     *Subject:* Re: [mythtv-users] New Sky+ App - control Sky box via<br>&gt; &gt;     tcp/ip network<br>&gt; &gt;     *To:* Discussion about MythTV &lt;<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a>&gt;;<br>&gt; &gt;     On 14/12/2012 10:54 AM, Michael Watson wrote:<br>&gt; &gt;     &gt;<br>&gt; &gt;     &gt; Try changing the header line to this<br>&gt; &gt;     &gt;<br>&gt; &gt;     &gt; headers=  { "SOAPACTION":<br>&gt; &gt;     &gt; "urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI"}<br>&gt; &gt;     &gt;<br>&gt; &gt;     Or<br>&gt; &gt;<br>&gt; &gt;     headers=  { "Content-Length": "%d" % len(XML), "SOAPACTION":<br>&gt; &gt;     "urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI",<br>&gt; &gt;     "Content-Type": "text/xml; char-set=utf-8"  }<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;     &gt;<br>&gt; &gt;     &gt; Regards,<br>&gt; &gt;     &gt; Michael Watson<br>&gt; &gt;     &gt;<br>&gt; &gt;<br>&gt; &gt;     _______________________________________________<br>&gt; &gt;     mythtv-users mailing list<br>&gt; &gt;     <a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>&gt; &gt;     <a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;  Hi,<br>&gt; &gt;<br>&gt; &gt; Thanks for the suggestions, the second of them seems to be the <br>&gt; &gt; closest, but sadly it still fails with this error:<br>&gt; &gt;<br>&gt; &gt; 500 Internal Server Error<br>&gt; &gt;<br>&gt; &gt; &lt;s:Envelope xmlns:s="<a href="http://schemas.xmlsoap.org/soap/envelope" target="_blank">http://schemas.xmlsoap.org/soap/envelope</a>/" <br>&gt; &gt; s:encodingStyle="<a href="http://schemas.xmlsoap.org/soap/encoding" target="_blank">http://schemas.xmlsoap.org/soap/encoding</a>/"&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;s:Body&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;s:Fault&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;faultcode&gt;s:Client&lt;/faultcode&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;faultstring&gt;UPnPError&lt;/faultstring&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;detail&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;UPnPError xmlns="urn:schemas-upnp-org:control-1-0"&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;errorCode&gt;-111&lt;/errorCode&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;errorDescription&gt;Invalid Action&lt;/errorDescription&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;/UPnPError&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;/detail&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;/s:Fault&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;/s:Body&gt;<br>&gt; &gt;<br>&gt; &gt; Regards,<br>&gt; &gt;<br>&gt; &gt; Dave.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; Ok, lets see whats going on.  Download nettool from <br>&gt; <a href="http://sourceforge.net/projects/nettool" target="_blank">http://sourceforge.net/projects/nettool</a>/<br>&gt; Extract the zip file, and chmod +x start-nettool.sh<br>&gt; run the start-nettool.sh script, then click on TCP Tunnel.<br>&gt; Make sure the Listen On details are "all local addresses" and port "49153"<br>&gt; Set the Tunnel to Details to ip address of the skybox and port 49153.  <br>&gt; Click Listen<br>&gt; <br>&gt; Use firefox as you did previously, but use localhost (or 127.0.0.1) as <br>&gt; the address instead of 192.168.1.202<br>&gt; We should see all the output that firefox sends and the skybox returns.  <br>&gt; Please post the contents of both windows.<br>&gt; <br>&gt; Once we work this out, Ill give you a complete channel change script.<br>&gt; <br>&gt; _______________________________________________<br>&gt; mythtv-users mailing list<br>&gt; <a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>&gt; <a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>&gt; <br><br>Hi Michael,<br><br>Thanks very much for your help with this.<br><br>This is what nettool recorded when I used Poster:<br><br>POST /SkyPlay2 HTTP/1.1<br>Host: 192.168.1.250:49153<br>User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Connection: keep-alive<br>SOAPACTION: "urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI"<br>Content-Type: text/xml; charset=UTF-8<br>Content-Length: 408<br>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<br>Pragma: no-cache<br>Cache-Control: no-cache<br><br>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br>&lt;s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;<br>&lt;s:Body&gt;<br>&lt;u:SetAVTransportURI xmlns:u="urn:schemas-nds-com:service:SkyPlay:2"&gt;<br>&lt;InstanceID&gt;0&lt;/InstanceID&gt;<br>&lt;CurrentURI&gt;xsi://9c7&lt;/CurrentURI&gt;<br>&lt;CurrentURIMetaData&gt;NOT_IMPLEMENTED&lt;/CurrentURIMetaData&gt;<br>&lt;/u:SetAVTransportURI&gt;<br>&lt;/s:Body&gt;<br>&lt;/s:Envelope&gt;<br><br><br><br>This is what nettool recorded when I used your python script<br><br>POST /SkyPlay2 HTTP/1.1<br>Host: 192.168.1.250:49153<br>Accept-Encoding: identity<br>SOAPACTION: urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI<br>Content-Length: 409<br>Content-Type: text/xml; char-set=utf-8<br><br>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br>&lt;s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" <br>xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;<br>&lt;s:Body&gt;<br>&lt;u:SetAVTransportURI xmlns:u="urn:schemas-nds-com:service:SkyPlay:2"&gt;<br>&lt;InstanceID&gt;0&lt;/InstanceID&gt;<br>&lt;CurrentURI&gt;xsi://fa6&lt;/CurrentURI&gt;<br>&lt;CurrentURIMetaData&gt;NOT_IMPLEMENTED&lt;/CurrentURIMetaData&gt;<br>&lt;/u:SetAVTransportURI&gt;<br>&lt;/s:Body&gt;<br>&lt;/s:Envelope&gt;<br><br>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.<br><br>Regards,<br>Dave.<br><br></pre>
</body>
</html>