diversario / node-ssdp

node.js SSDP client/server.
MIT License
274 stars 117 forks source link

Client not detecting my Panasonic Viera TV #95

Closed soloam closed 2 years ago

soloam commented 6 years ago

Hello I have a Panasonic Viera VT60, and I would like to cast movies to the youtube app of the TV. I can with no problem cast movies from the youtube app from my mobile, but when I run your client example I can't detect my tv. I was redirected here because I'm using a packages that includes this library (nodecast), and when I opened a issue in the package, the developer told me that it uses this library, and that you might be able to help me understand if this is a problem on my side, the library or if simply this is not designed to my use case scenario.

I also have a kodi device running with TubeCast and it also works great with my youtube app on my mobile, but it's not detected in your library.

Thank you

diversario commented 6 years ago

I searched around and found this. What if you try giving that URN as the search argument? Possible that what's in the example doesn't match what the TV expects.

soloam commented 6 years ago

It works now, I can only find when I use the timer, if I do only a search it stops before finding anything, If I set a timer it starts finding.

Got a response to an m-search: 200 { "CACHE-CONTROL": "max-age=1800", "EXT": "", "LOCATION": "http://192.168.1.xx:55000/pac/ddd.xml", "SERVER": "FreeBSD/8.0 UPnP/1.0 Panasonic-MIL-DLNA-SV/1.0", "ST": "urn:panasonic-com:service:p00ProAVControlService:1", "USN": "uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx::urn:panasonic-com:service:p00ProAVControlService:1" } { "address": "192.168.1.xx", "family": "IPv4", "port": 20299, "size": 316 }

But I can't see the youtube cast, from the TV or the TubeCast

Thank You

yocontra commented 6 years ago

Hmm, it seems like the issue might be that search doesn't keep the process open so it ends before getting a response. I'm having the same issue right now.

soloam commented 6 years ago

I solved it by adding to the end

setTimeout(function() {},5000)

Now I can get results

diversario commented 6 years ago

Right, so, node process will exit if there's nothing keeping it up; that's why in the example there's a setTimeout bit, to keep it running.

diversario commented 6 years ago

@soloam is this a non-issue, then? Can we close this?

yocontra commented 6 years ago

@diversario The issue is that node-ssdp should keep it open until the Client is closed (it is an open socket, isn't it?), you shouldn't have to manually ref the process via setinterval noops.

mroch commented 5 years ago

removing the socket.unref() in SSDP.prototype._createSockets also fixes this issue. it'll stay listening until you close the sockets by calling client.stop().