1

I am trying to create a MediaServer UPNP program in order to stream video from my phones camera to my PC. I used Intel device spy to send an M-SEARCH request and used Wireshark to capture the network packets.

Here is the M-SEARCH packet

(Src: 192.168.1.28, Dst: 239.255.255.250; Src Port: 50852, Dst Port: 1900, time 2.09)
M-SEARCH * HTTP/1.1
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 5
HOST: 239.255.255.250:1900

Here is the UDP reply

(Src: 192.168.1.23, Dst: 192.168.1.28; Src Port: 53359, Dst Port: 50852)
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1810
DATE: Wed,  1 Feb 2017 02:07:36 GMT
EXT:
LOCATION: http://192.168.1.23:49156/details.xml
SERVER: Linux/2.x.x, UPnP/1.0, pvConnect UPnP SDK/1.0, TwonkyMedia UPnP SDK/1.1
ST: upnp:rootdevice
USN: uuid:3d64febc-ae6a-4584-853a-85368ca80800::upnp:rootdevice
Content-Length: 0

I do not get a following HTTP GET request to 192.168.1.23. I compared it to other UPNP device responses that worked and could see no difference. I tried different source ports but with no sucess. Any ideas?

malioboro
  • 3,097
  • 4
  • 35
  • 55
Elad Golan
  • 31
  • 7
  • So you use Device Spy to send an M-SEARCH request, and a device responds. It's not clear _who_ you expect to make a HTTP GET request to the device description... – Jussi Kukkonen Feb 01 '17 at 07:59
  • The `Content-Length` header in your response is not required (or maybe not allowed - UPnP specs are a bit vague). Try removing it. – simonc Feb 01 '17 at 11:57
  • 1
    @jku Device Spy normally makes a GET request for device xml automatically on receipt of a valid SSDP packet (both MSEARCH response and NOTIFY) – simonc Feb 01 '17 at 11:59
  • Also, does your message end in an empty line? – Jussi Kukkonen Feb 01 '17 at 12:08
  • @simonc, Thank you. I did have a \r\n at the end of my message, but I added another one (to the NOTIFY message as well) and now I can see my device. – Elad Golan Feb 02 '17 at 12:37

1 Answers1

1

@simonc, Thank you. I did have a \r\n at the end of my message, but I added another one (to the NOTIFY message as well) and now I can see my device.

Elad Golan
  • 31
  • 7