EV_JOIN_TXCOMPLETE: no JoinAccept

Hi

I’m, using arduino-lmic library on an arduino Uno connected to a SX1276 Lora module. I started with ttn-otaa example but the output is always EV_JOIN_TXCOMPLETE: no JoinAccept

At TTN console i can see received activation requests, but it seems they are not succeded.

My lmic_project_config.h file is:

#define CFG_eu868 1
#define CFG_sx1276_radio 1
#define DISABLE_PING
#define DISABLE_BEACONS
#define LMIC_ENABLE_DeviceTimeReq 0

and my pin definition is:

// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {3, 4, 5},
};

I also try on setup()

LMIC_setClockError(MAX_CLOCK_ERROR * 30 / 100);

but with no luck.

Any clue?
Thanks

Sorry you’re having troubles. We discovered during the V3.3 dev cycle that people were using setClockError() for two reasons: inaccurate clocks, and poor control of timing in the calling environment. Some CPUs (STM320L0 at 2 MHz) really do have grossly incorrect clocks. But most CPUs have crystal oscillators and a clock error of more than 0.5% is unexpected.

And setClockError, applied to “fix” poorly controlled timing, grossly wastes CPU power and masks the issue without fixing it worst case.

Thus, though I may have made a mistake, I changed LMIC_setClockError() to clamp clock error to about 0.5%. If you really need to set a huge clock error, there’s a macro you can put in the config file to disable the limit. But before you do that, you should run the raw script and make sure you can receive; and run the compliance script with logging (not debug prints!) enabled to figure out why you have timing problems.