If you are meeting Blynk for the first time - welcome! Blynk is here to help all of those talented developers and entrepreneurs looking to prototype, deploy, and remotely manage connected electronic devices at any scale. Our new platform will let you connect hardware to the cloud and use pre-made app modules to build iOS, Android, and web applications ready for the end-users.
We prepared a quick tutorial to guide your first steps with the new Blynk. It's going to cover the process from the first device activation to sending device data to Blynk.
Note: If you are a Blynk 1.0 user, you will need to create a new account to access to the new platform.
Enable Developer Mode
Developer is a special user who has access to all of the functionality required to configure the platform for the use by end-users. This is usually someone who builds the hardware, develops the firmware, and does all of the device configurations.
Navigate to My Profile / User profile in the left menu
Check that Developer Mode switch is set to ON
Note: Currently, only one developer is allowed per Organization to avoid sync issues. This limit can be changed later.
Template Quick Setup
Once you are in Developer mode, you can start working on your first Device Template. Device Template is a set of configurations inherited by devices of a similar type. Think about smart home switches. They all perform a similar function and it's safe to assume that they should have the same data model, GPIOs, firmware code, etc. If you would need to introduce changes to all of these devices, instead of editing each of them you could just edit a Device Template and all devices will be updated.
send random values to the web and mobile dashboard in given intervals
receive user input from the web or mobile dashboard UI elements
Activate your first device
Now that you have created one or more Device Templates, you can start getting your devices online.
To start using Blynk.Cloud you should assign a unique AuthToken to each device. AuthToken's aim is to identify the device in the Blynk Cloud. There are a few ways of getting Auth Tokens for your device and they may vary depending on the hardware, connectivity, and the IoT use-case you are working on.
Here are the two main ways of putting AuthTokens on your devices:
A. WiFi provisioning using Blynk.Edgent
For devices that can connect to the Internet over WIFI we recommend going with built-in into Blynk app WiFi provisioning method. This method is also called Dynamic Auth Token provisioning.
Blynk app, and Blynk.Edgent will take care of telling your devices how to connect to your home or office WiFi network. New Auth Token will be automatically generated and stored on the device. You don't need to specify WiFi credentials and Auth Token in the firmware code.
We highly recommend using WiFi provisioning if you are working on a commercial WiFi product.
Benefits of WIFI provisioning method for commercial applications:
You can't predict which WiFi network your clients will connect your products to.
It simplifies the manufacturing process at scale as you can use similar firmware code without a need to manually add Auth Token to each device at the end of the manufacturing line.
B. Activating device with a Static Auth Token (for Ethernet, cellular, and other connection types)
This method is recommended for devices that can connect to the Internet using Ethernet, Cellular (2G, 3G, 4G, LTE) or other types of connection (that don't require custom WiFi credentials for example).
The main difference from WiFi provisioning is that AuthToken should be manually generated and flashed to the device before it can be used.
Static Auth Token is often used during the prototyping stage. However, Blynk also offers a complete solution to work with Static tokens in the commercial applications.
To send messages from the app to the code that's running on your board (via the Blynk server) you will use virtual pins.
Virtual pins are hardware independent. This means that it's far easier to port your code from one hardware platform to another in future (for example, you may realize that the NodeMCU is better than the Arduino Uno + ESP-01 that you started with).
You have far more control over what your widget does when using virtual pins. For example, if you want a single app button to switch multiple relays on or off at the same time it is very easy to do with virtual pins.
Virtual pins are more predictable (stable if you like) than manipulating digital pins.