Configuration

Blynk.begin()

The easiest way to configure Blynk is to use Blynk.begin():
1
Blynk.begin(auth, ...);
Copied!
It has multiple parameters for different hardware models and it also depends on the type of connection. Follow the example sketches for your specific hardware model.
What happens inside of Blynk.begin() function:
  1. 1.
    Connection to the network (WiFi, Ethernet, ...)
  2. 2.
    Call of Blynk.config(...) to set Auth Token, Server Address, etc.
  3. 3.
    Attempts to connect to the server once (can block for more than 30s)
If your shield/connection type is not supported yet - you can implement it by yourself. Here are some examples.

Blynk.config()

config() allows you to manage network connection. You can set up your connection type (WiFi, Ethernet, ...) by yourself, and then call:
1
Blynk.config(auth, server, port);
Copied!
or just
1
Blynk.config(auth);
Copied!
NOTE: After Blynk.config(...) is called, your hardware is not yet connected to the server. It will try to connect while until it hits first instance of Blynk.run() or Blynk.connect()routine. To skip connecting to the server or to disconnect manually, call Blynk.disconnect() after configuration.
Use connectWiFi to conveniently set up WiFi connection:
1
Blynk.connectWiFi(ssid, pass);
Copied!
To connect to open WiFi networks, set pass to an empty string ("").
Last modified 11mo ago