OTAA Join Debugging

Yes, I am definitevely sure they match. I checked the C source code and serial debug output of the STM board, it also outputs the very same DevEUI, AppEUI and AppKey values as configured for the device in TTN console. The DevNonce seems to be a random 16bit value, no incrementing counter.

After examining the I-CUBE-LRWAN library and adding some more PRINTF()s towards the serial debug output, I finally managed to get a step further.
The ComputeCmac() function is called with keyID = NWK_KEY which made no sense to me, since the STM can’t know the Network key before the Join? So I changed it to keyID = APP_KEY (in LoRaMacCrypto.c, inside function LoRaMacCryptoPrepareJoinRequest()). Now the MIC is correct, my Join Request is forwarded to the Application and I can see the outgoing Join Accept message in the Gateway Traffic log in TTN console.

Are there other users out there using the combination

  • STM32 NUCLEO-L053R8
  • Semtech LoRa board SX1272MB2xAS
  • ST I-CUBE-LRWAN library v1.3.1

and see a similiar problem? I mean, changing Key type settings inside a library C file to achieve basic functionality seems a bit odd to me. Either the library is not tested before release or I missed some detail in setting up the project configuration. Also, does anyone know where to get older versions of these ST libraries? They only seem to host the most recent version behind their login-wall on the ST website.

Thank you for your commitment, @arjanvanb - searching through the forum, I see you being active a lot here

1 Like