Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Newbie to UPnP needs help with control points

2005-11-30
2013-05-02
  • David Stuart
    David Stuart
    2005-11-30

    Hello,

    I am on a tight budget and am in need of a java UPnP stack. (hence, I am here) :)

    I am trying to create a control point which can interact with a LinkSys NAT/FW to add port mappings (for a VoIP application). Anyway, long story short, I have tried the cyberlink product but have run into a snag. The code I use is something like the following (simplified a bit):

    ControlPoint cp = new ControlPoint();
    cp.start("urn:schemas-upnp-org:service:WANIPConnection:1");

    However, when I then follow this with a call:

    DeviceList dl = cp.getDeviceList();

    dl is always empty! What am I doing wrong? Any help at all would be appreciated. I'm on a deadline to have something working by end of week so am in a bit of a desperate state.

    Thanks in advance,
    Dave

     
    • Stefano Lenzi
      Stefano Lenzi
      2005-11-30

      Hi Dave,
      I do not rember if cp.start("DEVICETYPE") is the correct way to search for a certain DEVICETYPE. But anyway your problem is that the search is not synchronous so if get the DeviceList as soon after you have done the search you'll always get a EMPTY DeviceList.

      Stefano "Kismet" Lenzi

       
      • David Stuart
        David Stuart
        2005-11-30

        Well, I was wondering about that. So I guess I need to wait until I receive a search response, before I query the device list?

        What is cp.start(searchTarget) useful for if not for what I am trying to use it?

         
        • Stefano Lenzi
          Stefano Lenzi
          2005-12-01

          >Well, I was wondering about that. So I guess I
          >need to wait until I receive a search response,
          >before I query the device list?
          Yes you and not just one it depends on how many device are available on your UPnP Network

          >What is cp.start(searchTarget) useful for if not
          >for what I am trying to use it?
          To start the Control Point with a search message that do not ask for all the device on the network but only some of them.

          I think that the asynchronous approach is the only one that can work because there is no way to know how much time all the device need to be discovered.

           
    • Satoshi Konno
      Satoshi Konno
      2005-11-30

      Hi Dave,

      >ControlPoint cp = new ControlPoint();
      >cp.start("urn:schemas-upnp-org:service:WANIPConnection:1");

      It is the service name. Pease use the device type that if you want to find at first :-)

       
      • David Stuart
        David Stuart
        2005-11-30

        Do I always need to begin at the root device, i.e. cp.start(), or can I go immediately to a sub-device?

        The reason that I'm asking is because I have tried an evaluation copy of the atinav UPnP SDK, and their APIs (which admittedly are different) will allow you  to go straight to the service without going through the device.

        I notice that if I use the above control point cp.start(searchTarget), the exact same SSDP search request is issued (and the router responds in fact), but in the case of cyberlink no devices are discovered.

        Anyway I will try to first get the device, unfortunately I was doing that before and it appears to be crashing the router!

        Has anyone else been able to successfully add a port mapping to a linksys using cyberlink?

         
        • Stefano Lenzi
          Stefano Lenzi
          2005-12-01

          >Do I always need to begin at the root device,
          >i.e. cp.start(), or can I go immediately to a
          >sub-device?
          No but anyway when a subdevice all the full information of the device will be available

          >The reason that I'm asking is because I have
          >tried an evaluation copy of the atinav UPnP SDK,
          >and their APIs (which admittedly are different)
          >will allow you to go straight to the service
          >without going through the device.
          If they do that, how can you know on which device are you working?

          >I notice that if I use the above control point
          >cp.start(searchTarget), the exact same SSDP
          >search request is issued (and the router responds
          >in fact), but in the case of cyberlink no
          >devices are discovered.
          If are able to send the whole comunication we can have a look. Maybe is a bug inside CyberLink

          >Anyway I will try to first get the device,
          >unfortunately I was doing that before and it
          >appears to be crashing the router!
          Maybe your router do not follow the UPnP Standard striclty

          >Has anyone else been able to successfully add a
          >port mapping to a linksys using cyberlink?
          I never tryed to add port mapping but on my US Robitcs 9106 I was able to get information related to ExternalIP, active port mapping, and so on.

           
          • David Stuart
            David Stuart
            2005-12-01

            Well as to whether or not the linksys is following the UPnP standard strictly is somewhat immaterial, isn't it? It's LinkSys! They are the #1 SOHO router/firewall solution, so I should think that if there is a problem with the cyberlink accessing this then we need to work around it on our side (just my $0.02).

            Just for reference, I am using the WRT54G (v3), a popular model. I get the same results at home and at the office.

            Basically, the router WILL work, at least for the first 10 queries or so. Then eventually it just stops responding to all search requests. I do not even really have to issue any Actions, just repeatedly connect and disconnect the ControlPoint.

            I would post an ethereal capture but I have no idea how to add attachments to this forum. How would you like me to send more information? Can I attach things to a bug report?

            I can work around the start(searchTarget) method by using start() for the time being so this is not as important.

             
    • David Stuart
      David Stuart
      2005-11-30

      Let's try to make this easier. I think most of you are in Japan and I am in North America so time is ticking while we discuss and diagnose, since there is a 1-day turnaround on every question.

      Could someone come up with a small sample program which uses the correct, official way to get to the "WANIPConnection:1" service on the Internet Gateway device?

      Then I can model my program after this and report any problems I have with the linksys to this list.

      Right now I have tried all the approaches I can think of and none of them work with any reliability. But admittedly I am new and might be making mistakes.

       
      • Stefano Lenzi
        Stefano Lenzi
        2005-12-01

        >Let's try to make this easier. I think most of
        >you are in Japan and I am in North America so
        >time is ticking while we discuss and diagnose,
        >since there is a 1-day turnaround on every >question.

        I'm Italian but unfurtnatly be a Open Source developer is not my main work :-( So I do that in my spear time.

        >Could someone come up with a small sample program
        >which uses the correct, official way to get to
        >the "WANIPConnection:1" service on the Internet
        >Gateway device?
        I think that you can use the Control Point provided by CyberLink otherwise you can have a look to OSGi and DomoWare at https://sourceforge.net/projects/domoware/

        P.S.: As you can see I'm one of the main developer :-)

        >Then I can model my program after this and report
        >any problems I have with the linksys to this
        >list.

        If you use the CyberLink stack this is the right place. Otherwise if you our software DomoWare you should try our mailing-list

        >Right now I have tried all the approaches I can
        >think of and none of them work with any
        >reliability. But admittedly I am new and might be
        > making mistakes.

        Right now are you able to find the device? Also I think that you should start by Powering Up and Down a simple device that is know to work like a SimpleLight or anyother sample program that you can find on DomoWare or CyberLink website

         
        • Stefano Lenzi
          Stefano Lenzi
          2005-12-01

          Just for your information DomoWare is using a patched version of the latest CyberLink UPnP Stack so you may get different result....I hope better result ;)

          Please do not blame on me Satoshi :P

           
          • Satoshi Konno
            Satoshi Konno
            2005-12-01

            Hi,

            I have no rule to commit for the CVS server yet.

            Please commit your patches every time,
            but add the update comment the "ChangeLog" in the time.

            Using the ChangeLog, I checked your update in the source.