Skip to content

Commit c07ae66

Browse files
author
Hasnain Virk
committed
Randomizing backoff for Join process
Randomizing backoff by 200ms to 1000ms for Join Requests in a dense network will add robustness and better chances of reception by the base station especially in cases of catastrophic network outage and reconnection.
1 parent f9e840e commit c07ae66

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)