How to do resend when st=fail on a Repeater
-
everything is in the title
I'm wondering how to increase reliability on bad RF transmission (big ceiling).
I want to do a resend when st=fail.
I do it already on my sensor, it's easy to code, as it's in the sketch directly.
I'm wondering how to do it in the repetear ??? some ideas ???
-
I see two ways of implementing it (despite I never tried):
- gw.send( msg ) returns false in case transmission fails.
OR
- gw.send( msg, true ) will request an ack from controller, which should arrive back in few seconds if everything went well.
In both cases, you have to write your own logic to retry.
http://www.mysensors.org/download/sensor_api_15#the-full-api
-
@rvendrame Hello,
yes, I use this already. But as you know in a repeater, the gw.send is not available as it's include in the process() function... I do nont have access to gw.send...
-
@doblanch , not sure if I understood. gw.process is used to listen to incoming radio messages, while gw.send is to transmit messages, and is present on every example sketch here. For example the 'Door/Window/Button' sensor:
void loop() { debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue) { // Send in the new value gw.send(msg.set(value==HIGH ? 1 : 0)); oldValue = value; } }
-
http://forum.mysensors.org/topic/1424/resend-if-st-fail might be relevant
http://forum.mysensors.org/topic/2189/serial-api-noack-when-sending-with-ack-failed started by @SiLeX has a longer discussion on resending