LMIC_setClockError()
Have you relaxed LMIC timing?
See: Strange problem: RFM95 + LMIC-Arduino, long JOIN delays and missing frames
Have you tried using ABP instead of OTAA and does ABP work properly without delays?
If so then that probably indicates a timing issue.
AVR MCU’s like ATmega328 and ATmega32U4 (which is on the LoRa32U4 board) - especially the 8 MHz versions - in combination with LMIC usually require relaxation of LMIC timing to prevent delays / issues with OTAA joining.
LMIC timing can be relaxed with LMIC_setClockError()
as shown below where it is
added to the ttn-otaa.ino
example:
// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
// ### Relax LMIC timing ###
// Required for ATmega328/ATmega32U4 (8MHz) otherwise OTAA joins on SF7 and SF8 will likely fail.
#define LMIC_CLOCK_ERROR_PERCENTAGE 3
LMIC_setClockError(LMIC_CLOCK_ERROR_PERCENTAGE * (MAX_CLOCK_ERROR / 100.0));
// Start job (sending automatically starts OTAA too)
do_send(&sendjob);