4

When I try to renew the UPnP event subscription on the device, I have an 412 HTTP Error: Precondition Failed, bad SID.

This error occurs only on one device, all other devices works fine. Buggy device is an D-Link XTreme N GIGABIT Router DIR-655 (Firmware Version :1.34WW, 2010/09/30), H/w ver: A4.

UPNP subscription log (catched by Wireshark)

Subscription:

SUBSCRIBE /l3fw HTTP/1.0
Host: 192.168.0.1
CALLBACK: <http://192.168.0.100:7169/evt/43E47718-E7F6-D950-A503-71346C1D9944>
NT: upnp:event
TIMEOUT: Second-60

HTTP/1.1 200 OK
SID: uuid:5B68F900-2863-104D-8000-002401F35BC2
TIMEOUT: Second-60
SERVER: ipOS/7.6 UPnP/1.0 ipGENADevice/1.0

Renewal:

SUBSCRIBE /l3fw HTTP/1.0
Host: 192.168.0.1
SID: uuid:5B68F900-2863-104D-8000-002401F35BC2
TIMEOUT: Second-60

HTTP/1.1 412 Precondition Failed, bad SID
SERVER: ipOS/7.6 UPnP/1.0 ipGENADevice/1.0

First time I try to renew subscription in 5 seconds before expiration, e.g. on 55th second after initial subscription. Second try: on 45th second, but with the same effect.

Also I tried to use HTTP/1.1 in subscription requests (and add "Connection:close" header), but there is no effect.

What I'm doing wrong?

UPD1 Updating formware to 1.37WW changes nothing

UPD2

When I try to renew subscription immediately after subscribe, it works. Wait 750ms and renew - works. Wait 900ms and renew - fails with HTTP 412. It seems that there is a bugs in D-Link equipment (another D-Link router DI-624 works in the same manner). Intel device validator (https://software.intel.com/en-us/articles/intel-tools-for-upnp-technologies) validates DIR-655 and DI-624 eventing without errors, but, I think, there is no pause between subscribing and renewal steps. So, I think, UPNP eventing is not a reliable mechanism and it is better don't to use it.

Such device behavior compromises an upnp eventing mechanism idea.

Bernd Jacobi
  • 571
  • 2
  • 5
  • 18

1 Answers1

0

I've just hit a very similar problem with some Belkin WeMo devices.

I solved my problem by making sure I responded properly to notification messages sent to the CALLBACK URL. I sent a HTTP 200 response and things started to work properly for me.

hardillb
  • 54,545
  • 11
  • 67
  • 105