LowPowerLab Forum

Hardware support => RF - Range - Antennas - RFM69 library => Topic started by: fabltd on April 18, 2017, 10:38:37 AM

Title: radio.sendWithRetry
Post by: fabltd on April 18, 2017, 10:38:37 AM
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
Title: Re: radio.sendWithRetry
Post by: Felix on April 18, 2017, 10:51:06 AM
The buffer is a byte buffer. So length in bytes.
The many library examples show how to use the send and sendWithRetry functions.
Title: Re: radio.sendWithRetry
Post by: fabltd on April 18, 2017, 11:52:15 AM
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?
Title: Re: radio.sendWithRetry
Post by: Felix on April 18, 2017, 03:49:16 PM
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.
Title: Re: radio.sendWithRetry
Post by: fabltd on April 19, 2017, 06:57:42 AM
Fixed my issue

A delay in the loop prevented the ack being sent in time.
Title: Re: radio.sendWithRetry
Post by: Felix on April 19, 2017, 08:02:27 AM
Yes, delays are "dead" times and should be completely avoided in sketches where the radio is actively listening for incoming packets.