Automated Device Onboarding
Last updated
Last updated
To enable the Automated Device Onboarding through Blynk, follow these steps:
Open the advanced settings of the application on Blynk.
Turn on the "Enable automated device onboarding" switch.
Specify the LoRaWAN version, Frequency plan, and Regional Parameter Version. Also, enable the "Support class B" and/or "Support class C" checkboxes if required.
Specify the addresses of The Things Network components. You can find the correct values at the bottom of the "Overview" page on your The Things Network dashboard.
Save the changes.
At this point, Blynk creates three new metadata fields in the device template: Device EUI, Join EUI (same as App EUI), and Application Key.
Additionally, Blynk requires the "View device keys in application", "Create devices in application" and "Edit device keys in application" permissions. To provide this, generate a new API key or edit the existing one that you were using with Blynk.
Now that automated device onboarding is enabled and configured, you can onboard your first device. Blynk supports three ways to onboard a device on The Things Network. Let's cover them separately.
Sometimes, a device requires a reboot to initiate the onboarding flow. Make sure to restart the device if it doesn't automatically start the onboarding process after following the setup steps. This can help ensure the device properly connects and begins the necessary communication with Blynk and The Things Network.
This is the easiest, but least scalable way to onboard the device:
Start by creating the device from the template on the web dashboard.
Open "Info & Metadata" and fill out the three metadata fields: Device EUI, Join EUI (same as App EUI), and Application Key.
Once these three metadata fields are specified, Blynk will automatically create the device in The Things Network application.
The preferred method for device provisioning is using Static Tokens. Here’s how to do it:
Create a CSV file listing the Device EUI, Join EUI (same as App EUI), and Application Key for each device.
Use this CSV file to create static tokens: open the Developer Zone -> Static Tokens -> Generate Static Tokens -> Create From File. Then select the device template and upload the file.
This process will generate a unique QR code for each device.
These QR codes can be scanned via the mobile application or on the web dashboard.
Once a QR code is scanned and the device is created, it will be automatically created on The Things Network.
Here is an example of a CSV file that could be used for creating static tokens:
Blynk also supports LoRaWAN® Device Identification QR Codes for Automated Onboarding. To use them, follow these steps:
First, create the static tokens as described in the "Onboard using Static Tokens" section.
Construct the QR code in the LoRaWAN format using the Profile ID specified in the advanced settings of The Things Network integration application card.
Additionally, you can change the Profile ID used in the QR code body. To do so, open the application settings on Blynk, locate to the advanced settings and edit the Profile ID field.
For LoRaWAN QR codes, Blynk requires the following:
The code must start with LW:D0
.
It must contain the Join EUI (same as App EUI), Device EUI, and the Profile ID.
Optionally, it may contain a checksum.
Any other parts of the QR code are ignored.
Here is an example of how the QR code data should be structured:
Here is an example of the QR code body with Join EUI = 70B3D57ED0000010
, Device EUI = 0018B20000000101
and Profile ID = 000AF8BE
:
Then this QR code can be scanned in the same way as Static Tokens in the mobile application or on the console. Once the device is created, it will be automatically onboarded on The Things Network.
If you've changed your hardware or updated any LoRaWAN connection parameters (such as DevEUI, AppEUI/JoinEUI, or Application Key), you will need to create a new device in TheThingsStack.
To retain the historical data, settings, or any other details for the old device in Blynk, follow these steps:
Navigate to the Device Information & Metadata tab for the old device in Blynk.
Update the TheThingsNetwork Device ID metafield.
Optionally, you can also update other related metafields like DevEUI, JoinEUI, and Application Key.
If the new device goes online in TheThingsStack before updating the metafields in Blynk, it may be automatically imported into Blynk. In case of a TheThingsNetwork Device ID collision (where two devices have the same ID), Blynk will randomly select one device. To resolve this, simply delete the automatically imported device to ensure the correct one is used.