2

I am looking to find anyone who has had reasonable success implementing UPnP in Ruby. There seems to be very little out there on this subject that is coherent and complete.

I have been working with the UPnP gem from Seattlerb. I think this is probably the best out there but it is incomplete in that the documentation is somewhat limited (although far better than anything else I found) and I think aspects of the protocol are not implemented. So, I've used this as a starting point.

I am trying to write a "UPnP MediaServer ControlPoint" which will detect UPnP-servers on the network and present information about the media stored there and provide a way to download that media to a local hard drive.Actually playing such media is not a requirement for this application: it's just a tool to grab recordings off a PVR that is a DLNA media server.

I have the UPnP gem working under ruby 1.9.3. I had to make some code changes to get it to work and my code changes may be incomplete because I haven't got beyond simple device and service discovery.

What I am now trying to do is to interact with the discovered device to get a list of the content it has available and then to access that content. However, after several days of internet searching, reading the UPnP device archietecure documentation, reverse engineering bits of code found on the internet (including the UPnP gem), I am unclear of where to go next.

I'm posting here in the hope that others have trodden this path and would care to point me in a suitable direction...

And in case it helps anyone else, my evaluation work is on github.

starfry
  • 9,273
  • 7
  • 66
  • 96
  • I've run into the same problem. Why is there almost nothing on UPnp? What changes did you make to get it to work? I couldn't get it to find any devices. – jeef3 Apr 11 '12 at 04:35
  • Hi Jeef3, I have added my work to github so you can check it out. There's a README that explains what I've done. Link in question main text above. – starfry Apr 11 '12 at 16:23
  • if I run the upnp_test.rb it fails with following errors: /Users/Romeo/.rvm/gems/ruby-1.9.3-p194@UPnP-Ruby-1.9-Evaluation/gems/UPnP-1.2.0/lib/UPnP/SSDP.rb:584:in `bind': Address already in use - bind(2) (Errno::EADDRINUSE) from /Users/Romeo/.rvm/gems/ruby-1.9.3-p194@UPnP-Ruby-1.9-Evaluation/gems/UPnP-1.2.0/lib/UPnP/SSDP.rb:584:in `new_socket' from /Users/Romeo/.rvm/gems/ruby-1.9.3-p194@UPnP-Ruby-1.9-Evaluation/gems/UPnP-1.2.0/lib/UPnP/SSDP.rb:624:in `search' from upnp_test.rb:13:in `
    '
    – romus May 25 '12 at 12:54
  • Sorry no idea why that would be. Just checked mine and it's ok here. It sounds like you have something else on your box that is binding to the same port. I added a debug line to that file (SSDP.rb) to see that mine binds to port 1900. – starfry May 29 '12 at 20:36
  • I have the same problem here @romus. Did you ever fix? – Brett Hardin Jan 02 '15 at 21:02

0 Answers0