Chris.G
Member
- Joined
- Apr 25, 2024
- Messages
- 14
Hi,
Actually, I just wanted to use the subscription to be informed in my app when the status has changed in the WiiM device.
The whole code works as expected, until after about 5 minutes a "SUBSCRIBE renewal error" error occurs. After analyzing the error in more detail, it turned out that the UPnP client sends a "Renewing subscription" message to the WIIM Pro (FW: 4.8.614042) and this always responds with the message "412 Precondition Failed".
In my opinion, the message from the client is correct (see screenshots) and I have also looked at other implantations and their message structure is identical.
UPnP-Specs > see Chapter: 4.1.2 Eventing: Renewing a subscription: SUBSCRIBE with SID
UPnP-Client Code:
Request:
Response:
Actually, I just wanted to use the subscription to be informed in my app when the status has changed in the WiiM device.
const UPnPClient = require('upnp-device-client');
this.#client = new UPnPClient(`http://${this.getStoreValue('address')}:49152/description.xml`);
this.#client.subscribe('AVTransport', (event) => {
this.logDebug(`onInit() > subscribe > ${JSON.stringify(event)}`)
})
The whole code works as expected, until after about 5 minutes a "SUBSCRIBE renewal error" error occurs. After analyzing the error in more detail, it turned out that the UPnP client sends a "Renewing subscription" message to the WIIM Pro (FW: 4.8.614042) and this always responds with the message "412 Precondition Failed".
In my opinion, the message from the client is correct (see screenshots) and I have also looked at other implantations and their message structure is identical.
UPnP-Specs > see Chapter: 4.1.2 Eventing: Renewing a subscription: SUBSCRIBE with SID
UPnP-Client Code:
Request:
Response: