Sending just after receiving needs a delay

Started by gussabina, December 26, 2016, 02:25:16 PM

gussabina

Hello All:

It seems the RFM69HW can't send a packet just after receiving, unless there is small delay (3ms according the library). I read the Datasheet but I couldn't find information justifying this behavior. Does someone know why this delay is necessary?

Thanks
Gus

Felix

Quote from: gussabina on December 26, 2016, 02:25:16 PM
unless there is small delay (3ms according the library)

Can you share where the 3ms delay is that you refer to?

joelucid

QuoteIt seems the RFM69HW can't send a packet just after receiving, unless there is small delay (3ms according the library).

It takes a tiny bit of time for the other side to go back into rx, setup the filter correctly etc. But hardly 3ms at Felix settings.

I think the 3ms wait period in Felix gateway sketch comes from the 3ms synchronous LED blinks his node sketch performs after sending a packet and before switching the radio back into RX. You would obviously not want to do that in production code.

Joe

Felix

Sure, he was saying that's in the library though...  ???

joelucid

QuoteSure, he was saying that's in the library though...  ???

Yeah - well library examples in this case. I don't think there's anything in the library itself.

gussabina

Yes, I was referring to the Gateway sample code;

       Serial.print(" - ACK...");
        delay(3); //need this when sending right after reception .. ?
        if (radio.sendWithRetry(theNodeID, "ACK TEST", cmdLen, 0))  // 0 = only 1 attempt, no retries

or any example where you need to transmit just after receiving....

BTW, what Felix refers as a library is not a library anyway....Library is a set of object code, and the "library" he refers is in source code (.cpp)

Thanks
Gus

joelucid

If you want a simple workaround call receiveDone prior to blink.

gussabina

Thank you, joelucid.

I'm having issues and since I saw the above comment in the code  (  //need this when sending right after reception .. ?) I though this could be a known issue, but I didn't find anything in the Datasheet.

Thanks
Gus

Felix

I may have some loosey code around in examples with some delays.
However most examples have no such delays after reception and it's not implied anywhere you need that, in fact you do not.

By library I understand/mean RFM69.h and RFM69.cpp along with any secondary headers and source code (ex RFM69_ATC or OTA). The examples illustrate using the library, and are *NOT* part of the library code - ie they don't get compiled into your own sketches, only the library code does. Getting lost in translation here I guess but it's good to be more specific so we're all on the same page.

joelucid

QuoteI'm having issues

Maybe if you describe the issues we could help you address them. As Felix says rfm69 certainly doesn't have any intrinsic need for such delays so your problems might be caused by something completely different.

Joe