Format of Keys and ID's for Arduino LMIC libraries [HowTo]

In the TTN Console the LoRaWAN keys and ID’s for an end device can be displayed and copied in different formats. These keys and ID’s need to be configured on the end device (aka node) and are often hard-coded in the source code. If the keys and ID’s do not match the format expected by the LMIC library then things are not going to work.

When using an Arduino LMIC library (e.g. MCCI LMIC or Classic LMIC) use the following formats for the LoRaWAN keys and ID’s:

Key/ID Description Format Custom C++ type Used for activation type
DevEUI end-device identifier lsb / little-endian u1_t[8] OTAA
AppEUI application identifier lsb / little-endian u1_t[8] OTAA
AppKey application key msb / big-endian u1_t[16] OTAA
DevAddr end-device address u4_t ABP
NwkSKey network session key msb / big-endian u1_t[16] ABP
AppSKey application session key msb / big-endian u1_t[16] ABP

lsb: least significant byte first
msb: most significant byte first

Useful links

2 Likes