radio.sendWithRetry

Started by fabltd, April 18, 2017, 10:38:37 AM

fabltd

Hello

Can some one please confirm the send length.

Example:

(radio.sendWithRetry(TONODEID, sendbuffer, sendlength))

is the send length the number of bytes or number of bits?

Thanks

Felix

The buffer is a byte buffer. So length in bytes.
The many library examples show how to use the send and sendWithRetry functions.

fabltd

Hi

In this example:

https://github.com/LowPowerLab/RFM69/blob/master/Examples/Struct_send/Struct_send.ino

There is:

#define ACK_TIME    30

I don't see how this is implemented.

What values can you use?

Felix

That's an artifact left from other examples, basically the default is:

virtual bool sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries=2, uint8_t retryWaitTime=40); // 40ms roundtrip req for 61byte packets


40ms which is plenty of time to wait for an ACK. For shorter messages it can be around 20ms.

We see all the new stuff coming in you, please do not post copies of questions in several places.

fabltd

Fixed my issue

A delay in the loop prevented the ack being sent in time.

Felix

Yes, delays are "dead" times and should be completely avoided in sketches where the radio is actively listening for incoming packets.