• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ssdp discovery
#1
I found a couple of oddities with pilight (at least in v5) ssdp discovery.

The first is just an oddity, I'm using a Python library and the builtin Python httplib as a class for dealing with http header (responses). For some reason it expects white space after the header name colon, e.g.:

Expects:
Code:
location: something

Freaks out with:
Code:
location:something

This is a bug imho in the Python httplib library, hence this being an oddity.

That being said the spec http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html states a single space is preffered. And pilight is not adding a space, again not a bug but it would be nice if it did.

The other oddity (and I think this is a bug) is that the pilight daemon does not respond to service requests for ssdp:all nor upnp:rootdevice. I think this is expected per http://www.w3.org/TR/discovery-api/.

None of these are big deals but they do make using some off the shelf tools for ssdp awkward.
 
Reply
#2
In regard to the first question. Please consider that SSDP is not actually the same as HTTP in regard to it's protocol. So the requirements are also different. When i implemented it, i didn't read any real requirements in regard to having spaces there or not.

As to your second question. I did that on purpose so pilight doesn't polute the network with SSDP discovery messages.
 
Reply
#3
Hi all,

I'm trying to connect to the pilight daemon through SSDP discovery, however I do not manage to discover pilight. Not even when searching for all services on the network. (I do find other services on my network such as my Sonos speaker or my router). Also pilight-receive is able to connect to the pilight-daemon.

Is pilight using a specific implementation of SSDP?

What I did:
I used the node SSDP library (https://github.com/diversario/node-ssdp)
Then I used
Code:
var Ssdp = require('node-ssdp').Client;
ssdpClient = new Ssdp();

ssdpClient.on('response', function (headers, statusCode, rinfo) {
        console.log('Got a response to an m-search.');
        var HOST = rinfo.address;
        var PORT = rinfo.port;
        try {
            console.log('Trying to connect to ' + HOST + ':' + PORT);
            //socket.connect(PORT, HOST, function () {
            //    socket.write('{"action":"identify","options":{"receiver":1}}');
            //});
        } catch (error) {
            console.log('Unable to connect to socket');
        }
    });

console.log('searching for pilight daemon...');
ssdpClient.search('urn:schemas-upnp-org:service:pilight:1');
to detect pilight with no luck. (Starting a pilight receive is finding the pilight daemon)

Code:
ssdpClient.search('ssdp:all');
Is finding services on my network but not pilight...

Output when doing ssdpClient.search('ssdp:all');
Code:
searching for pilight daemon...
Got a response to an m-search.
Trying to connect to 192.168.1.1:1900

Any idea's what I can do? :$
 
Reply
#4
The SSDP discovery is working fine, but you are connecting to the wrong port on the pilight-daemon host I think, 1900 is the SSDP discovery broadcast port, pilight runs on a different port.

About discovery by ssdp:all
(11-01-2014, 09:57 PM)clach04 Wrote: pilight daemon does not respond to service requests for ssdp:all nor upnp:rootdevice.
(11-01-2014, 10:17 PM)curlymo Wrote: As to your second question. I did that on purpose so pilight doesn't polute the network with SSDP discovery messages.
 
Reply
#5
First of all,
Thanks pilino1234 for your quick response.

(05-23-2016, 01:45 PM)pilino1234 Wrote: The SSDP discovery is working fine, but you are connecting to the wrong port on the pilight-daemon host I think, 1900 is the SSDP discovery broadcast port, pilight runs on a different port.

The result I posted was from a "sddp:all" search, to show that I got results from other devices. (that particular entry was my router).
Now I understand why pilight didn't show up with the "sddp:all" search.

however it is also not showing up for me when searching for:
"'urnConfusedchemas-upnp-orgConfusedervice:pilight:1"

Do you have any idea why this is? That should be the correct USN right?
 
Reply
#6
That should be correct, I implemented this ssdp search in python a while ago, and it works fine. See https://gist.github.com/pilino1234/183a0...8d16001a1f for how I did it. I can't see why it isn't working for you though :/
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] No ssdp connection found Hexcode 145 141,610 12-23-2017, 02:10 PM
Last Post: HuberDe
  Standalone but SSDP brenner23 6 2,241 04-16-2017, 11:34 PM
Last Post: brenner23
  [Solved] pilight ssdp celle 6 7,840 02-23-2017, 03:22 PM
Last Post: gneandr
  Raspbian jessie - pilight 7 - no pilight ssdp connections found shirocko 20 15,460 01-29-2017, 10:23 PM
Last Post: gneandr
  cannot bind to the ssdp multicast network wo_rasp 1 2,830 09-22-2015, 12:10 PM
Last Post: curlymo
  no pilight ssdp connections found/failed to kill 3400 Xilinx64 3 3,258 02-13-2015, 12:57 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)