diff --git a/src/LMIC-node.cpp b/src/LMIC-node.cpp index b60d3a0..5056176 100644 --- a/src/LMIC-node.cpp +++ b/src/LMIC-node.cpp @@ -858,8 +858,16 @@ void setup() LMIC_startJoining(); } - // Schedule initial doWork job for immediate execution. - os_setCallback(&doWorkJob, doWorkCallback); + #ifdef ABP_ACTIVATION + // Schedule initial doWork job for immediate execution. + // + // This is not done for OTAA activation because the job + // will be run before the join completes, but can't send + // an uplink, assuming it takes less than about 6 seconds + // to run. The EV_JOINED event already schedules the job + // to run immediately after it. + os_setCallback(&doWorkJob, doWorkCallback); + #endif } diff --git a/src/LMIC-node.h b/src/LMIC-node.h index 2df13e0..1d6fee4 100644 --- a/src/LMIC-node.h +++ b/src/LMIC-node.h @@ -224,8 +224,11 @@ enum class ActivationMode {OTAA, ABP}; printer.println(); } } + +#endif // USE_SERIAL || USE_DISPLAY +#if defined(USE_LED) || defined(USE_DISPLAY) void setTxIndicatorsOn(bool on = true) { if (on) @@ -247,8 +250,7 @@ enum class ActivationMode {OTAA, ABP}; #endif } } - -#endif // USE_SERIAL || USE_DISPLAY +#endif // USE_LED || USE_DISPLAY #ifdef USE_DISPLAY