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.
pull/9370/head
Hasnain Virk 2019-01-04 02:08:12 +02:00 committed by adbridge
parent 498e4e6b7d
commit dd81345d41
1 changed files with 2 additions and 0 deletions

View File

@ -282,6 +282,8 @@ lorawan_time_t LoRaPHY::update_band_timeoff(bool joined, bool duty_cycle,
if (bands[i].off_time != 0) {
next_tx_delay = MIN(bands[i].off_time - txDoneTime, next_tx_delay);
// add a random delay from 200ms to a 1000ms
next_tx_delay += (rand() % 800 + 200);
}
} else {
// if network has been joined