Getting Started
Create a template, set up the integration and import your first device
Last updated
Was this helpful?
Create a template, set up the integration and import your first device
Last updated
Was this helpful?
The easiest way to prototype a device on Blynk and correctly configure the integration is to use a device that is already . Once the device is connected and successfully goes online, for this device. Once you have created a new template, navigate to the Developer Zone -> Integrations -> The Things Stack. Click the "+ Add" button and select the template you previously created.
In the application settings, fill in The Things Stack hostname, username, and password. To , navigate to the application page you wish to connect on The Things Stack. Click on the Integrations button in the left sidebar and select MQTT. Copy the Public TLS address under the MQTT server host section and paste it into Blynk (if you are going to use non-TLS MQTT address, change the switch to "Insecure"). Then, copy the username from the page and paste it into Blynk. After that, click on the "Generate new API key" button, copy the password, and paste it into Blynk.
Click the "Connect" button at the bottom of the application card on Blynk. You will see the integration status change to "Connected".
If you are using any provided The Things Stack Payload Formatter, such as a Payload Formatter imported from the The Things Stack Device Repository, additional steps might be required to convert the data format into the format required by Blynk.
For uplinks, Blynk requires the data to be in key-value pair format, where the key is either the datastream name or pin (such as v1
or a10
) and the value is the datastream value. The value type must match the datastream value type! Also, prefer using only Virtual Pin, Enum and Location datastream types. Here is an example of the decoded uplink:
In this example, Blynk will set the datastream with the name "temperature" to the value 24.1 and the datastream with the name "humidity" to the value 54.
The datastreams configuration for this example may look like this:
For each datastream update via the web dashboard, mobile application, automation, etc., Blynk will send a separate downlink to the device. Here is an example of the downlink that Blynk will send to the device, indicating that the datastream with the name "speed" (pin v2
) has been updated to the value 3
:
The ts
field represents the timestamp in Unix milliseconds format when the value was actually updated.
Each application has its own status, representing its current state:
Not Connected: This initial status indicates that the application has not been saved yet. Therefore, Blynk has not yet connected to the application, and the integration will not work. This status also applies when Blynk initially fails to connect to The Things Stack with the specified parameters.
Connected: This status represents the normal state of the integration. Everything should operate normally in this status.
Broken: This status indicates a problem related to the application. Possible issues include Blynk failing to establish a connection with The Things Stack work server (e.g., due to a server restart), invalid credentials, or an internal error on The Things Stack. In this status, Blynk will periodically try to reconnect to The Things Stack server to fix the integration. Once the integration operates normally, Blynk will automatically change the status to Connected.
Once this is done, Blynk will automatically create the device connected to The Things Stack as soon as it sends any data. This device will then be available on the .
Once your first device is connected to Blynk, it's time to transfer some data! Start by configuring .
Refer to the to create datastreams.
Use the feature in Lifecycle to mark the device as online with each uplink received from The Things Stack.
Additionally, refer to the section, which provides details on how to retrieve RSSI, SNR, and Firmware Version information.
With a configured Blynk template and a working device, you can now start creating a and .
For scaling your device fleet, refer to the and sections. Be sure to explore the section to extract more valuable data from your device.
Additionally, take advantage of other powerful Blynk features, such as , , , and the , to build more advanced workflows.