# Manual Device Activation

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:

<details>

<summary>Step 1: Perparing your sketch</summary>

1. Install the latest version of Blynk Library to the IDE you use
2. After that, you should see Blynk folder under the **File > Examples**
3. Select the example for the hardware you use. We will use the one for ESP32

```cpp
#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.

```cpp
#define BLYNK_TEMPLATE_ID      "TMPL••••••••"
#define BLYNK_TEMPLATE_NAME    "Test"
#define BLYNK_AUTH_TOKEN       "••••••••••••••••••••••••"
...
Blynk.begin(BLYNK_AUTH_TOKEN, "wifi-ssid", "wifi-pass");
```

</details>

<details>

<summary>Step 2: Getting Template ID</summary>

#### Template ID and Device Name

1. Log in to your [Blynk.Console](https://blynk.cloud/) developer account, go to Developer Zone
2. [Create New Template](https://docs.blynk.io/en/~/revisions/ynmC8lZ6FPocTYWigjcO/template-quick-setup#create-a-template) or open an existing one
3. Copy the contents of this section and paste them to your sketch

<img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FgU9nxjkQO8K30fiJY0Vp%2F5-manual%20device%20act-templ%20id%201.png?alt=media&#x26;token=2aa32c34-f520-4ab6-8db2-b0b01e292170" alt="" data-size="original">

</details>

<details>

<summary>Step 3: Getting Auth Token</summary>

#### Getting Auth Token

When the Template is ready, go to Devices -> **Create New Device**

<img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FF94Ho58LFb6VloKPwrK1%2F6-manual%20device%20act-new%20device%201.png?alt=media&#x26;token=b779e643-4ac9-4b6a-bac3-970ee1216abf" alt="" data-size="original">

Choose a Template and give your new device a name

<img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FF9HQij1Pg3m2Z74hcaY4%2F7-manual%20dev%20act-new%20device-1%201.png?alt=media&#x26;token=67e59779-741f-44c6-9c4b-c698d541926f" alt="" data-size="original">

After the device was created, you will get the notification with TemplateID and AuthToken. Also, this info is always available in Devices -> Device -> Device Info

<img src="https://1839001309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBFTVMf7L6S67HOuqVC%2Fuploads%2FvGC56IzTzkabCfxiHdGp%2F8-manual%20device%20act-device%20info%201.png?alt=media&#x26;token=faf1fdb0-ad09-4a34-894e-fbc0ff1662ec" alt="" data-size="original">

Now you have all the information you need to update your sketch:

</details>

<details>

<summary>Step 4: Updating sketch with Template ID and AuthToken</summary>

Add `TEMPLATE_ID` and `AuthToken` to your sketch:

<pre class="language-cpp"><code class="lang-cpp">#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID      "TMPL••••••••"
#define BLYNK_TEMPLATE_NAME    "My First Device"
#define BLYNK_AUTH_TOKEN       "••••••••••••••••••••••••"

#include &#x3C;BlynkSimpleEsp32.h>

<strong>void setup()
</strong>{
  Serial.begin(115200);
  Blynk.begin(BLYNK_AUTH_TOKEN, "your-wifi-ssid", "your-wifi-pass");
}

void loop()
{
  Blynk.run();
}
</code></pre>

Upload the sketch to your device and open Serial Monitor. Wait until you see something like this:

```bash
Blynk v.X.X.X
Your IP is 192.168.0.11
Connecting to...
Ready (ping: 40ms)
```

#### Congrats! Your device should be now online!

</details>
