@mfalkvidd said in Node to Node ACK:
Welcome to the forum @anderBAKE
Multiple people have tried, but I don't think anyone has been able to make it work.
Some threads
https://forum.mysensors.org/post/99252
https://forum.mysensors.org/post/99485
https://forum.mysensors.org/post/102134
@mfalkvidd thanks! The first link is where I got the inspiration for my resend loop. I'll look into the other links after work today.
@BearWithBeard said in Node to Node ACK:
@anderBAKE When a node to node communication fails, MySensors will automatically fall back to the default route via the node's parent, so that ultimately the gateway can try to reach the destination node. I'm not sure if you can change that behaviour without touching the library code. But if you don't mind, a small change in MyTransport.cpp should do the trick.
Change the following starting on line 548...
if (destination > GATEWAY_ADDRESS && destination < BROADCAST_ADDRESS) { // node2node traffic: assume node is in vincinity. If transmission fails, hand over to parent if (transportSendWrite(destination, message)) { TRANSPORT_DEBUG(PSTR("TSF:RTE:N2N OK\n")); return true; } TRANSPORT_DEBUG(PSTR("!TSF:RTE:N2N FAIL\n")); }
to the following...
if (destination > GATEWAY_ADDRESS && destination < BROADCAST_ADDRESS) { // node2node traffic if (transportSendWrite(destination, message)) { TRANSPORT_DEBUG(PSTR("TSF:RTE:N2N OK\n")); return true; } else { TRANSPORT_DEBUG(PSTR("!TSF:RTE:N2N FAIL\n")); return false; } }
This will drop out of the
transportRouteMessage()
function returningfalse
to thesend()
function if the N2N communication failed.Note that, after this change, the node will not fall back to the default transport route anymore.
Maybe this could be made an optional feature by introducing something like
#define MY_DISABLE_N2N_FALLBACK
to MyConfig.h?
@BearWithBeard very interesting. I'll definitely be looking into this this evening as well.
Thank you both for the speedy replies!