[mythtv-users] New Sky+ App - control Sky box via tcp/ip network
Michael Watson
michael at thewatsonfamily.id.au
Thu Dec 13 04:07:26 UTC 2012
On 13/12/2012 1:41 PM, Nick Rout wrote:
>
>
> On Thu, Dec 13, 2012 at 10:29 AM, Dave Pearson
> <lists at the-pearsons.co.uk <mailto:lists at the-pearsons.co.uk>> wrote:
>
> -----Original message-----
> *From:* Raymond Wagner <raymond at wagnerrp.com
> <mailto:raymond at wagnerrp.com>>
> *Sent:* Thu 16-08-2012 21:14
> *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 8/16/2012 10:38, Dave Pearson wrote:
> > Before anyone says why don't I do it myself - I'm not clever
> enough!
>
> Sure you are, you just don't know you are. Grab a copy of
> wireshark or
> tcpdump and have at it. Just start it up, and record the
> communications
> between the iPad and the STB as you perform various actions.
> The only
> real difficulty would be if they decided it was necessary to
> perform
> some kind of authentication between the STB and application,
> or worse,
> encrypted the communication.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org>
> http://www.mythtv.org/mailman/listinfo/mythtv-users
>
> OK, I wasn't clever enough to use wireshark to figure out how to
> send the control commands to my SKY+HD Box, but someone else was
> (http://www.gladdy.co.uk/blog/2012/08/21/the-skyhd-picasso-dnla-control-server-protocol/)
> and using the information on that page I have been able to use
> firefox poster to send a command to change the channel. I'm now
> trying to take what I'm using in poster to create a bash script
> that I can use to change the channel in mythtv, unfortunately I'm
> having no luck with curl at all.
>
> This is what I'm POSTing using poster:
>
> headers:
>
> SOAPACTION: urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI
>
> content-type: text/xml; charset=utf-8
>
> body:
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <s:Envelope
> s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:s="http://schemas.smlsoap.org/soap/envelope/">
>
> <s:Body>
>
> <u:SetAVTransportURI xmlns:u="urn:schemas-nds-com:service:SkyPlay:2">
>
> <InstanceID>0</InstanceID>
>
> <CurrentURI>xsi://ff0</CurrentURI>
>
> <CurrentURIMetaData>NOT_IMPLEMENTED</CurrentURIMetaData>
>
> </u:SetAVTransportURI>
>
> </s:Body>
>
> </s:Envelope>
>
> Using the above code in poster I mange to change the channel to
> ff0, which is the hex code for channel 113 (Universal HD),
> unfortunately I just cannot figure out how I can get curl to POST
> the body text (I think the headers are being passed correctly. I'm
> sure this is really simple, but I'm just stuck! any help will be
> gratefully received.
>
> Regards,
>
> Dave
>
>
> can wget do this?
>
Possibly, but might be easier to use something like python or perl, as
then end result is going to be a channel change script I guess.
This python code might do the trick.
import httplib, urllib
import re
conn= httplib.HTTPConnection("http://xxx.xxx.xxx.xx <http://xxx.xxx.xxx.xx/>:49153/SkyPlay2")
XML='*****XMLSTUFF Goes Here *****'
headers= { "SOAPACTION: urn:schemas-nds-com:service:SkyPlay:2#SetAVTransportURI", "content-type: text/xml", "charset=utf-8"}
conn.request("POST", params, "", headers)
conn.send(XML)
response= conn.getresponse()
print response.status, response.reason
print response.read()
conn.close()
More information about the mythtv-users
mailing list