Blynk.connect config opinion needed

So i went through few posts regarding Blynk.connect and Blynk.connected (i am bit confused, also docs don’t provide much clarity on those functions), and i need an opinion to know i’m using it in proper manner.

Currently when the wifi goes off and comes back on. the device doesn’t reconnect to the local server,
i’m using `Blynk.begin(auth,ssid,pass,server,port) config. The problem routed to the fact that it is called only once per boot.

So if i modify the code to

void setup() {
	Blynk.connectWifi(ssid,pass);

	Blynk.config(auth,server,port);

	Blynk.connect(); //is this necessary?

}

void loop() {
	if (Blynk.connected) {

		Blynk.run() 
		//and other codes

	} else {

		Blynk.connect();

	}
}

Will the device connect to wifi and to local server, or should i repeat the Blynk.connectWifi(ssid,pass)for the wifi part of the connection?

And shouldn’t Blynk.run() maintain constant connection with the server and wifi?

Thank You.

1 Like

Hi,

I use GSM modul, but I have almost the same problem. Have you solved the problem?

Thnaks,
Tamas