Manual Device Activation
Last updated
Last updated
Manual device creation can be used with any device supported by Blynk no matter which type of connection they use.
Such workflow is mostly used during prototyping or for devices that don't require end-user activation.
Follow the steps 1-4 below:
Install the latest version of Blynk Library to the IDE you use
After that, you should see Blynk folder under the File > Examples
Select the example for the hardware you use. We will use the one for ESP32
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL••••••••"
#define BLYNK_TEMPLATE_NAME "Test"
#define BLYNK_AUTH_TOKEN "••••••••••••••••••••••••"
#include <BlynkSimpleEsp32.h>
void setup()
{
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN, "wifi-ssid", "wifi-pass");
}
void loop()
{
Blynk.run();
}
Pay attention to these 4 lines: you would need to fill them.
#define BLYNK_TEMPLATE_ID "TMPL••••••••"
#define BLYNK_TEMPLATE_NAME "Test"
#define BLYNK_AUTH_TOKEN "••••••••••••••••••••••••"
...
Blynk.begin(BLYNK_AUTH_TOKEN, "wifi-ssid", "wifi-pass");
Log in to your Blynk.Console developer account
If you don't have a Device Templates -> Create New Template or open an existing one
Copy the contents of this section and paste them to your sketch
When the Template is ready, go to Search -> Devices - Create New Device
Choose a Template and give your new device a name
After the device was created, you will get the notification with TemplateID and AuthToken. Also, this info is always available in Device View -> Device Info
Now you have all the information you need to update your sketch:
Add TEMPLATE_ID
and AuthToken
to your sketch:
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL••••••••"
#define BLYNK_TEMPLATE_NAME "My First Device"
#define BLYNK_AUTH_TOKEN "••••••••••••••••••••••••"
#include <BlynkSimpleEsp32.h>
void setup()
{
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN, "your-wifi-ssid", "your-wifi-pass");
}
void loop()
{
Blynk.run();
}
Upload the sketch to your device and open Serial Monitor. Wait until you see something like this:
Blynk v.X.X.X
Your IP is 192.168.0.11
Connecting to...
Ready (ping: 40ms)