Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Content Length UPNP


Question

Posted

I am using devicespy to try and scrape data from the returned result but it seems to cut it short? is there a limit on the read tcpsocket? so many bytes or something? if so can i overcome it?

[DEBUG] 00:19:32: HTTP/1.1 200 OK Ext: Date: Sun, 21 Sep 2014 23:19:40 GMT Content-Length: 4315 Content-Type: text/xml; charset="utf-8" Server: UPnP/1.0 DLNADOC/1.50 Platinum/0.6.9.1 102:03:07nfs://192.168.0.5/volume1/video/Movies/1080p/abcdefgh (2014) [1080p]/abcdefgh .2014.1080p.BluRay.x264.YIFY.mp4

there should be a lot more data!

[ Added: 2014-09-22, 00:32 ]

in fact it stops at restricted = 1 then encoded xml... not sure how to get around it?

2 answers to this question

Recommended Posts

  • 0
Posted

Why are you sniffing this data? UPnP is open, so you should be able to receive the package in it's full form by just requesting it using a normal TCP message. I'm just starting to play around with UPnP, so I can't tell you how to do it exactly, but it should be fairly straight forward to get a UPnP response back from your server by means of a TCP command tool.

Otherwise, try different tools or perhaps to change the settings of devicespy.

  • 0
  • Inquirer
  • Posted

    I am getting the data but it breaks the returned data at restricted=1

    Try looking at openelec or XBMC over PNP and play some media you will see half is decoded XML and half is encoded I think this is where is breaks the content returned?

    [ Added: 2014-09-22, 22:10 ]

    similar situation here...

    returns blank but devicespy returns data

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    tcpSocket = Net.FTcpSocket("192.168.0.14", 52235)

    payload = [[post /MainTVServer2/control/MainTVAgent2 HTTP/1.1

    SOAPACTION: "urn:samsung.com:service:MainTVAgent2:1#GetWatchingInformation"

    Content-Length: 282

    <?xml version="1.0" encoding="utf-8"?>

    0x0D0x0A0x0D0x0A]]

    bytes, errorcode = tcpSocket:write(payload)

    if errorcode == 0 then

    state = tcpSocket:read()

    -- local volume = state:match("(.+)")

    local volume = state

    fibaro:debug(volume)

    fibaro:log(volume)

    end

    tcpSocket:disconnect()

    fibaro:sleep(60000)

    [ Added: 2014-09-24, 21:00 ]

    POST /MainTVServer2/control/MainTVAgent2 HTTP/1.1

    HOST: 192.168.0.14:52235

    SOAPACTION: "urn:samsung.com:service:MainTVAgent2:1#GetWatchingInformation"

    CONTENT-TYPE: text/xml; charset="utf-8"

    Content-Length: 291

    <?xml version="1.0" encoding="utf-8"?>

    still struggling or am i wasting my time trying?

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...