From ebc8faa65b3650cd5a7cde5e7ae416a718963eaa Mon Sep 17 00:00:00 2001 From: Kent Wiliams Date: Wed, 8 Apr 2020 09:18:36 -0700 Subject: [PATCH] adding clock error relax fixes joining attempts --- sparkfun-pro-rf/longfi-us915.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sparkfun-pro-rf/longfi-us915.ino b/sparkfun-pro-rf/longfi-us915.ino index 0cf5c16..8509148 100644 --- a/sparkfun-pro-rf/longfi-us915.ino +++ b/sparkfun-pro-rf/longfi-us915.ino @@ -127,6 +127,14 @@ void setup() { // Reset the MAC state. Session and pending data transfers will be discarded. LMIC_reset(); + // allow much more clock error than the X/1000 default. See: + // https://github.com/mcci-catena/arduino-lorawan/issues/74#issuecomment-462171974 + // https://github.com/mcci-catena/arduino-lmic/commit/42da75b56#diff-16d75524a9920f5d043fe731a27cf85aL633 + // the X/1000 means an error rate of 0.1%; the above issue discusses using + // values up to 10%. so, values from 10 (10% error, the most lax) to 1000 + // (0.1% error, the most strict) can be used. + LMIC_setClockError(1 * MAX_CLOCK_ERROR / 40); + LMIC_selectSubBand(6); LMIC_setLinkCheckMode(0); LMIC_setDrTxpow(DR_SF7, 14);