Toubles with listening on events

  • Hi,

    First of all, many thanks for this project, it is very interesting and useful as UPnP trends to be implemented in more and more daily devices.

    Thus, I have troubles with the eventing part. I'm using cyberlink to control and monitor devices. For example, I want to trigger actions such as play, pause… on a MediaRenderer device, and I want to be notified about the state of the device (is it mute ? has the volume changed ?)….

    I had tried to use the ControlPoint:subscribe method, but it failed, whereas working with the Intel device spy, i'm able to receive events. Debugging indicates a "precondition not met" message. Looking the code, I've seen that ControlPoint:subscribe sends a subscriptionRenew request, shouldn't it be a simple subscription request ?

    Best Regards,


  • Satoshi Konno
    Satoshi Konno

    Hi Mathieu,

    Do you want to subscribe events of UPnP/AV Media Renderer ?

    Please tell me the services and state variable names.
    I will check your problem in my home :-)

  • Hi,

    Yes, right now, I'm trying to retrieve UPnP/AV Media Renderer events, with both Intel's SDK implementation and Sonos products. There is just one evented variable : LastChange, which contains XML contents.

    But I'm not sure this problem is dependent of the service, I will try with other products. I made my own "subscriber" based on the current implementation, and it works. Here is my code :

      public boolean subscribe(Service service, String string) {
        if(service != null) {
          SubscriptionRequest subReq = new SubscriptionRequest();
          subReq.setSubscribeRequest(service, "" + this.ctrl.getHTTPPort() + this.ctrl.getEventSubURI(), Subscription.INFINITE_VALUE);
          //subReq.setRenewRequest(service, uuid, timeout);
          if (Debug.isOn() == true)
          SubscriptionResponse subRes =;
          if (Debug.isOn() == true)
          if (subRes.isSuccessful() == true) {
            return true;
        return false;