SSDP for the Photon Core


The guys at Particle.IO have this nifty little device that has built in WiFi. Trouble is, it is a bit annoying trying to find the IP on a dynamic network.

SSDP stands for Simple Service Discovery Protocol. It was a little tricky to get a really quick understanding of the protocol; most of the documents available are pretty big (ie, the UPnP spec).

There wasn’t a port for the particle, so I made one on GitHub:

Let’s break it down:

  • Someone searching for devices will broadcast a ‘SEARCH’ message to the IP

MX:[seconds to delay response]
ST:[search target]

  • Next, all devices will broadcast a ‘SEARCH Response’ directly to the IP that pinged for devices

HTTP/1.1 200 OK
CACHE-CONTROL:max-age=[seconds until advertisement expires]
LOCATION:http://[location where the xml description file is hosted]
SERVER:[OS/version UPnP/1.1 product/version]
ST:[search target]
USN:[composite identifier for the advertisement]

  • The host where the ‘SEARCH’ request came from will then open a TCP connection to the ‘LOCATION’ specified in the response

GET /upnp/description.xml HTTP/1.1

  • Then, of course, the device must provide back the XML file that describes its operation

There are some other things the device should do:

  • provide a device update ‘NOTIFY ALIVE’ message when it connects, and periodically send it to keep the device advertisement alive
  • provide a device update ‘NOTIFY BYEBYE’ message when leaving the network


Once implemented, the device can be easily discovered in Windows: