Automated Device Onboarding

This flow is available for PRO users and above.

If you’re on the Free plan, follow the process outlined in this guide, where you first connect the device to TTS. Once connected, it will automatically be added to Blynk.

To enable the Automated Device Onboarding through Blynk, follow these steps:

  1. Open the advanced settings of the application on Blynk.

  2. Turn on the "Enable automated device onboarding" switch.

  3. Specify the LoRaWAN version, Frequency plan, and Regional Parameter Version. Also, enable the "Support class B" and/or "Support class C" checkboxes if required.

  4. Specify the addresses of The Things Stack components, which can be found by navigating to Home -> Admin panel -> Network information at the bottom of the page. If you are using The Things Stack Sandbox, all components share the same regional domain.

  5. Save the changes.

The Things Stack Application Advanced Settings

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.

API Key settings on The Things Network Application page

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 Stack. 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 Stack.

Manually configure the tokens

This is the easiest, but least scalable way to onboard the device:

  1. Start by creating the device from the template on the web dashboard.

  2. Open "Info & Metadata" and fill out the three metadata fields: Device EUI, Join EUI (same as App EUI), and Application Key.

Device Info & Metadata Settings

Once these three metadata fields are specified, Blynk will automatically create the device in The Things Stack application.

Onboard using Static Tokens

The preferred method for device provisioning is using Static Tokens. Here’s how to do it:

  1. Create a CSV file listing the Device EUI, Join EUI (same as App EUI), and Application Key for each device.

  2. 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.

  3. This process will generate a unique QR code for each device.

  4. These QR codes can be scanned via the mobile application or on the web dashboard.

  5. Once a QR code is scanned and the device is created, it will be automatically created on The Things Stack.

Here is an example of a CSV file that could be used for creating static tokens:

Device EUI,Join EUI,Application Key
0018B20000000101,70B3D57ED0000010,2B7E151628AED2A6ABF7158809CF4F3C
0018B20000000102,70B3D57ED0000011,3B7E151628AED2A6ABF7158809CF4F3D
0018B20000000103,70B3D57ED0000012,4B7E151628AED2A6ABF7158809CF4F3E

Onboard using LoRaWAN QR Code

Blynk also supports LoRaWAN® Device Identification QR Codes for Automated Onboarding. To use them, follow these steps:

  1. First, create the static tokens as described in the "Onboard using Static Tokens" section.

  2. Construct the QR code in the LoRaWAN format using the Profile ID specified in the advanced settings of The Things Stack 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.

Application Profile ID Field

For LoRaWAN QR codes, Blynk requires the following:

  1. The code must start with LW:D0.

  2. It must contain the Join EUI (same as App EUI), Device EUI, and the Profile ID.

  3. Optionally, it may contain a checksum.

  4. Any other parts of the QR code are ignored.

Here is an example of how the QR code data should be structured:

LW:D0:<Join EUI>:<Device EUI>:<Profile ID>:<Optional CheckSum>

Here is an example of the QR code body with Join EUI = 70B3D57ED0000010, Device EUI = 0018B20000000101 and Profile ID = 000AF8BE:

LW:D0:70B3D57ED0000010:0018B20000000101: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 Stack.

Re-provisioning

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 The Things Stack.

To retain the historical data, settings, or any other details for the old device in Blynk, follow these steps:

  1. Navigate to the Device Information & Metadata tab for the old device in Blynk.

  2. Update the TheThingsNetwork Device ID metafield.

  3. Optionally, you can also update other related metafields like DevEUI, JoinEUI, and Application Key.

Last updated

Was this helpful?