Return value of gw.send is false but gateway receives value anyway
-
Hi
We have a pressure sensor which sends a message upon a change event. Most of the time this works very well. However, from time to time there is the problem, that the return value of the gw.send method is false although the gateway received the value in question properly. Why can this happen?
We tried to solve this problem with some kind of retry-mechanism: we are now resending a message as long as the return value of gw.send() is false (or a deadlock-counter is < 10). However, this didn't solve the problem in all cases. There are still some cases when all retries == false (although all sent messages including all the retries are received by the gateway and of status "ok").
One point that seems to be of interest is that the problem mostly arises if we have a lot of traffic from multiple concurrent nodes. May this have something to do with collision detection?
Please see the following log information form more details:
relevant part of sketch:
bool success = false; int cntTries = 0; while (!success && cntTries++ < NB_RETRIES){ success = gw.send(msg.set(convertedValue,3)); if (!success) gw.wait(1000); }
Thanks for your support and best regards,
PatrickLog of Gateway:
0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748 5;1;1;0;16;0.748 0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748 5;1;1;0;16;0.748 0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748 5;1;1;0;16;0.748 0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:0.748 5;1;1;0;16;0.748 0;0;3;0;9;read: 5-5-0 s=1,c=1,t=16,pt=7,l=5,sg=0:1.000 5;1;1;0;16;1.000
Log of Node:
send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748 send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748 send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748 send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=fail:0.748 send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=ok:0.748 send: 5-5-0-0 s=1,c=1,t=16,pt=7,l=5,sg=0,st=ok:1.000
-
This would happen from time to time when your node doesn't receive the ack sent by the receiving node.
-
HEllo,
I have the same issue... did you fix your problem ?
your peace of code is nice.. but on the controller you received 4 times the same message, which is not very convenient ? right ?