Keepalive
-
I was experimenting with a Temp/Hum sensor this weekend and I noticed that the environment in which the sensor "lives" doesn't change much at all. The code onl;ine skips the send if the last value is the same as the current value. In this case as a result there was no update to the Vera gateway for over 14 hours, to the point where I assumed something might be wrong. So I manually reset the sensor to forcean update.
How about a "Keepalive" function in the Library that can be included in he sketch to update the Gateway every "N" minutes whether there is a value change or not. One could declare the keepalive period in the sketch, say 1 hour, so that the sensor would send an update to the Gateway even if there was no change.
-
yes, by default we try to minimize message sending in the examples. But like Andrej says you could just allow it to send one message each X sleep cycle.
@hek Which is what I ended up doing in the code I modified for the triple sensor device. I was merely suggesting that it might be nice to have a standardized keepalive routine in the library, call it and it takes care of it for you.
-
Hi guys ...
i agree sending the values periodically helps if the radio transmission is not ack'ed. I was testing yesterday a sketch and looks like i have another dodgy radio module. probably 80% packets were successful, but other 20% resulted in Vera not being told the door was open or closed...So i added this "hack" which whilst it works could be better coded im sure!!
if (counter < 1000000){
counter++ ;
// Serial.println(counter);
} else {
Serial.println("sending status");
gw.sendVariable(CHILD_ID_DOORA, V_LOCK_STATUS, trippedA?DOOR_CLOSED:DOOR_OPEN); // Send value change to gw
counter = 0;
}I was thinking... since debug message prints "Ack: received OK" - what if the library repeated the transmission when the ACK was not received.. Hek i do recall a short discussion on this...not sure if its to be in 1.4 or what...
Cheers,
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login