-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client stops observing properties after a while #1263
Comments
Could be this a result of #1232 ? or your Windturbine emits property changes continuously? |
Can put some logging in place to "see" what happens (or no longer happens)? |
Thank you for your replies @relu91 @danielpeintner |
Then it's 99,9% the same bug described in #1232
Not sure if you already enabled it, but |
Thank you for the details. Is it possible to “unobserve” a property? That way I could restart the observation every one hour. Not very clean but that would solve the problem for the moment. |
|
Thank you so much. I made the following code which fix the issue by restarting the property observation every 30 minutes. let observedProperty;
async function callback() {
if (observedProperty) {
await observedProperty.stop();
}
observedProperty = await thing.observeProperty("rotationSpeed", async (rotationSpeedInteractionOutput) => {
// Property changed
});
}
setInterval(callback, 30 * 60 * 1000);
callback(); |
Thanks @pierre-josselin for posting your fix. The "root" cause is tracked in #1232 |
Hi,
I have a TD "WindTurbine" with just one observable property "rotationSpeed":
Here is a simplified version of the server implementing the property:
And a simplified version of the client observing the property:
Here is how it works:
An HTTP server is created. When it receives a notification, it emits a property change. The client is therefore informed of the modification of the property through the WoT server.
When starting the server, then the client, everything works.
But after a while, a few hours, the property systematically ceases to be observed, and will no longer work until the client restarts.
emitPropertyChange() keeps getting called but no longer the callback of observeProperty().
Am I doing something wrong or is this a bug? Thank you
Node.JS v16.13.2
Node WoT Core v0.8.12
Node WoT Binding HTTP v0.8.12
The text was updated successfully, but these errors were encountered: