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

**URL:** <https://www.thethingsnetwork.org/forum/t/format-of-keys-and-ids-for-arduino-lmic-libraries-howto/28243>\
**Category:** LMIC\
**Tags:** how-to\
**Created:** [July 19, 2019, 11:33am UTC](https://www.thethingsnetwork.org/forum/t/format-of-keys-and-ids-for-arduino-lmic-libraries-howto/28243 "2019-07-19T11:33:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [July 19, 2019, 11:33am UTC](https://www.thethingsnetwork.org/forum/t/format-of-keys-and-ids-for-arduino-lmic-libraries-howto/28243/1 "2019-07-19T11:33:14Z")

</div>

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

- [Overview of LoRaWAN Libraries [HowTo]](https://www.thethingsnetwork.org/forum/t/overview-of-lorawan-libraries-howto/24692)
- [Arduino LMIC library naming: Classic LMIC and MCCI LMIC [HowTo]](https://www.thethingsnetwork.org/forum/t/arduino-lmic-library-naming-classic-lmic-and-mcci-lmic-howto/40592)
