# Onboarding Devices via QR-Code

**URL:** <https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644>\
**Category:** End Devices (Nodes)\
**Created:** [February 22, 2021, 12:00pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644 "2021-02-22T12:00:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel\_hobi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/daniel_hobi/32/42592_2.png) [@daniel\_hobi](https://www.thethingsnetwork.org/forum/u/daniel_hobi)\
**Post date:** [February 22, 2021, 12:00pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/1 "2021-02-22T12:00:25Z")

</div>

Hi everyone,

I have a question regarding the onboarding process of an end-devices into ttn.  
Often LoraWan devices( from the LoraWan-Alliance) have a QR-Code on them to simplfy the onboarding process.

Taken from here: [https://lora-alliance.org/wp-content/uploads/2020/11/TR005\_LoRaWAN\_Device\_Identification\_QR\_Codes.pdf](https://lora-alliance.org/wp-content/uploads/2020/11/TR005_LoRaWAN_Device_Identification_QR_Codes.pdf)

The QR-Code has at least the following information hidden inside:  
SchemaID,  
JoinEUI (AppEUI),  
DevEUI,  
ProfileID

So my Questions:  
Isn’t the AppKey also required to register an EndDevice? From where do i get the AppKey if it is not stored inside the QR-Code? What am I missing?

Thank you,  
Best regards  
Marco, Dani

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [February 22, 2021, 6:35pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/2 "2021-02-22T18:35:56Z")

</div>

The AppKey is a large random number used for the encryption - both ends need to know it, but it’s not something that has to be generated by the manufacturer, so can be left to the stack to do when the device is provisioned.

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [February 22, 2021, 7:42pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/3 "2021-02-22T19:42:42Z")

</div>

As far as I know the QR code for on boarding relies on the manufacturer storing the combination of the DevEUI, JoinEUI and AppKey (and for LoRaWAN 1.1 NwkKey) on a globally available Join Server. This join server will be used during the join process to generate the session keys. The QR code can also have an OwnerToken which allows ‘claiming’ the device (proof of ownership).

By not having to manually enter the EUIs and keys mistakes should be prevented and because the keys don’t need to be shared in a readable format the process is more secure. (However it now depends on the owner of the Join Server providing the required functionality)

---

<div class="post-metadata">

**Author:** ![daniel\_hobi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/daniel_hobi/32/42592_2.png) [@daniel\_hobi](https://www.thethingsnetwork.org/forum/u/daniel_hobi)\
**Post date:** [February 23, 2021, 3:49pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/4 "2021-02-23T15:49:08Z")

</div>

Thank you for replying. @descartes @kersing

However i’m still confused. My current understanding is that a device can only connect to ttn when the device is already registered on there and further the device needs to know the AppEUI,DeviceEUI and AppKey to be able to connect. So i have to “hardcode” these three AppEui,DevEui and AppKey into into flashmemory of the device. Any better solution is appreciated 🙂

@descartes  
So how is the device able to connect to the ttn if it doesn’t know the AppKey in advance?

@kersing  
So you are saying the AppKey should also be included in the QR-Code? (according to the link i provided it isn’t)

Thanks for your help and your patience 🙂

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [February 23, 2021, 4:21pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/5 "2021-02-23T16:21:59Z")

</div>

> [@daniel\_hobi](#):
>
> So you are saying the AppKey should also be included in the QR-Code? (according to the link i provided it isn’t)

Please read again as I said nothing like that. The key(s) are stored on a Join server the manufacturer chooses. That server might be controlled by TTN or by another party. During join the information on that server will be used.

---

<div class="post-metadata">

**Author:** ![daniel\_hobi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/daniel_hobi/32/42592_2.png) [@daniel\_hobi](https://www.thethingsnetwork.org/forum/u/daniel_hobi)\
**Post date:** [February 24, 2021, 7:11am UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/6 "2021-02-24T07:11:27Z")

</div>

@kersing  
Sorry misread your first sentence. Thank you again for answering.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 16, 2024, 12:10pm UTC](https://www.thethingsnetwork.org/forum/t/onboarding-devices-via-qr-code/44644/7 "2024-10-16T12:10:59Z")

</div>

A post was split to a new topic: [Obtaining EUI and onboarding](https://www.thethingsnetwork.org/forum/t/obtaining-eui-and-onboarding/69490)
