Ah, that one is provided by Sodaq itself (and you’re using it for OTAA), but the other is based on an example provided by the Things Network, for their arduino-device-lib.
To summarize:
For both libraries you’re seeing OTAA joins in TTN Console. OTAA works with the Sodaq library, so we know that the gateway and the settings in TTN Console seem fine. (And the Haarlem gateway is a full-blown gateway.) The keys in both sketches seem to match (the TTN library takes the DevEUI from the RN2483, but that looks good too, and as the failing join is still shown in TTN Console, TTN accepts the configuration). So the handling in the backend should be the same for both sketches, if the Join Requests are simular.
Maybe the SF used for the Join Request (and hence for the Join Accept) is different; click the entry in TTN Console to see and compare the details. If it’s SF12:
However, I guess it’s not SF12:
…which shows TTN’s library starts with SF7 (data rate 5). Maybe the Sodaq library starts with a higher SF? (Longer air time, better reach.)
It might also help to know if the Join Accepts for both libraries are sent in RX1 (5 seconds after the Join Request) or RX2 (6 seconds), which might be different if they use a different SF. For RX1, TTN will use the same SF as the Join Request, so SF7, which somehow might not be received by the device.
In the TTN library you can change the default SF using the constructor’s optional parameters:
TheThingsNetwork ttn(Stream& modemStream, Stream& debugStream, fp_ttn_t fp,
uint8_t sf = 7, uint8_t fsb = 2);
I also wonder if some settings in the RN2483 are configured differently for both libraries, while it seems that the TTN library does not reset it to its factory state first (at least: the log does not show that), somehow affecting its ability to receive the Join Accept? Using the Soday “LoRa Serial Passthrough” sketch you could issue sys reset
, but maybe that’s really the same as a reset caused by a power cycle/programming.