The purpose of this page is to provide an easy to use generator for the IBM LMIC (LoRaWAN-MAC-in-C) library, slightly modified to run in the Arduino environment, allowing for the use of SX1272, SX1276 transceivers and compatible modules (such as some HopeRF RFM9x modules and the Murata LoRa modules.)

In LoRaWAN consoles, EUI keys and IDs for an end device can often be displayed and copied in different formats. These keys and IDs need to be configured on the end device (aka node) and are often hard-coded in the source code. If the keys and IDs do not match the format expected by the LMIC library then transmissions and whatnot are not going to function as expected

When using an Arduino LMIC library (e.g. MCCI LMIC) use the following formats for the LoRaWAN EUI keys and IDs:

Information about the LoRaWAN protocol is summarized in LoRaWAN-at-a-glance and here. Full information is available from the LoRa Alliance.

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
What is LSB and MSB? Computers store data in memory in binary. One thing that is often overlooked is the formatting at the byte level of these data. This is called endianness and it refers to the ordering of the bytes. Specifically, little-endian is when the least significant bytes are stored before the more significant bytes - hence why it is called least significant byte or LSB, and big-endian is when the most significant bytes are stored before the less significant bytes - hence why it is called most significant byte or MSB. When writing a number (in hex), i.e. 0x12345678, it is writen with the most significant byte first (the 12 part). In a sense, big-endian is the “normal” way to write things down. This generator was inspired by Mobilefish's converter.
 

DevEUI (Device EUI, 0 of 8-bytes)



Arduino Sketch (DEVEUI LSB):
static const u1_t PROGMEM DEVEUI[8] =

AppEUI (Application EUI, 0 of 8-bytes)



Arduino Sketch (APPEUI LSB):
static const u1_t PROGMEM APPEUI[8] =

AppKey (Application Key, 0 of 16-bytes)



Arduino Sketch (APPKEY MSB):
static const u1_t PROGMEM APPKEY[16] =