Skip to content

Commit 4ec7dd7

Browse files
authored
Merge pull request #9251 from hasnainvirk/randomizing_join_retrial
LoRaWAN: Randomizing backoff for Join process
2 parents 6fd0eea + c07ae66 commit 4ec7dd7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

features/lorawan/lorastack/phy/LoRaPHY.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ lorawan_time_t LoRaPHY::update_band_timeoff(bool joined, bool duty_cycle,
282282

283283
if (bands[i].off_time != 0) {
284284
next_tx_delay = MIN(bands[i].off_time - txDoneTime, next_tx_delay);
285+
// add a random delay from 200ms to a 1000ms
286+
next_tx_delay += (rand() % 800 + 200);
285287
}
286288
} else {
287289
// if network has been joined

0 commit comments

Comments
 (0)