-1

Hey guys well i'm working on a project.

Basically i need to be able to retrieve result of a SSDP packet to find the IP of my Pioneer VSX AVR. It responds to SSDP to be used with the official apps and i am working on a windows application to do the same sort off thing.

Source: http://github.com/cyanlabs/vsxremote

What i know so far...

  1. the packet need to be sent to the ip 239.255.255.250

  2. The port is 1900 and the AVR responds to Telnet/TCP on 23/8102

  3. The description.xml is located at 192.168.0.111:8080/description.xml

  4. I tried to figure this code out but it didn't seem to work. http://social.msdn.microsoft.com/Forums/vstudio/en-US/d7f53b79-80dc-46f7-96dd-fc3b7a28f8d4

  5. The request i need to send is

    M-SEARCH * HTTP/1.1
    HOST: 239.255.255.250:1900
    ST:urn:schemas-upnp-org:device:MediaRenderer:1
    MAN: "ssdp:discover"
    MX: 1
    

Any help would be great. Thanks.

  • I should probably mention that i already have the actual telnet code sorted i just need to sort out the SSDP request/response. –  Jul 06 '14 at 13:15
  • So... should there be a question in there? If you wanted help with item #4, you need to include much more detail than "didn't seem to work". – Jussi Kukkonen Jul 06 '14 at 14:17
  • Well the question is obviously "How can i send a SSDP / UPNP packet and get response?" as is the title. –  Jul 06 '14 at 14:49
  • I have researched for hours and can't find any information to help me with this issue, that code simply doesn't work... it doesn't return anything. –  Jul 06 '14 at 14:50
  • 1
    _"doesn't return anything"_ is useful info, you should include it in the question. I also suggest you check with wireshark that A) your multicast packet is really sent and B) the response actually arrives. Including a minimal example in the actual post would be good manners: I don't know which of the three different versions (in the two different links you've had) you refer to. The only comment I have is that the replies can be short: ReceiveFrom() might be blocking waiting for more data. – Jussi Kukkonen Jul 06 '14 at 21:21
  • Sorry how do i do that? I have never used wireshark before, Also i changed the link as the first link went to the 2nd link for the vb.net code any way. The code i tried was the bottom post, the 2 functions. I really need to get this SSDP request/response working as then my application is essentially done with a few configuration options and tweaks :) –  Jul 07 '14 at 12:31
  • http://puu.sh/a0xfB/46d638317b.png <--- here it was sent. –  Jul 07 '14 at 12:45
  • It doesn't seem to be replying though... am i being blind perhaps sending the wrong data? –  Jul 07 '14 at 12:56

1 Answers1

1

Based on the wireshark output and the linked code (both of which really should be in the post):

CONTENT-LENGTH header should not be part of a M-SEARCH message. You are also missing an empty line (vbCrLf) in the end -- and that's in addition to the CrLf that is missing from end of CONTENT-LENGTH line. In other words, every line including the last line must end with "\r\n" and then there must be an extra "\r\n" in the end. Omitting the empty line typically results in devices ignoring your message (as they can't really know it is complete).

See UPnP Device Architecture part 1 for the de facto spec on SSDP.

Jussi Kukkonen
  • 13,857
  • 1
  • 37
  • 54
  • Thanks for your reply but firstly that "CONTENT-LENGTH" isn't part of my message that is just something that wireshark shows. Same goes for the missing CrLf. I will add the empty line and see what happens. –  Jul 07 '14 at 22:09
  • 1
    It would _really_ help if you posted the code you are actually using so there would be no guessing involved: the code you linked to clearly has "CONTENT-LENGTH: 0" in it. – Jussi Kukkonen Jul 07 '14 at 22:27
  • Thanks i got it working :), Whats the easiest way to parse this data? http://puu.sh/a2GOE/f046bb0380.png HTTP/1.1 200 OK CACHE-CONTROL: max-age=1800 EXT: LOCATION: http://192.168.0.111:8080/description.xml SERVER: KnOS/3.2 UPnP/1.0 DMP/3.5 ST: urn:schemas-upnp-org:service:AVTransport:1 USN: uuid:5F9EC1B3-ED59-79BB-4530-745e1c3206eb::urn:schemas-upnp-org:service:AVTransport:1 I just need to extract the IP from LOCATION. –  Jul 08 '14 at 21:39