LogoLogo
GitHubBlynk WebsiteLogin to Blynk.Console
  • Introduction
  • Getting Started
    • Supported Hardware
    • Quickstart
      • Next Steps After Quickstart
      • Quickstart Device: Code Overview
      • Troubleshooting
    • Device Activation Methods
      • Manual Device Activation
      • WiFi provisioning
      • Static Token
    • Template Quick Setup
      • Set Up Datastreams
      • Set Up Web Dashboard
      • Set Up Mobile App Dashboard
      • Prepare Your Code
      • Test your Template
    • Send Data From Hardware To Blynk
    • Control Devices (GPIOs and beyond)
    • Events
    • Notifications (Alerts)
    • Sign Up / Sign In
  • General Concepts
    • Developer Mode
    • Device
    • Device Template
    • Connection Lifecycle
      • Disconnections And Heartbeat
    • Users
      • Multi-tenancy
    • Organizations
    • Automations
      • Forward Device Data
  • Message Usage
  • Integration Guides
    • Node-RED
    • The Things Stack
      • Getting Started
      • Device Grouping
      • Automated Device Onboarding
      • System DataStreams
    • Blues
    • NCD Industrial Vibration Sensor
    • Particle - monitor with Blynk
    • Particle - control with Blynk
    • AWS IoT Core
  • Myriota
  • OpenWeather
  • Blynk.Console
    • Overview
    • Dashboards
      • Dashboard Widgets
    • Devices
      • Device profile
        • Dashboard
        • Device Info & Metadata
        • Notifications & Events
        • Developer tools
          • General
          • Datastreams
          • Testing
          • Actions Log
      • Actions with devices
      • Segments
      • Filters
      • Notifications Settings
      • Device Sharing
    • Locations
      • Location Profile
      • Assigning Devices to the Locations
    • Organizations
      • Create a Sub-Organization
      • Working with Sub-Organizations
    • Users
      • User Profile
    • Device Templates
      • Working With Templates
      • Info
        • Offline Ignore Period
        • Manufacturer
        • Template ID
        • Categories
        • Hotspot Prefix
      • Datastreams
        • Datastream Settings
          • Name
          • Alias
          • Virtual Pin
          • Color
          • Data Type
          • Min Value
          • Max Value
          • Default Value
          • Save RAW Data
          • Invalidate Value
          • Wait for confirmation from device
          • Sync with latest server value every time device connects to the cloud
          • Expose to Voice Assistants
        • Virtual Pin
        • Location
        • Enumerable
      • Web Dashboard
        • Multiple Dashboard Tabs
      • Metadata
        • Metadata Tutorial
      • Connection Lifecycle
      • Events
        • Custom Events
          • Event Settings
          • How to Send/Log Events
          • Content Events
        • Notifications Settings
          • Custom Sounds and Critical Notifications
      • User Guides
      • Assets
    • Widgets (Console)
      • Switch
      • Slider
      • Number Input
      • Image Button
      • Web Page Image Button
      • LED
      • Label
      • Gauge
      • Chart
      • Map
      • Image Gallery
      • Custom Chart
      • Heatmap Chart
      • Video
      • Bitmask Table
      • Gradient Ramp
      • Terminal
      • Segmented Switch
      • Alarm & Sound Widget
      • Modules
    • Blynk.Air
      • Shipment Details
      • Shipment Management
        • New Shipping
      • Device shipment statuses
      • User-Controlled Shipments
    • Settings
      • Organization Settings
        • General
        • Users
        • Locations (Job Site or Facilities)
        • Tags
      • Roles and Permissions
      • Developers
        • OAuth2
        • Webhooks
        • Create New Webhook
      • Integrations
    • User Profile Menu
    • Limits
  • Blynk.Apps
    • Overview
    • Mobile Dashboard Editor
    • Device Header Constructor
      • Header Design
      • Header Mini Widgets
        • Connection Status Widget
        • Last Reported Widget
        • Tabs Widget
        • Datastream Value Widget
        • Image Widget
        • Battery Level Widget
        • Signal Level Widget
        • Tags Widget
      • Header Buttons
    • Pages
    • Widgets (app)
      • Common Widget Settings
      • List of Datastreams types supported by Widgets
    • Widgets Controllers
      • Button
      • Styled Button
      • Icon Button
      • Image Button
      • Slider
      • Vertical Slider
      • Step Slider
      • Vertical Step Slider
      • Joystick
      • zeRGBa
      • RGB Light Control
      • Step H
      • Step V
      • Slope Control
      • Switch
      • Level Slider
      • Level Slider with Switch
    • Widgets Displays
      • Value Display
      • Labeled Value
      • LED
      • Gauge
      • Radial Gauge
      • Enhanced Gauge
      • LCD
      • Simple Chart
      • SuperChart
      • Terminal
      • Video Stream
      • Level H
      • Level V
      • Image Gallery
      • Gradient Ramp
      • Icon
      • Image Animation
      • Lottie Animation
    • Widgets Interface
      • Tabs
      • Menu
      • Map
      • Text Input
      • Numeric Input
      • Time input
      • Segmented Switch
      • Icon Segmented Switch
      • Text
      • Formatted Text
      • Dynamic Spacer
    • Widgets Other
      • Music Player
      • WebPage Button
      • WebPage Image Button
      • Alias Name
    • Main Menu
      • My Profile
      • Organization
      • Settings
      • Help
      • About
      • Log Out
    • Devices
      • Add New Device
    • Automations
    • Notifications & Events
  • Blynk.Edgent
    • Blynk.Edgent overview
    • Blynk.Inject and Blynk.Air
    • OTA: Firmware Over-The-Air updates
  • Blynk.NCP
    • Blynk.NCP overview
    • Supported Connectivity Modules
    • OTA: Firmware Over-The-Air updates
  • Blynk Library - firmware API
    • Installation
      • Install Blynk Library in Arduino IDE
      • Install Blynk Library for Platformio.org
      • Install ESP8266 core for Arduino IDE
    • Configuration
    • Connection Management
    • Device Online/Offline Status
    • Digital/Analog Pins
    • Virtual Pins
    • Widget Properties
    • State Syncing
    • Timers
    • Time (RTC clock)
    • Timezone / Location
    • Log Event
    • Metadata
    • Debug
    • Reboot
    • Over-The-Air Firmware Updates (OTA)
    • Other
    • Limitations and Recommendations
    • Blynk Protocol
  • BLYNK.CLOUD MQTT API
    • Device MQTT API
      • Authentication
      • Topic Structure
      • Datastreams
      • Widget Properties
      • Events
      • Metadata
      • Timezone/Location
      • OTA
      • Miscelaneous
      • Code Examples
  • BLYNK.CLOUD HTTPS API
    • Device HTTPS API
      • Get Datastream Value
      • Get Multiple Datastream Values
      • Get Historical Data From Device
      • Update Datastream Value
      • Update Multiple Datastreams Simultaneously
      • Upload a Set of Timestamped Data
      • Update Widget/Datastream Property
      • Send/Log An Event
      • Get Device Metadata Value
      • Update Device Metadata Value
      • Is Device Connected
      • Upload a File
      • HTTPS API Troubleshooting
    • Platform API
      • Authentication
      • Ogranization API
        • Get Own Organization Info
        • Get Organization Info
        • Search Organizations
        • Create Organization
        • Get Static Tokens
        • Get Organization Tags
        • Get Organization Automations
      • Devices API
        • Get All Devices
        • Search Devices
        • Get Devices by Owner Email
        • Get Devices in user organization
        • Get Recently Activated Devices
        • Get Device Info
        • Get Connection Status
        • Create Device
        • Edit Device
        • Get Datastream Values
        • Update Datastream Value
        • Update Multiple Datastreams Values
        • Import Datastream Values
        • Update Datastream Property
        • Get Datastream Historical Data
        • Get Device Metadata
        • Update Device Metadata
        • Get Device Tags
        • Get Device Timeline Log
        • Log a Device Event
        • Get Actions Log
        • Erase All Data
        • Remove Device Owner
        • Transfer Device
        • Delete Device
      • Users API
        • Get All Users
        • Search Users
        • Create New User
        • Invite User
        • Get User Info
        • Update User Role
      • Templates API
        • Get All Templates
        • Get Template Info
        • Get Template Metadata
        • Get Template Datastreams
        • Get Template Events
    • Security
  • Downloads
    • Blynk Mobile Apps
    • Blynk Library
  • Troubleshooting
    • General Issues
    • Developer Mode
    • Changes from Blynk 0.1
      • Migrating to the new Blynk - Full Guide
    • Glossary
    • Links
  • Commercial Use
    • Deploying Products With Dynamic AuthTokens
    • Deploying Products With Static Tokens
    • Working With Clients
    • Supported topologies
    • Business Plan (White Label Solution)
      • App Publishing Process And Timeline
      • What's Needed To Publish Your Apps And Go Live
      • Branding Materials
      • Custom Email Address For Transactional Emails
      • Application Settings
        • General
        • Design
        • Mobile Apps
        • Sign Up
  • Add-Ons
    • Add-on list
    • Amazon Alexa
    • Google Assistant
    • Localization
    • Database Access
    • Marketing
Powered by GitBook
On this page
  • How WiFi provisioning works
  • Setting up your sketch to enable WiFi Provisioning
  • Activating the device using Blynk app
  • Re-provisioning new WiFi credentials
  • Troubleshooting
  • ESP32/ESP8266-specific issues

Was this helpful?

  1. Getting Started
  2. Device Activation Methods

WiFi provisioning

Sending WiFi credentials and the Auth Token to your device. This feature is also known as "Dynamic Provisioning" and "WiFi Manager"

Remember going to a coffee shop and asking for the name and password for their WiFi network to connect your smartphone or laptop to? Familiar situation, right?

Now imagine your ESP32 or other hardware wants to connect to the Internet. It would also need the wifi network name and password. Good news, Blynk can do it for you.

A complete WiFi provisioning solution from Blynk includes both a firmware code and a mobile app UI to guide you through the WiFi setup. It's called Blynk.Inject

Currently, WiFi provisioning with Blynk.Inject works on ESP32, ESP8266, WiO Terminal by Seeed, Arduino MKR1010, Arduino Nano 33IoT, and Texas Instruments CC3220.

Raspberry Pi will be supported soon.

How WiFi provisioning works

You can skip this part as this is something you don't have to think about because Blynk does everything for you. But it might be helpful to understand how it works under the hood.

  1. In the beginning, your hardware will act as an Access Point (AP). It means that your device will broadcast its own WiFi network with an SSID (name) similar to Blynk Device-1234

  2. Your smartphone will connect to this AP with the Blynk app (or from smartphone settings) and they will start communicating directly with each other

  3. Blynk app will ask you for the name (SSID) and password of the WiFi network you would like to connect this device to

  4. WiFi information (SSID and password) will be sent to the device

  5. Also, Blynk app will request an Auth Token from the server and then send it to the device

  6. Your device will store all of these items in Flash/EEPROM memory

  7. After that, the device will automatically reboot. The AP mode will be turned off.

  8. The device will use the WiFi credentials you provided to connect to your home or office WiFi network

  9. After the successful authentication, the device is added to your account and is ready to use

  10. If you later need to connect this device to a different network, WiFi credentials can be changed using Blynk app, by resetting the device with a physical button (you would need to plan it into your electrical circuit design)

Now let's make it work for your devices.

To enhance the end-user experience it's highly recommended that you plan certain components into device's electrical design. Especially if you are working on a commercial product!

  1. Plan a physical button which will allow resetting the device to its default settings. E.g.: Holding this button for N seconds will erase the AuthToken and WiFi credentials.

  2. Plan an LED to indicate different statuses of device (AP, connected, etc.). It can be RGB or one-color LED.

Setting up your sketch to enable WiFi Provisioning

  1. After that, you should see Blynk folder under the File > Examples

  2. Select Blynk.Edgent > Edgent_ESP32

In the sketch variables BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME are empty. They must be filled in with the values from your template. Read below on where to find them.

  1. Copy the Firmware Configuration code lines

  2. Go back to your sketch and replace the configuration lines with what you copied.

The Template Name is the name that you provide when you create the template, and the Edgent sketch then adds additional characters that are derived from the Chip ID of the device to form the SSID name which is used when the app connects to the device.

The template name + Chip ID should not exceed 32 characters for the provisioning process to complete successfully. You can edit the template name if the resulting SSID name proved too long.

Press the Upload button to flash the code to your device. If the upload process went successfully you should see the output in the serial monitor.

Now your device is ready to be activated using Blynk app.

Activating the device using Blynk app

  1. Open Blynk App

  2. Open the MENU icon in the upper right corner

  3. Tap on +Add New Device -> Find devices nearby -> Start

  4. The app will scan the WiFi networks around you and offer to connect to your device. In our example, the device name will be: Blynk Root Template-FAD8F

  5. Once the connection is established, the Blynk app will guide you through the provisioning process.

When the process is over, you will be prompted to name the device. At this stage, the device is ready to use.

Here is an example of how it works in the app:

For debugging and troubleshooting check the serial monitor output. There you will see how the provisioning process is happening on the device.

Re-provisioning new WiFi credentials

If you’re having problems provisioning a device, or you’ve accidentally entered the wrong WiFi credentials, then press and hold the physical button (the one defined in Settings.h for your board type) for 10 seconds. This will clear the stored credentials and the LED will start flashing quickly and allow you to either repeat the provisioning process, or if the device has already been created in the app you can re-provision it.

To re-provision an existing device, tap on the device in the app, then tap the three dots in the top right-hand corner of the app screen. This will bring up the device information/timeline screen.

Tap on the three dots in the top right-hand corner once more, and this will pop up a dialog that allows you to “Reconfigure”, “Erase all device data”, “Delete Device” or “Cancel”.

Choose “Reconfigure” and this will take you back into the provisioning process described in the earlier section.

If the wrong SSID was selected and/or the password was entered before then take care to enter the correct information rather than using the credentials stored in the app.

Troubleshooting

  • The Template name isn’t too long (see the restrictions for BLYNK_TEMPLATE_NAME above)

  • The template ID and template name in the sketch are EXACTLY as they appear in the web console

  • The app is signed in to the same user account as the web console, or

  • The user has permission to provision new devices.

ESP32/ESP8266-specific issues

If you cannot configure the device, and the log displays AP IP: 0.0.0.0 , please ensure you're using the latest stable Arduino Core version (i.e., not an outdated, beta, or rc version).

In some rare cases it could be a hardware issue of a specific module, so if you have any issues please also try using a new (unused) module.

PreviousManual Device ActivationNextStatic Token

Last updated 1 year ago

Was this helpful?

You can find in Blynk.Edgent examples

Install Blynk Library in Arduino IDE (or download as a .zip file and install the library as a zip file)

Open

Log in to your developer account

Go to Developer Zone -> My Templates -> or open an existing template

If the LED on the board isn’t doing anything, then ensure that the and that you don’t have any peripherals also using the LED or Switch pins. If the LED is pulsing slowly then the board thinks it’s already provisioned. Follow the instructions in the “” section. If the LED is flashing quickly, but the device doesn’t show up in the app when you tap the “Ready” button in the app then check the following:

the latest release
Arduino IDE
Blynk.Console
Re-provisioning new WiFi credentials
Create New Template
references to handling reset and statuses indication
LED and switch are defined correctly