Athentication token vs template id and device name

In blynk example code, there is authentication id while we get template id and device name in newer blynk project. So how to replace authentication id with template id and device name in newer blynk project?

thank you all

It’s difficult to fully understand your question, not least because the terms you are using don’t match with those used in Blynk.

When you create a Template in the Blynk web console you will see the following…

If you plan on using the Edgent example sketch then this is all you need to add to your sketch, as the BLYNK_AUTH_TOKEN will be generated automatically when you create the device via the app and provision it.

If you aren’t using Edgent then you need to manually create a device from your template. This can be done via the web console, and when you do you will see this in the Device Info tab…

Does that answer your question?


i used the PushData example in Arduino IDE>Examples>Blynk>Getting Started.
in the code, there is:
char auth[] = “YourAuthToken”;
which ask for auth. token. how can i get it?

I also saw the example, Blynk Example Browser
in this code example, there is:

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
#define BLYNK_DEVICE_NAME           "Device"
#define BLYNK_AUTH_TOKEN            "YourAuthToken"

where in the comment it says Auth Token are provided by the Blynk.Cloud by i dont see auth token when i created a template

That example hasn’t been updated to reflect the Firmware Configuration data that is now available via the web console Device Info tab.

Paste the three lines of Firmware Configuration data at the top of that sketch, replacing this line:

/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID   "YourTemplateID"

and change this line:

char auth[] = "YourAuthToken";


char auth[] = BLYNK_AUTH_TOKEN;

As I explained in post#2 you have to create a DEVICE from your TEMPLATE to obtain a device auth token, unless you are using Edgent, which you are not.